From 3290e01656f52149b1c0c871a84357ec53510e26 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Mon, 21 Mar 2016 01:29:54 +0000 Subject: MSN: Skylogin UNICODE fixes. git-svn-id: http://svn.miranda-ng.org/main/trunk@16519 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/skylogin/common.h | 2 +- protocols/MSN/src/skylogin/platform_w32.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/protocols/MSN/src/skylogin/common.h b/protocols/MSN/src/skylogin/common.h index 863d8af07a..989b279085 100644 --- a/protocols/MSN/src/skylogin/common.h +++ b/protocols/MSN/src/skylogin/common.h @@ -82,7 +82,7 @@ typedef struct typedef struct { uchar *Memory; - int MsZ; + unsigned long MsZ; } Memory_U; typedef struct diff --git a/protocols/MSN/src/skylogin/platform_w32.c b/protocols/MSN/src/skylogin/platform_w32.c index eb75ed4e28..bbddc270ef 100644 --- a/protocols/MSN/src/skylogin/platform_w32.c +++ b/protocols/MSN/src/skylogin/platform_w32.c @@ -20,7 +20,7 @@ static uchar RandomSeed[SHA_DIGEST_LENGTH] = {0}; -static BOOL QueryRegValue(HKEY hKey, LPCTSTR lpSubKey, LPBYTE lpValue, LPDWORD pCbValue) +static BOOL QueryRegValue(HKEY hKey, LPCSTR lpSubKey, LPBYTE lpValue, LPDWORD pCbValue) { char *pSubKey, *pTok, szKey[256]={0}; DWORD dwIndex; @@ -88,9 +88,9 @@ void InitNodeId(Skype_Inst *pInst) "SOFTWARE\\FakeSkype\\NodeId", (LPBYTE)&pInst->NodeID, &BufSz)) return; *(int64_t *)&pInst->NodeID = BytesRandomI64(); - if (RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\FakeSkype", &hKey) == ERROR_SUCCESS) + if (RegCreateKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\FakeSkype", &hKey) == ERROR_SUCCESS) { - RegSetValueEx(hKey, "NodeId", 0, REG_BINARY, (LPBYTE)&pInst->NodeID, sizeof(pInst->NodeID)); + RegSetValueExA(hKey, "NodeId", 0, REG_BINARY, (LPBYTE)&pInst->NodeID, sizeof(pInst->NodeID)); RegCloseKey(hKey); } @@ -106,14 +106,14 @@ Memory_U Credentials_Load(char *pszUser) char szKey[MAX_PATH]; sprintf (szKey, "SOFTWARE\\FakeSkype\\%s", pszUser); - if (RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS) + if (RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, "Credentials", NULL, NULL, NULL, &creds.MsZ) == ERROR_SUCCESS && + if (RegQueryValueExA(hKey, "Credentials", NULL, NULL, NULL, &creds.MsZ) == ERROR_SUCCESS && creds.MsZ) { if (!(creds.Memory = malloc(creds.MsZ))) creds.MsZ = 0; - if (creds.Memory && RegQueryValueEx(hKey, "Credentials", NULL, NULL, creds.Memory, &creds.MsZ) != ERROR_SUCCESS) + if (creds.Memory && RegQueryValueExA(hKey, "Credentials", NULL, NULL, creds.Memory, &creds.MsZ) != ERROR_SUCCESS) { free(creds.Memory); ZeroMemory(&creds, sizeof(creds)); @@ -132,9 +132,9 @@ int Credentials_Save(Memory_U creds, char *pszUser) char szKey[MAX_PATH]; sprintf (szKey, "SOFTWARE\\FakeSkype\\%s", pszUser); - if (RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS) + if (RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS) { - iRet = RegSetValueEx(hKey, "Credentials", 0, REG_BINARY, creds.Memory, creds.MsZ) == ERROR_SUCCESS; + iRet = RegSetValueExA(hKey, "Credentials", 0, REG_BINARY, creds.Memory, creds.MsZ) == ERROR_SUCCESS; RegCloseKey(hKey); } return iRet; -- cgit v1.2.3