Commit f6b2aa4a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

advapi32/tests: Compile with -D__WINESRC__.

parent 08422163
TESTDLL = advapi32.dll TESTDLL = advapi32.dll
IMPORTS = ole32 advapi32 IMPORTS = ole32 advapi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
cred.c \ cred.c \
......
...@@ -187,7 +187,7 @@ static void test_CredReadDomainCredentialsA(void) ...@@ -187,7 +187,7 @@ static void test_CredReadDomainCredentialsA(void)
char target_name[] = "no_such_target"; char target_name[] = "no_such_target";
CREDENTIAL_TARGET_INFORMATIONA info = {target_name, NULL, target_name, NULL, NULL, NULL, NULL, 0, 0, NULL}; CREDENTIAL_TARGET_INFORMATIONA info = {target_name, NULL, target_name, NULL, NULL, NULL, NULL, 0, 0, NULL};
DWORD count; DWORD count;
PCREDENTIAL* creds; PCREDENTIALA* creds;
if (!pCredReadDomainCredentialsA) if (!pCredReadDomainCredentialsA)
{ {
...@@ -744,18 +744,19 @@ static void test_CredIsMarshaledCredentialA(void) ...@@ -744,18 +744,19 @@ static void test_CredIsMarshaledCredentialA(void)
START_TEST(cred) START_TEST(cred)
{ {
DWORD persists[CRED_TYPE_MAXIMUM]; DWORD persists[CRED_TYPE_MAXIMUM];
HMODULE mod = GetModuleHandleA("advapi32.dll");
pCredEnumerateA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredEnumerateA");
pCredFree = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredFree"); pCredEnumerateA = (void *)GetProcAddress(mod, "CredEnumerateA");
pCredGetSessionTypes = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredGetSessionTypes"); pCredFree = (void *)GetProcAddress(mod, "CredFree");
pCredWriteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredWriteA"); pCredGetSessionTypes = (void *)GetProcAddress(mod, "CredGetSessionTypes");
pCredDeleteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredDeleteA"); pCredWriteA = (void *)GetProcAddress(mod, "CredWriteA");
pCredReadA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadA"); pCredDeleteA = (void *)GetProcAddress(mod, "CredDeleteA");
pCredRenameA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredRenameA"); pCredReadA = (void *)GetProcAddress(mod, "CredReadA");
pCredReadDomainCredentialsA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadDomainCredentialsA"); pCredRenameA = (void *)GetProcAddress(mod, "CredRenameA");
pCredMarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredMarshalCredentialA"); pCredReadDomainCredentialsA = (void *)GetProcAddress(mod, "CredReadDomainCredentialsA");
pCredUnmarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredUnmarshalCredentialA"); pCredMarshalCredentialA = (void *)GetProcAddress(mod, "CredMarshalCredentialA");
pCredIsMarshaledCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredIsMarshaledCredentialA"); pCredUnmarshalCredentialA = (void *)GetProcAddress(mod, "CredUnmarshalCredentialA");
pCredIsMarshaledCredentialA = (void *)GetProcAddress(mod, "CredIsMarshaledCredentialA");
if (!pCredEnumerateA || !pCredFree || !pCredWriteA || !pCredDeleteA || !pCredReadA) if (!pCredEnumerateA || !pCredFree || !pCredWriteA || !pCredDeleteA || !pCredReadA)
{ {
......
...@@ -474,21 +474,21 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam ...@@ -474,21 +474,21 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam
HKEY subkey; HKEY subkey;
DWORD size = sizeof(DWORD); DWORD size = sizeof(DWORD);
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey)) if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey))
return FALSE; return FALSE;
RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName, RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName,
NULL, NULL, NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL, NULL, NULL);
(*pcbProvName)++; (*pcbProvName)++;
if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName))) if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))
return FALSE; return FALSE;
RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL); RegEnumKeyExA(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL);
(*pcbProvName)++; (*pcbProvName)++;
RegOpenKey(hKey, *pszProvName, &subkey); RegOpenKeyA(hKey, *pszProvName, &subkey);
RegQueryValueEx(subkey, "Type", NULL, NULL, (LPBYTE)pdwProvType, &size); RegQueryValueExA(subkey, "Type", NULL, NULL, (LPBYTE)pdwProvType, &size);
RegCloseKey(subkey); RegCloseKey(subkey);
RegCloseKey(hKey); RegCloseKey(hKey);
...@@ -599,10 +599,10 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz ...@@ -599,10 +599,10 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
DWORD cbName; DWORD cbName;
BOOL ret = FALSE; BOOL ret = FALSE;
if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey))
return FALSE; return FALSE;
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwTypeCount, &cbName, NULL, if (RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pdwTypeCount, &cbName, NULL,
NULL, NULL, NULL, NULL, NULL)) NULL, NULL, NULL, NULL, NULL))
goto cleanup; goto cleanup;
cbName++; cbName++;
...@@ -610,7 +610,7 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz ...@@ -610,7 +610,7 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
if (!(szName = LocalAlloc(LMEM_ZEROINIT, cbName))) if (!(szName = LocalAlloc(LMEM_ZEROINIT, cbName)))
goto cleanup; goto cleanup;
while (!RegEnumKeyEx(hKey, *pdwIndex, szName, &cbName, NULL, NULL, NULL, NULL)) while (!RegEnumKeyExA(hKey, *pdwIndex, szName, &cbName, NULL, NULL, NULL, NULL))
{ {
cbName++; cbName++;
ch = szName + strlen(szName); ch = szName + strlen(szName);
...@@ -619,15 +619,15 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz ...@@ -619,15 +619,15 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
*pdwProvType += (*(--ch) - '0') * 10; *pdwProvType += (*(--ch) - '0') * 10;
*pdwProvType += (*(--ch) - '0') * 100; *pdwProvType += (*(--ch) - '0') * 100;
if (RegOpenKey(hKey, szName, &hSubKey)) if (RegOpenKeyA(hKey, szName, &hSubKey))
break; break;
if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName)) if (!RegQueryValueExA(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName))
{ {
if (!(*pszTypeName = LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))) if (!(*pszTypeName = LocalAlloc(LMEM_ZEROINIT, *pcbTypeName)))
break; break;
if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName)) if (!RegQueryValueExA(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName))
{ {
ret = TRUE; ret = TRUE;
break; break;
...@@ -763,14 +763,14 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN ...@@ -763,14 +763,14 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
} else } else
return FALSE; return FALSE;
if (RegOpenKey((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey)) if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey))
{ {
LocalFree(keyname); LocalFree(keyname);
return FALSE; return FALSE;
} }
LocalFree(keyname); LocalFree(keyname);
if (RegQueryValueEx(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) if (RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName))
{ {
if (GetLastError() != ERROR_MORE_DATA) if (GetLastError() != ERROR_MORE_DATA)
SetLastError(NTE_PROV_TYPE_ENTRY_BAD); SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
...@@ -780,7 +780,7 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN ...@@ -780,7 +780,7 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName))) if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))
return FALSE; return FALSE;
if (RegQueryValueEx(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) if (RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName))
{ {
if (GetLastError() != ERROR_MORE_DATA) if (GetLastError() != ERROR_MORE_DATA)
SetLastError(NTE_PROV_TYPE_ENTRY_BAD); SetLastError(NTE_PROV_TYPE_ENTRY_BAD);
...@@ -899,13 +899,13 @@ static void test_set_provider_ex(void) ...@@ -899,13 +899,13 @@ static void test_set_provider_ex(void)
ok(result, "%d\n", GetLastError()); ok(result, "%d\n", GetLastError());
/* check pdwReserved for NULL */ /* check pdwReserved for NULL */
result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, &notNull, CRYPT_MACHINE_DEFAULT); result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, &notNull, CRYPT_MACHINE_DEFAULT);
ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %d\n", ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %d\n",
ERROR_INVALID_PARAMETER, GetLastError()); ERROR_INVALID_PARAMETER, GetLastError());
/* remove the default provider and then set it to MS_DEF_PROV/PROV_RSA_FULL */ /* remove the default provider and then set it to MS_DEF_PROV/PROV_RSA_FULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT | CRYPT_DELETE_DEFAULT); result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT | CRYPT_DELETE_DEFAULT);
if (!result) if (!result)
{ {
ok( GetLastError() == ERROR_ACCESS_DENIED || broken(GetLastError() == ERROR_INVALID_PARAMETER), ok( GetLastError() == ERROR_ACCESS_DENIED || broken(GetLastError() == ERROR_INVALID_PARAMETER),
...@@ -915,7 +915,7 @@ static void test_set_provider_ex(void) ...@@ -915,7 +915,7 @@ static void test_set_provider_ex(void)
return; return;
} }
result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT); result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT);
ok(result, "%d\n", GetLastError()); ok(result, "%d\n", GetLastError());
/* call CryptGetDefaultProvider to see if they match */ /* call CryptGetDefaultProvider to see if they match */
...@@ -925,8 +925,8 @@ static void test_set_provider_ex(void) ...@@ -925,8 +925,8 @@ static void test_set_provider_ex(void)
goto reset; goto reset;
result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, pszProvName, &cbProvName); result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, pszProvName, &cbProvName);
ok(result && !strcmp(MS_DEF_PROV, pszProvName), "expected %s, got %s\n", MS_DEF_PROV, pszProvName); ok(result && !strcmp(MS_DEF_PROV_A, pszProvName), "expected %s, got %s\n", MS_DEF_PROV_A, pszProvName);
ok(result && cbProvName==(strlen(MS_DEF_PROV) + 1), "expected %i, got %d\n", (lstrlenA(MS_DEF_PROV) + 1), cbProvName); ok(result && cbProvName==(strlen(MS_DEF_PROV_A) + 1), "expected %i, got %d\n", (lstrlenA(MS_DEF_PROV_A) + 1), cbProvName);
LocalFree(pszProvName); LocalFree(pszProvName);
...@@ -1026,7 +1026,7 @@ static void test_rc2_keylen(void) ...@@ -1026,7 +1026,7 @@ static void test_rc2_keylen(void)
} }
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptAcquireContextA(&provider, NULL, MS_DEF_PROV, ret = pCryptAcquireContextA(&provider, NULL, MS_DEF_PROV_A,
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
ok(ret, "CryptAcquireContext error %08x\n", GetLastError()); ok(ret, "CryptAcquireContext error %08x\n", GetLastError());
......
...@@ -761,11 +761,11 @@ static void test_readwrite(void) ...@@ -761,11 +761,11 @@ static void test_readwrite(void)
} }
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = ReportEvent(handle, 0x20, 0, 0, NULL, 0, 0, NULL, NULL); ret = ReportEventA(handle, 0x20, 0, 0, NULL, 0, 0, NULL, NULL);
if (!ret && GetLastError() == ERROR_CRC) if (!ret && GetLastError() == ERROR_CRC)
{ {
win_skip("Win7 fails when using incorrect event types\n"); win_skip("Win7 fails when using incorrect event types\n");
ret = ReportEvent(handle, 0, 0, 0, NULL, 0, 0, NULL, NULL); ret = ReportEventA(handle, 0, 0, 0, NULL, 0, 0, NULL, NULL);
ok(ret, "Expected success : %d\n", GetLastError()); ok(ret, "Expected success : %d\n", GetLastError());
} }
else else
...@@ -822,9 +822,9 @@ static void test_readwrite(void) ...@@ -822,9 +822,9 @@ static void test_readwrite(void)
ok(handle != NULL, "Expected a handle\n"); ok(handle != NULL, "Expected a handle\n");
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = ReportEvent(handle, read_write[i].evt_type, read_write[i].evt_cat, ret = ReportEventA(handle, read_write[i].evt_type, read_write[i].evt_cat,
read_write[i].evt_id, run_sidtests ? user : NULL, read_write[i].evt_id, run_sidtests ? user : NULL,
read_write[i].evt_numstrings, 0, read_write[i].evt_strings, NULL); read_write[i].evt_numstrings, 0, read_write[i].evt_strings, NULL);
ok(ret, "Expected ReportEvent success : %d\n", GetLastError()); ok(ret, "Expected ReportEvent success : %d\n", GetLastError());
count = 0xdeadbeef; count = 0xdeadbeef;
......
...@@ -47,7 +47,7 @@ static NTSTATUS (WINAPI *pLsaLookupSids)(LSA_HANDLE,ULONG,PSID*,LSA_REFERENCED_D ...@@ -47,7 +47,7 @@ static NTSTATUS (WINAPI *pLsaLookupSids)(LSA_HANDLE,ULONG,PSID*,LSA_REFERENCED_D
static BOOL init(void) static BOOL init(void)
{ {
hadvapi32 = GetModuleHandle("advapi32.dll"); hadvapi32 = GetModuleHandleA("advapi32.dll");
pLsaClose = (void*)GetProcAddress(hadvapi32, "LsaClose"); pLsaClose = (void*)GetProcAddress(hadvapi32, "LsaClose");
pLsaEnumerateAccountRights = (void*)GetProcAddress(hadvapi32, "LsaEnumerateAccountRights"); pLsaEnumerateAccountRights = (void*)GetProcAddress(hadvapi32, "LsaEnumerateAccountRights");
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
#include "winerror.h" #include "winerror.h"
#include "aclapi.h" #include "aclapi.h"
#undef SE_BACKUP_NAME
#undef SE_RESTORE_NAME
#define SE_BACKUP_NAME "SeBackupPrivilege"
#define SE_RESTORE_NAME "SeRestorePrivilege"
#define IS_HKCR(hk) ((UINT_PTR)hk > 0 && ((UINT_PTR)hk & 3) == 2) #define IS_HKCR(hk) ((UINT_PTR)hk > 0 && ((UINT_PTR)hk & 3) == 2)
static HKEY hkey_main; static HKEY hkey_main;
...@@ -1084,8 +1089,8 @@ static void test_reg_create_key(void) ...@@ -1084,8 +1089,8 @@ static void test_reg_create_key(void)
ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); ok(!ret, "RegCreateKeyExA failed with error %d\n", ret);
/* clean up */ /* clean up */
RegDeleteKey(hkey2, ""); RegDeleteKeyA(hkey2, "");
RegDeleteKey(hkey1, ""); RegDeleteKeyA(hkey1, "");
RegCloseKey(hkey2); RegCloseKey(hkey2);
RegCloseKey(hkey1); RegCloseKey(hkey1);
...@@ -1103,8 +1108,8 @@ static void test_reg_create_key(void) ...@@ -1103,8 +1108,8 @@ static void test_reg_create_key(void)
ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); ok(!ret, "RegCreateKeyExA failed with error %d\n", ret);
/* clean up */ /* clean up */
RegDeleteKey(hkey2, ""); RegDeleteKeyA(hkey2, "");
RegDeleteKey(hkey1, ""); RegDeleteKeyA(hkey1, "");
RegCloseKey(hkey2); RegCloseKey(hkey2);
RegCloseKey(hkey1); RegCloseKey(hkey1);
...@@ -1114,7 +1119,7 @@ static void test_reg_create_key(void) ...@@ -1114,7 +1119,7 @@ static void test_reg_create_key(void)
ok(ret == ERROR_BAD_PATHNAME, "expected ERROR_BAD_PATHNAME, got %d\n", ret); ok(ret == ERROR_BAD_PATHNAME, "expected ERROR_BAD_PATHNAME, got %d\n", ret);
else { else {
ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); ok(!ret, "RegCreateKeyExA failed with error %d\n", ret);
RegDeleteKey(hkey1, NULL); RegDeleteKeyA(hkey1, NULL);
RegCloseKey(hkey1); RegCloseKey(hkey1);
} }
...@@ -1248,7 +1253,7 @@ static void test_reg_delete_key(void) ...@@ -1248,7 +1253,7 @@ static void test_reg_delete_key(void)
{ {
DWORD ret; DWORD ret;
ret = RegDeleteKey(hkey_main, NULL); ret = RegDeleteKeyA(hkey_main, NULL);
/* There is a bug in NT4 and W2K that doesn't check if the subkey is NULL. If /* There is a bug in NT4 and W2K that doesn't check if the subkey is NULL. If
* there are also no subkeys available it will delete the key pointed to by hkey_main. * there are also no subkeys available it will delete the key pointed to by hkey_main.
...@@ -1271,7 +1276,7 @@ static void test_reg_save_key(void) ...@@ -1271,7 +1276,7 @@ static void test_reg_save_key(void)
{ {
DWORD ret; DWORD ret;
ret = RegSaveKey(hkey_main, "saved_key", NULL); ret = RegSaveKeyA(hkey_main, "saved_key", NULL);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
} }
...@@ -1280,10 +1285,10 @@ static void test_reg_load_key(void) ...@@ -1280,10 +1285,10 @@ static void test_reg_load_key(void)
DWORD ret; DWORD ret;
HKEY hkHandle; HKEY hkHandle;
ret = RegLoadKey(HKEY_LOCAL_MACHINE, "Test", "saved_key"); ret = RegLoadKeyA(HKEY_LOCAL_MACHINE, "Test", "saved_key");
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
ret = RegOpenKey(HKEY_LOCAL_MACHINE, "Test", &hkHandle); ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Test", &hkHandle);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
RegCloseKey(hkHandle); RegCloseKey(hkHandle);
...@@ -1293,11 +1298,11 @@ static void test_reg_unload_key(void) ...@@ -1293,11 +1298,11 @@ static void test_reg_unload_key(void)
{ {
DWORD ret; DWORD ret;
ret = RegUnLoadKey(HKEY_LOCAL_MACHINE, "Test"); ret = RegUnLoadKeyA(HKEY_LOCAL_MACHINE, "Test");
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
DeleteFile("saved_key"); DeleteFileA("saved_key");
DeleteFile("saved_key.LOG"); DeleteFileA("saved_key.LOG");
} }
static BOOL set_privileges(LPCSTR privilege, BOOL set) static BOOL set_privileges(LPCSTR privilege, BOOL set)
...@@ -1309,7 +1314,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set) ...@@ -1309,7 +1314,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set)
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
return FALSE; return FALSE;
if(!LookupPrivilegeValue(NULL, privilege, &luid)) if(!LookupPrivilegeValueA(NULL, privilege, &luid))
{ {
CloseHandle(hToken); CloseHandle(hToken);
return FALSE; return FALSE;
...@@ -1704,7 +1709,7 @@ static void test_rw_order(void) ...@@ -1704,7 +1709,7 @@ static void test_rw_order(void)
ok(!RegEnumValueA(hKey, 3, value_buf, &value_len, NULL, NULL, NULL, NULL), "RegEnumValueA failed\n"); ok(!RegEnumValueA(hKey, 3, value_buf, &value_len, NULL, NULL, NULL, NULL), "RegEnumValueA failed\n");
todo_wine ok(strcmp(value_buf, "B") == 0, "Expected name \"B\", got %s\n", value_buf); todo_wine ok(strcmp(value_buf, "B") == 0, "Expected name \"B\", got %s\n", value_buf);
ok(!RegDeleteKey(HKEY_CURRENT_USER, keyname), "Failed to delete key\n"); ok(!RegDeleteKeyA(HKEY_CURRENT_USER, keyname), "Failed to delete key\n");
} }
static void test_symlinks(void) static void test_symlinks(void)
...@@ -1822,10 +1827,10 @@ static void test_symlinks(void) ...@@ -1822,10 +1827,10 @@ static void test_symlinks(void)
KEY_ALL_ACCESS, NULL, &key, NULL ); KEY_ALL_ACCESS, NULL, &key, NULL );
ok( err == ERROR_ALREADY_EXISTS, "RegCreateKeyEx wrong error %u\n", err ); ok( err == ERROR_ALREADY_EXISTS, "RegCreateKeyEx wrong error %u\n", err );
err = RegDeleteKey( hkey_main, "target" ); err = RegDeleteKeyA( hkey_main, "target" );
ok( err == ERROR_SUCCESS, "RegDeleteKey failed error %u\n", err ); ok( err == ERROR_SUCCESS, "RegDeleteKey failed error %u\n", err );
err = RegDeleteKey( hkey_main, "link" ); err = RegDeleteKeyA( hkey_main, "link" );
ok( err == ERROR_FILE_NOT_FOUND, "RegDeleteKey wrong error %u\n", err ); ok( err == ERROR_FILE_NOT_FOUND, "RegDeleteKey wrong error %u\n", err );
status = pNtDeleteKey( link ); status = pNtDeleteKey( link );
...@@ -2362,7 +2367,7 @@ static void test_classesroot(void) ...@@ -2362,7 +2367,7 @@ static void test_classesroot(void)
RegCloseKey( hklmsub1 ); RegCloseKey( hklmsub1 );
/* delete subkey1 from hkcr (should point at user's classes) */ /* delete subkey1 from hkcr (should point at user's classes) */
res = RegDeleteKey(hkcr, "subkey1"); res = RegDeleteKeyA(hkcr, "subkey1");
ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res); ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res);
/* confirm key was removed in hkey but not hklm */ /* confirm key was removed in hkey but not hklm */
...@@ -2373,7 +2378,7 @@ static void test_classesroot(void) ...@@ -2373,7 +2378,7 @@ static void test_classesroot(void)
ok(!IS_HKCR(hklmsub1), "hkcr mask set in %p\n", hklmsub1); ok(!IS_HKCR(hklmsub1), "hkcr mask set in %p\n", hklmsub1);
/* delete subkey1 from hkcr again (which should now point at hklm) */ /* delete subkey1 from hkcr again (which should now point at hklm) */
res = RegDeleteKey(hkcr, "subkey1"); res = RegDeleteKeyA(hkcr, "subkey1");
ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res); ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res);
/* confirm hkey was removed in hklm */ /* confirm hkey was removed in hklm */
......
...@@ -166,7 +166,7 @@ static void test_open_svc(void) ...@@ -166,7 +166,7 @@ static void test_open_svc(void)
/* Try to open the service with this displayname, unless the displayname equals /* Try to open the service with this displayname, unless the displayname equals
* the servicename as that would defeat the purpose of this test. * the servicename as that would defeat the purpose of this test.
*/ */
if (!lstrcmpi(spooler, displayname)) if (!lstrcmpiA(spooler, displayname))
{ {
skip("displayname equals servicename\n"); skip("displayname equals servicename\n");
CloseServiceHandle(scm_handle); CloseServiceHandle(scm_handle);
...@@ -701,7 +701,7 @@ static void test_get_displayname(void) ...@@ -701,7 +701,7 @@ static void test_get_displayname(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = GetServiceDisplayNameA(scm_handle, servicename, displayname, &displaysize); ret = GetServiceDisplayNameA(scm_handle, servicename, displayname, &displaysize);
ok(ret, "Expected success, got error %u\n", GetLastError()); ok(ret, "Expected success, got error %u\n", GetLastError());
ok(!lstrcmpi(displayname, servicename), ok(!lstrcmpiA(displayname, servicename),
"Expected displayname to be %s, got %s\n", servicename, displayname); "Expected displayname to be %s, got %s\n", servicename, displayname);
/* Delete the service */ /* Delete the service */
...@@ -869,7 +869,7 @@ static void test_get_servicekeyname(void) ...@@ -869,7 +869,7 @@ static void test_get_servicekeyname(void)
{ {
ok(strlen(servicename) == tempsize/2, ok(strlen(servicename) == tempsize/2,
"Expected the buffer to be twice the length of the string\n") ; "Expected the buffer to be twice the length of the string\n") ;
ok(!lstrcmpi(servicename, spooler), "Expected %s, got %s\n", spooler, servicename); ok(!lstrcmpiA(servicename, spooler), "Expected %s, got %s\n", spooler, servicename);
ok(servicesize == (tempsize * 2), ok(servicesize == (tempsize * 2),
"Expected servicesize not to change if buffer not insufficient\n") ; "Expected servicesize not to change if buffer not insufficient\n") ;
} }
...@@ -1057,9 +1057,9 @@ static void test_enum_svc(void) ...@@ -1057,9 +1057,9 @@ static void test_enum_svc(void)
DWORD neededW, returnedW; DWORD neededW, returnedW;
DWORD tempneeded, tempreturned, missing; DWORD tempneeded, tempreturned, missing;
DWORD servicecountactive, servicecountinactive; DWORD servicecountactive, servicecountinactive;
ENUM_SERVICE_STATUS *services; ENUM_SERVICE_STATUSA *services;
ENUM_SERVICE_STATUSW *servicesW; ENUM_SERVICE_STATUSW *servicesW;
ENUM_SERVICE_STATUS_PROCESS *exservices; ENUM_SERVICE_STATUS_PROCESSA *exservices;
UINT i; UINT i;
/* All NULL or wrong */ /* All NULL or wrong */
...@@ -1289,7 +1289,7 @@ static void test_enum_svc(void) ...@@ -1289,7 +1289,7 @@ static void test_enum_svc(void)
/* Allocate less than the needed bytes and don't specify a resume handle */ /* Allocate less than the needed bytes and don't specify a resume handle */
services = HeapAlloc(GetProcessHeap(), 0, tempneeded); services = HeapAlloc(GetProcessHeap(), 0, tempneeded);
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA);
needed = 0xdeadbeef; needed = 0xdeadbeef;
returned = 0xdeadbeef; returned = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -1302,7 +1302,7 @@ static void test_enum_svc(void) ...@@ -1302,7 +1302,7 @@ static void test_enum_svc(void)
"Expected ERROR_MORE_DATA, got %d\n", GetLastError()); "Expected ERROR_MORE_DATA, got %d\n", GetLastError());
/* Allocate less than the needed bytes, this time with a correct resume handle */ /* Allocate less than the needed bytes, this time with a correct resume handle */
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA);
needed = 0xdeadbeef; needed = 0xdeadbeef;
returned = 0xdeadbeef; returned = 0xdeadbeef;
resume = 0; resume = 0;
...@@ -1604,7 +1604,7 @@ static void test_enum_svc(void) ...@@ -1604,7 +1604,7 @@ static void test_enum_svc(void)
/* Allocate less than the needed bytes and don't specify a resume handle */ /* Allocate less than the needed bytes and don't specify a resume handle */
exservices = HeapAlloc(GetProcessHeap(), 0, tempneeded); exservices = HeapAlloc(GetProcessHeap(), 0, tempneeded);
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA);
needed = 0xdeadbeef; needed = 0xdeadbeef;
returned = 0xdeadbeef; returned = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -1617,7 +1617,7 @@ static void test_enum_svc(void) ...@@ -1617,7 +1617,7 @@ static void test_enum_svc(void)
"Expected ERROR_MORE_DATA, got %d\n", GetLastError()); "Expected ERROR_MORE_DATA, got %d\n", GetLastError());
/* Allocate less than the needed bytes, this time with a correct resume handle */ /* Allocate less than the needed bytes, this time with a correct resume handle */
bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA);
needed = 0xdeadbeef; needed = 0xdeadbeef;
returned = 0xdeadbeef; returned = 0xdeadbeef;
resume = 0; resume = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment