From d7b9a23afdb64847e1681c31332d66bf79459449 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Wed, 6 Jul 2005 19:08:05 +0000 Subject: [PATCH] gcc 4.0 -Wpointer-sign fixes (Reg* functions). --- dlls/advapi32/crypt.c | 10 +++--- dlls/advapi32/service.c | 8 ++--- dlls/advapi32/tests/registry.c | 22 ++++++------- dlls/d3d8/d3d8_main.c | 4 +-- dlls/msvideo/msvideo16.c | 2 +- dlls/oleaut32/tmarshal.c | 7 +++-- dlls/oleaut32/typelib16.c | 2 +- dlls/opengl32/wgl.c | 2 +- dlls/setupapi/setupx_main.c | 2 +- dlls/shell32/classes.c | 4 +-- dlls/shell32/dialogs.c | 10 +++--- dlls/user/tests/sysparams.c | 8 ++--- dlls/winaspi/aspi.c | 4 +-- dlls/winaspi/winaspi16.c | 2 +- dlls/wineps/init.c | 2 +- dlls/x11drv/x11drv_main.c | 4 +-- dlls/x11drv/xfont.c | 12 +++---- programs/wineconsole/registry.c | 56 ++++++++++++++++----------------- 18 files changed, 81 insertions(+), 80 deletions(-) diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 598c6f317e7..f365c7be3f5 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -326,7 +326,7 @@ BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer, SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - r = RegQueryValueExA(key, "Name", NULL, NULL, provname, &len); + r = RegQueryValueExA(key, "Name", NULL, NULL, (LPBYTE)provname, &len); if( r != ERROR_SUCCESS ) { TRACE("error %ld reading 'Name' from registry\n", r ); @@ -380,7 +380,7 @@ BOOL WINAPI CryptAcquireContextA (HCRYPTPROV *phProv, LPCSTR pszContainer, SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto error; } - r = RegQueryValueExA(key, "Image Path", NULL, NULL, temp, &len); + r = RegQueryValueExA(key, "Image Path", NULL, NULL, (LPBYTE)temp, &len); if( r != ERROR_SUCCESS ) { TRACE("error %ld reading 'Image Path' from registry\n", r ); @@ -1097,7 +1097,7 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved, *pdwProvType += (*(--ch) - '0') * 100; CRYPT_Free(keyname); - result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, pszTypeName, pcbTypeName); + result = RegQueryValueExA(hSubkey, "TypeName", NULL, &dwType, (LPBYTE)pszTypeName, pcbTypeName); if (result) CRYPT_ReturnLastError(result); @@ -1254,7 +1254,7 @@ BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved, } CRYPT_Free(keyname); - result = RegQueryValueExA(hKey, "Name", NULL, NULL, pszProvName, pcbProvName); + result = RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)pszProvName, pcbProvName); if (result) { if (result != ERROR_MORE_DATA) @@ -1754,7 +1754,7 @@ BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pd } CRYPT_Free(keyname); - if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, pszProvName, strlen(pszProvName) + 1)) + if (RegSetValueExA(hTypeKey, "Name", 0, REG_SZ, (LPBYTE)pszProvName, strlen(pszProvName) + 1)) { RegCloseKey(hTypeKey); RegCloseKey(hProvKey); diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index e81b9875cd0..d209544bd01 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1654,7 +1654,7 @@ QueryServiceConfigA( SC_HANDLE hService, total = sizeof (QUERY_SERVICE_CONFIGA); sz = sizeof(str_buffer); - r = RegQueryValueExA( hKey, szImagePath, 0, &type, str_buffer, &sz ); + r = RegQueryValueExA( hKey, szImagePath, 0, &type, (LPBYTE)str_buffer, &sz ); if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ || type == REG_EXPAND_SZ ) ) { sz = ExpandEnvironmentStringsA(str_buffer,NULL,0); @@ -1719,7 +1719,7 @@ QueryServiceConfigA( SC_HANDLE hService, n = total - sizeof (QUERY_SERVICE_CONFIGA); sz = sizeof(str_buffer); - r = RegQueryValueExA( hKey, szImagePath, 0, &type, str_buffer, &sz ); + r = RegQueryValueExA( hKey, szImagePath, 0, &type, (LPBYTE)str_buffer, &sz ); if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ || type == REG_EXPAND_SZ ) ) { sz = ExpandEnvironmentStringsA(str_buffer, p, n); @@ -1736,7 +1736,7 @@ QueryServiceConfigA( SC_HANDLE hService, } sz = n; - r = RegQueryValueExA( hKey, szGroup, 0, &type, p, &sz ); + r = RegQueryValueExA( hKey, szGroup, 0, &type, (LPBYTE)p, &sz ); if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) { lpServiceConfig->lpLoadOrderGroup = (LPSTR) p; @@ -1745,7 +1745,7 @@ QueryServiceConfigA( SC_HANDLE hService, } sz = n; - r = RegQueryValueExA( hKey, szDependencies, 0, &type, p, &sz ); + r = RegQueryValueExA( hKey, szDependencies, 0, &type, (LPBYTE)p, &sz ); if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) { lpServiceConfig->lpDependencies = (LPSTR) p; diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 0ae4233a2fd..d0a48220b4d 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -66,17 +66,17 @@ static void create_test_entries(void) SetEnvironmentVariableA("LONGSYSTEMVAR", "bar"); SetEnvironmentVariableA("FOO", "ImARatherLongButIndeedNeededString"); - ok(!RegSetValueExA(hkey_main,"Test1",0,REG_EXPAND_SZ, sTestpath1, strlen(sTestpath1)+1), + ok(!RegSetValueExA(hkey_main,"Test1",0,REG_EXPAND_SZ, (LPBYTE)sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n"); - ok(!RegSetValueExA(hkey_main,"Test2",0,REG_SZ, sTestpath1, strlen(sTestpath1)+1), + ok(!RegSetValueExA(hkey_main,"Test2",0,REG_SZ, (LPBYTE)sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n"); - ok(!RegSetValueExA(hkey_main,"Test3",0,REG_EXPAND_SZ, sTestpath2, strlen(sTestpath2)+1), + ok(!RegSetValueExA(hkey_main,"Test3",0,REG_EXPAND_SZ, (LPBYTE)sTestpath2, strlen(sTestpath2)+1), "RegSetValueExA failed\n"); - ok(!RegSetValueExA(hkey_main,"DWORD",0,REG_DWORD, (PVOID)qw, 4), + ok(!RegSetValueExA(hkey_main,"DWORD",0,REG_DWORD, (LPBYTE)qw, 4), "RegSetValueExA failed\n"); - ok(!RegSetValueExA(hkey_main,"BIN32",0,REG_BINARY, (PVOID)qw, 4), + ok(!RegSetValueExA(hkey_main,"BIN32",0,REG_BINARY, (LPBYTE)qw, 4), "RegSetValueExA failed\n"); - ok(!RegSetValueExA(hkey_main,"BIN64",0,REG_BINARY, (PVOID)qw, 8), + ok(!RegSetValueExA(hkey_main,"BIN64",0,REG_BINARY, (LPBYTE)qw, 8), "RegSetValueExA failed\n"); } @@ -115,7 +115,7 @@ static void test_enum_value(void) type = 1234; strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); - res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, data, &data_count ); + res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, (LPBYTE)data, &data_count ); ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); ok( val_count == 2, "val_count set to %ld\n", val_count ); ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); @@ -129,7 +129,7 @@ static void test_enum_value(void) type = 1234; strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); - res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, data, &data_count ); + res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, (LPBYTE)data, &data_count ); ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); /* Win9x returns 2 as specified by MSDN but NT returns 3... */ ok( val_count == 2 || val_count == 3, "val_count set to %ld\n", val_count ); @@ -147,7 +147,7 @@ static void test_enum_value(void) type = 1234; strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); - res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, data, &data_count ); + res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, (LPBYTE)data, &data_count ); ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); ok( val_count == 0, "val_count set to %ld\n", val_count ); ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); @@ -164,7 +164,7 @@ static void test_enum_value(void) type = 1234; strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); - res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, data, &data_count ); + res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, (LPBYTE)data, &data_count ); ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); ok( val_count == 20, "val_count set to %ld\n", val_count ); ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); @@ -178,7 +178,7 @@ static void test_enum_value(void) type = 1234; strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); - res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, data, &data_count ); + res = RegEnumValueA( test_key, 0, value, &val_count, NULL, &type, (LPBYTE)data, &data_count ); ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", res ); ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count ); ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c index 83522421523..dd537634b22 100644 --- a/dlls/d3d8/d3d8_main.c +++ b/dlls/d3d8/d3d8_main.c @@ -85,7 +85,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) /* @@ Wine registry key: HKCU\Software\Wine\Direct3D */ if ( !RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Direct3D", &hkey) ) { - if ( !RegQueryValueExA( hkey, "VertexShaderMode", 0, NULL, buffer, &size) ) + if ( !RegQueryValueExA( hkey, "VertexShaderMode", 0, NULL, (LPBYTE) buffer, &size) ) { if (!strcmp(buffer,"none")) { @@ -98,7 +98,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) vs_mode = VS_SW; } } - if ( !RegQueryValueExA( hkey, "PixelShaderMode", 0, NULL, buffer, &size) ) + if ( !RegQueryValueExA( hkey, "PixelShaderMode", 0, NULL, (LPBYTE) buffer, &size) ) { if (!strcmp(buffer,"enabled")) { diff --git a/dlls/msvideo/msvideo16.c b/dlls/msvideo/msvideo16.c index f36bae7945f..4a1980c28ff 100644 --- a/dlls/msvideo/msvideo16.c +++ b/dlls/msvideo/msvideo16.c @@ -787,7 +787,7 @@ DWORD WINAPI VideoCapDriverDescAndVer16(WORD nr, LPSTR buf1, WORD buf1len, if (strncasecmp(buf, "vid", 3)) continue; if (nr--) continue; fnLen = sizeof(fn); - lRet = RegQueryValueExA(hKey, buf, 0, 0, fn, &fnLen); + lRet = RegQueryValueExA(hKey, buf, 0, 0, (LPBYTE)fn, &fnLen); if (lRet == ERROR_SUCCESS) found = TRUE; break; } diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 7960ee66060..77c49aeca8b 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -262,7 +262,8 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { char tlguid[200],typelibkey[300],interfacekey[300],ver[100]; char tlfn[260]; OLECHAR tlfnW[260]; - DWORD tlguidlen, verlen, type, tlfnlen; + DWORD tlguidlen, verlen, type; + LONG tlfnlen; ITypeLib *tl; sprintf( interfacekey, "Interface\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib", @@ -277,14 +278,14 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { } type = (1< 0) { pszList = HeapAlloc( GetProcessHeap(), 0, icList) ; - if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, pszList, &icList)) + if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList)) MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ; } else @@ -278,7 +278,7 @@ void FillList (HWND hCb, char *pszLatest) pszCmd = HeapReAlloc(GetProcessHeap(), 0, pszCmd, icCmd) ; else pszCmd = HeapAlloc(GetProcessHeap(), 0, icCmd) ; - if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, pszCmd, &icCmd)) + if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, (LPBYTE)pszCmd, &icCmd)) MessageBoxA (hCb, "Unable to grab index", "Nix", MB_OK) ; if (NULL != pszLatest) @@ -328,7 +328,7 @@ void FillList (HWND hCb, char *pszLatest) memmove (&pszList[1], pszList, Nix) ; pszList[0] = cMatch ; szIndex[0] = cMatch ; - RegSetValueExA (hkey, szIndex, 0, REG_SZ, pszLatest, strlen (pszLatest) + 1) ; + RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ; } } @@ -350,10 +350,10 @@ void FillList (HWND hCb, char *pszLatest) memmove (&pszList[1], pszList, icList - 1) ; pszList[0] = cMatch ; szIndex[0] = cMatch ; - RegSetValueExA (hkey, szIndex, 0, REG_SZ, pszLatest, strlen (pszLatest) + 1) ; + RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ; } - RegSetValueExA (hkey, "MRUList", 0, REG_SZ, pszList, strlen (pszList) + 1) ; + RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ; HeapFree( GetProcessHeap(), 0, pszCmd) ; HeapFree( GetProcessHeap(), 0, pszList) ; diff --git a/dlls/user/tests/sysparams.c b/dlls/user/tests/sysparams.c index 9d6411f8851..a3d694de3a0 100644 --- a/dlls/user/tests/sysparams.c +++ b/dlls/user/tests/sysparams.c @@ -209,7 +209,7 @@ static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCS *value='\0'; valueLen=sizeof(value); RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey ); - rc=RegQueryValueExA( hKey, valName1, NULL, &type, value, &valueLen ); + rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen ); RegCloseKey( hKey ); if (rc==ERROR_SUCCESS) { @@ -228,7 +228,7 @@ static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCS *value='\0'; valueLen=sizeof(value); RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey ); - rc=RegQueryValueExA( hKey, valName2, NULL, &type, value, &valueLen ); + rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen ); RegCloseKey( hKey ); if (rc==ERROR_SUCCESS) { @@ -248,7 +248,7 @@ static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCS *value='\0'; valueLen=sizeof(value); RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey ); - rc=RegQueryValueExA( hKey, valName1, NULL, &type, value, &valueLen ); + rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen ); RegCloseKey( hKey ); if (rc==ERROR_SUCCESS) { @@ -267,7 +267,7 @@ static void _test_reg_key( LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCS *value='\0'; valueLen=sizeof(value); RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey ); - rc=RegQueryValueExA( hKey, valName2, NULL, &type, value, &valueLen ); + rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen ); RegCloseKey( hKey ); if (rc==ERROR_SUCCESS) { diff --git a/dlls/winaspi/aspi.c b/dlls/winaspi/aspi.c index bbe4ae17f6f..219fea0d93f 100644 --- a/dlls/winaspi/aspi.c +++ b/dlls/winaspi/aspi.c @@ -187,7 +187,7 @@ SCSI_GetDeviceName( int h, int c, int t, int d, LPSTR devstr, LPDWORD lpcbData ) sprintf(idstr, "h%02dc%02dt%02dd%02d", h, c, t, d); - if( RegQueryValueExA(hkeyScsi, idstr, NULL, &type, devstr, lpcbData) != ERROR_SUCCESS ) + if( RegQueryValueExA(hkeyScsi, idstr, NULL, &type, (LPBYTE)devstr, lpcbData) != ERROR_SUCCESS ) { WARN("Could not query value HKEY_DYN_DATA\\%s\\%s\n",KEYNAME_SCSI, idstr); RegCloseKey(hkeyScsi); @@ -647,7 +647,7 @@ SCSI_GetProcinfo() sprintf(idstr, "h%02dc%02dt%02dd%02d", dev.host, dev.channel, dev.target, dev.lun); sprintf(devstr, "/dev/sg%c", 'a'+devnum); - if( RegSetValueExA(hkeyScsi, idstr, 0, REG_SZ, devstr, strlen(devstr)+1 ) != ERROR_SUCCESS ) + if( RegSetValueExA(hkeyScsi, idstr, 0, REG_SZ, (LPBYTE)devstr, strlen(devstr)+1 ) != ERROR_SUCCESS ) { ERR("Could not set value HKEY_DYN_DATA\\%s\\%s\n",KEYNAME_SCSI, idstr); } diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c index d7528eacc62..b96e38cef83 100644 --- a/dlls/winaspi/winaspi16.c +++ b/dlls/winaspi/winaspi16.c @@ -89,7 +89,7 @@ ASPI_OpenDevice16(SRB_ExecSCSICmd16 *prb) if (!RegOpenKeyExA( HKEY_LOCAL_MACHINE, idstr, 0, KEY_ALL_ACCESS, &hkey )) { DWORD type, count = sizeof(device_str); - if (RegQueryValueExA( hkey, "Device", 0, &type, device_str, &count )) device_str[0] = 0; + if (RegQueryValueExA( hkey, "Device", 0, &type, (LPBYTE)device_str, &count )) device_str[0] = 0; RegCloseKey( hkey ); } diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c index 70da11a6eb6..9788eb3872f 100644 --- a/dlls/wineps/init.c +++ b/dlls/wineps/init.c @@ -611,7 +611,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) } if (value_name) { ppdFileName=HeapAlloc(PSDRV_Heap, 0, needed); - RegQueryValueExA(hkey, value_name, 0, &ppdType, ppdFileName, &needed); + RegQueryValueExA(hkey, value_name, 0, &ppdType, (LPBYTE)ppdFileName, &needed); } RegCloseKey(hkey); } diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c index 888b8c91a24..c194f79f9d7 100644 --- a/dlls/x11drv/x11drv_main.c +++ b/dlls/x11drv/x11drv_main.c @@ -209,8 +209,8 @@ void wine_tsx11_unlock(void) inline static DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, char *buffer, DWORD size ) { - if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, buffer, &size )) return 0; - if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, buffer, &size )) return 0; + if (appkey && !RegQueryValueExA( appkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0; + if (defkey && !RegQueryValueExA( defkey, name, 0, NULL, (LPBYTE)buffer, &size )) return 0; return ERROR_FILE_NOT_FOUND; } diff --git a/dlls/x11drv/xfont.c b/dlls/x11drv/xfont.c index bbec1ed8419..70e5e7f27c4 100644 --- a/dlls/x11drv/xfont.c +++ b/dlls/x11drv/xfont.c @@ -1451,7 +1451,7 @@ static void XFONT_LoadDefault( HKEY hkey, LPCSTR ini, LPCSTR fonttype) DWORD type, count = sizeof(buffer); buffer[0] = 0; - RegQueryValueExA(hkey, ini, 0, &type, buffer, &count); + RegQueryValueExA(hkey, ini, 0, &type, (LPBYTE)buffer, &count); if (*buffer) { @@ -1654,7 +1654,7 @@ static void XFONT_LoadAliases( HKEY hkey ) if (hkey) { DWORD type, count = sizeof(buffer); - RegQueryValueExA(hkey, INIDefaultSerif, 0, &type, buffer, &count); + RegQueryValueExA(hkey, INIDefaultSerif, 0, &type, (LPBYTE)buffer, &count); } TRACE("Using '%s' as default serif font\n", buffer); if (LFD_Parse(buffer, &lfd)) @@ -1671,7 +1671,7 @@ static void XFONT_LoadAliases( HKEY hkey ) if (hkey) { DWORD type, count = sizeof(buffer); - RegQueryValueExA(hkey, INIDefaultSansSerif, 0, &type, buffer, &count); + RegQueryValueExA(hkey, INIDefaultSansSerif, 0, &type, (LPBYTE)buffer, &count); } TRACE("Using '%s' as default sans serif font\n", buffer); if (LFD_Parse(buffer, &lfd)) @@ -1696,7 +1696,7 @@ static void XFONT_LoadAliases( HKEY hkey ) if (hkey) { DWORD type, count = sizeof(buffer); - RegQueryValueExA(hkey, subsection, 0, &type, buffer, &count); + RegQueryValueExA(hkey, subsection, 0, &type, (LPBYTE)buffer, &count); } if (!buffer[0]) @@ -1821,7 +1821,7 @@ static void XFONT_LoadIgnores( HKEY hkey ) DWORD type, count = sizeof(buffer); sprintf( subsection, "%s%i", INIIgnoreSection, i++ ); - if (!RegQueryValueExA(hkey, subsection, 0, &type, buffer, &count)) + if (!RegQueryValueExA(hkey, subsection, 0, &type, (LPBYTE)buffer, &count)) { char* pch = buffer; while( *pch && isspace(*pch) ) pch++; @@ -2909,7 +2909,7 @@ static void X11DRV_FONT_InitX11Metrics( void ) if (hkey) { DWORD type, count = buf_size; - RegQueryValueExA(hkey, INIGlobalMetrics, 0, &type, buffer, &count); + RegQueryValueExA(hkey, INIGlobalMetrics, 0, &type, (LPBYTE)buffer, &count); } if( buffer[0] ) diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c index 775891943cc..19553150349 100644 --- a/programs/wineconsole/registry.c +++ b/programs/wineconsole/registry.c @@ -88,64 +88,64 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg) DWORD val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (LPBYTE)&val, &count)) cfg->cursor_size = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (LPBYTE)&val, &count)) cfg->cursor_visible = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszEditionMode, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszEditionMode, 0, &type, (LPBYTE)&val, &count)) cfg->edition_mode = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (LPBYTE)&val, &count)) cfg->exit_on_die = val; count = sizeof(cfg->face_name); - RegQueryValueEx(hConKey, wszFaceName, 0, &type, (char*)&cfg->face_name, &count); + RegQueryValueEx(hConKey, wszFaceName, 0, &type, (LPBYTE)&cfg->face_name, &count); count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszFontSize, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszFontSize, 0, &type, (LPBYTE)&val, &count)) { cfg->cell_height = HIWORD(val); cfg->cell_width = LOWORD(val); } count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (LPBYTE)&val, &count)) cfg->font_weight = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (LPBYTE)&val, &count)) cfg->history_size = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszHistoryNoDup, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszHistoryNoDup, 0, &type, (LPBYTE)&val, &count)) cfg->history_nodup = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (LPBYTE)&val, &count)) cfg->menu_mask = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (LPBYTE)&val, &count)) cfg->quick_edit = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (LPBYTE)&val, &count)) { cfg->sb_height = HIWORD(val); cfg->sb_width = LOWORD(val); } count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (LPBYTE)&val, &count)) cfg->def_attr = val; count = sizeof(val); - if (!RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count)) + if (!RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (LPBYTE)&val, &count)) { cfg->win_height = HIWORD(val); cfg->win_width = LOWORD(val); @@ -220,45 +220,45 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg) WINECON_DumpConfig("save", cfg); val = cfg->cursor_size; - RegSetValueEx(hConKey, wszCursorSize, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszCursorSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->cursor_visible; - RegSetValueEx(hConKey, wszCursorVisible, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszCursorVisible, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->edition_mode; - RegSetValueEx(hConKey, wszEditionMode, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszEditionMode, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->exit_on_die; - RegSetValueEx(hConKey, wszExitOnDie, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszExitOnDie, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); - RegSetValueEx(hConKey, wszFaceName, 0, REG_SZ, (char*)&cfg->face_name, sizeof(cfg->face_name)); + RegSetValueEx(hConKey, wszFaceName, 0, REG_SZ, (LPBYTE)&cfg->face_name, sizeof(cfg->face_name)); val = MAKELONG(cfg->cell_width, cfg->cell_height); - RegSetValueEx(hConKey, wszFontSize, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszFontSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->font_weight; - RegSetValueEx(hConKey, wszFontWeight, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszFontWeight, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->history_size; - RegSetValueEx(hConKey, wszHistoryBufferSize, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszHistoryBufferSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->history_nodup; - RegSetValueEx(hConKey, wszHistoryNoDup, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszHistoryNoDup, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->menu_mask; - RegSetValueEx(hConKey, wszMenuMask, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszMenuMask, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->quick_edit; - RegSetValueEx(hConKey, wszQuickEdit, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszQuickEdit, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = MAKELONG(cfg->sb_width, cfg->sb_height); - RegSetValueEx(hConKey, wszScreenBufferSize, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszScreenBufferSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = cfg->def_attr; - RegSetValueEx(hConKey, wszScreenColors, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszScreenColors, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); val = MAKELONG(cfg->win_width, cfg->win_height); - RegSetValueEx(hConKey, wszWindowSize, 0, REG_DWORD, (char*)&val, sizeof(val)); + RegSetValueEx(hConKey, wszWindowSize, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); } /******************************************************************