diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-21 13:43:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-21 13:43:01 +0000 |
commit | 9cb64ba2151b213f5544b2e53c6668061f197b9c (patch) | |
tree | bf4c796a96df96a9875af9d772826937f66ee33c /src/mir_app | |
parent | bc69e94ff28a1f7cd0c0b99fa7d2702b8807539f (diff) |
MS_UTILS_GETRANDOM -> mir_core::Utils_GetRandom
git-svn-id: http://svn.miranda-ng.org/main/trunk@14299 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/netlibbind.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/utils.cpp | 22 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/mir_app/src/netlibbind.cpp b/src/mir_app/src/netlibbind.cpp index 2627b0fc96..4613fab402 100644 --- a/src/mir_app/src/netlibbind.cpp +++ b/src/mir_app/src/netlibbind.cpp @@ -41,7 +41,7 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn) return false;
WORD num;
- CallService(MS_UTILS_GETRANDOM, sizeof(WORD), (LPARAM)&num);
+ Utils_GetRandom(&num, sizeof(WORD));
*portn = num % *portn;
}
diff --git a/src/mir_app/src/utils.cpp b/src/mir_app/src/utils.cpp index 6022c3e87f..64b204da68 100644 --- a/src/mir_app/src/utils.cpp +++ b/src/mir_app/src/utils.cpp @@ -341,26 +341,6 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-typedef BOOL (APIENTRY *PGENRANDOM)(PVOID, ULONG);
-
-static INT_PTR GenerateRandom(WPARAM wParam, LPARAM lParam)
-{
- if (wParam == 0 || lParam == 0) return 0;
-
- PGENRANDOM pfnRtlGenRandom = NULL;
- HMODULE hModule = GetModuleHandleA("advapi32");
- if (hModule) {
- pfnRtlGenRandom = (PGENRANDOM)GetProcAddress(hModule, "SystemFunction036");
- if (pfnRtlGenRandom) {
- if (!pfnRtlGenRandom((PVOID)lParam, wParam))
- pfnRtlGenRandom = NULL;
- }
- }
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
int LoadUtilsModule(void)
{
bModuleInitialized = TRUE;
@@ -368,7 +348,7 @@ int LoadUtilsModule(void) CreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER, GetCountryByNumber);
CreateServiceFunction(MS_UTILS_GETCOUNTRYBYISOCODE, GetCountryByISOCode);
CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST, GetCountryList);
- CreateServiceFunction(MS_UTILS_GETRANDOM, GenerateRandom);
+
CreateServiceFunction(MS_UTILS_ENTERSTRING, svcEnterString);
CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda);
|