Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msi/tests/action.c | 20 +++++++++---------- dlls/msi/tests/automation.c | 20 +++++++++---------- dlls/msi/tests/db.c | 9 ++++----- dlls/msi/tests/format.c | 5 ++--- dlls/msi/tests/install.c | 28 +++++++++++++------------- dlls/msi/tests/msi.c | 29 +++++++++++++-------------- dlls/msi/tests/package.c | 39 +++++++++++++++++-------------------- dlls/msi/tests/patch.c | 8 ++++---- dlls/msi/tests/source.c | 10 +++++----- 9 files changed, 79 insertions(+), 89 deletions(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 52ac63dc61b..203fd5e47e4 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -2409,10 +2409,10 @@ static char *get_user_sid(void) OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size);
- user = HeapAlloc(GetProcessHeap(), 0, size); + user = malloc(size); GetTokenInformation(token, TokenUser, user, size, &size); ConvertSidToStringSidA(user->User.Sid, &usersid); - HeapFree(GetProcessHeap(), 0, user); + free(user);
CloseHandle(token); return usersid; @@ -3022,7 +3022,7 @@ error: DeleteFileA(msifile); DeleteFileA("msitest\maximus"); RemoveDirectoryA("msitest"); - HeapFree(GetProcessHeap(), 0, usersid); + free(usersid); }
static void test_publish_product(void) @@ -3259,7 +3259,7 @@ error: DeleteFileA(msifile); DeleteFileA("msitest\maximus"); RemoveDirectoryA("msitest"); - HeapFree(GetProcessHeap(), 0, usersid); + free(usersid); }
static void test_publish_features(void) @@ -3384,7 +3384,7 @@ error: DeleteFileA(msifile); DeleteFileA("msitest\maximus"); RemoveDirectoryA("msitest"); - HeapFree(GetProcessHeap(), 0, usersid); + free(usersid); }
static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name) @@ -3398,7 +3398,7 @@ static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name) return NULL;
len += sizeof (WCHAR); - val = HeapAlloc(GetProcessHeap(), 0, len); + val = malloc(len); if (!val) return NULL; val[0] = 0; RegQueryValueExA(hkey, name, NULL, NULL, (LPBYTE)val, &len); @@ -3538,8 +3538,8 @@ static void test_register_user(void) delete_key(HKEY_LOCAL_MACHINE, keypath, access);
error: - HeapFree(GetProcessHeap(), 0, company); - HeapFree(GetProcessHeap(), 0, owner); + free(company); + free(owner);
DeleteFileA(msifile); DeleteFileA("msitest\maximus"); @@ -5781,7 +5781,7 @@ static void test_publish_components(void) res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size); ok(res == ERROR_SUCCESS, "value not found %d\n", res);
- data = HeapAlloc(GetProcessHeap(), 0, size); + data = malloc(size); res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size); ok(res == ERROR_SUCCESS, "value not found %d\n", res); RegCloseKey(key); @@ -5812,7 +5812,7 @@ static void test_publish_components(void)
res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size); ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res); - HeapFree(GetProcessHeap(), 0, data); + free(data); RegCloseKey(key);
r = MsiInstallProductA(msifile, "REMOVE=ALL"); diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 42c41dcd731..5d0126e6ac4 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -306,7 +306,7 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t int j, len;
len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); - if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return; + if (!(nameW = malloc( len * sizeof(WCHAR) ))) return; MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
r = MsiOpenDatabaseW(nameW, MSIDBOPEN_CREATE, &db); @@ -331,7 +331,7 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
MsiCloseHandle(db); - HeapFree( GetProcessHeap(), 0, nameW ); + free( nameW ); }
static BOOL create_package(LPWSTR path) @@ -502,12 +502,12 @@ static DISPID get_dispid( IDispatch *disp, const char *name ) HRESULT r;
len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0 ); - str = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR) ); + str = malloc( len * sizeof(WCHAR) ); if (str) { MultiByteToWideChar(CP_ACP, 0, name, -1, str, len ); r = IDispatch_GetIDsOfNames( disp, &IID_NULL, &str, 1, 0, &id ); - HeapFree(GetProcessHeap(), 0, str); + free( str ); if (r != S_OK) return -1; } @@ -845,11 +845,11 @@ static HRESULT invoke(IDispatch *pDispatch, LPCSTR szName, WORD wFlags, DISPPARA VariantInit(pVarResult);
len = MultiByteToWideChar(CP_ACP, 0, szName, -1, NULL, 0 ); - name = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR) ); + name = malloc(len * sizeof(WCHAR)); if (!name) return E_FAIL; MultiByteToWideChar(CP_ACP, 0, szName, -1, name, len ); hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid); - HeapFree(GetProcessHeap(), 0, name); + free(name); ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr); if (hr != S_OK) return hr;
@@ -2329,13 +2329,13 @@ static UINT delete_registry_key(HKEY hkeyParent, LPCSTR subkey, REGSAM access) if (ret != ERROR_SUCCESS) return ret; ret = RegQueryInfoKeyA(hkey, NULL, NULL, NULL, NULL, &dwSize, NULL, NULL, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS) return ret; - if (!(string = HeapAlloc(GetProcessHeap(), 0, ++dwSize))) return ERROR_NOT_ENOUGH_MEMORY; + if (!(string = malloc(++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
while (RegEnumKeyA(hkey, 0, string, dwSize) == ERROR_SUCCESS) delete_registry_key(hkey, string, access);
RegCloseKey(hkey); - HeapFree(GetProcessHeap(), 0, string); + free(string); delete_key_portable(hkeyParent, subkey, access); return ERROR_SUCCESS; } @@ -2356,7 +2356,7 @@ static UINT find_registry_key(HKEY hkeyParent, LPCSTR subkey, LPCSTR findkey, RE if (ret != ERROR_SUCCESS) return ret; ret = RegQueryInfoKeyA(hkey, NULL, NULL, NULL, NULL, &dwSize, NULL, NULL, NULL, NULL, NULL, NULL); if (ret != ERROR_SUCCESS) return ret; - if (!(string = HeapAlloc(GetProcessHeap(), 0, ++dwSize))) return ERROR_NOT_ENOUGH_MEMORY; + if (!(string = malloc(++dwSize))) return ERROR_NOT_ENOUGH_MEMORY;
while (!found && RegEnumKeyA(hkey, idx++, string, dwSize) == ERROR_SUCCESS) @@ -2370,7 +2370,7 @@ static UINT find_registry_key(HKEY hkeyParent, LPCSTR subkey, LPCSTR findkey, RE }
if (*phkey != hkey) RegCloseKey(hkey); - HeapFree(GetProcessHeap(), 0, string); + free(string); return (found ? ERROR_SUCCESS : ERROR_FILE_NOT_FOUND); }
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index b75e5f7a4b5..b2a60f5b304 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -323,10 +323,10 @@ static inline UINT add_entry(const char *file, int line, const char *type, MSIHA UINT sz, r;
sz = strlen(values) + strlen(insert) + 1; - query = HeapAlloc(GetProcessHeap(), 0, sz); + query = malloc(sz); sprintf(query, insert, values); r = run_query(hdb, 0, query); - HeapFree(GetProcessHeap(), 0, query); + free(query); ok_(file, line)(r == ERROR_SUCCESS, "failed to insert into %s table: %u\n", type, r); return r; } @@ -1465,15 +1465,14 @@ static void test_longstrings(void) ok(r == ERROR_SUCCESS, "query failed\n");
/* try to insert a very long string */ - str = HeapAlloc(GetProcessHeap(), 0, STRING_LENGTH+sizeof insert_query); + str = malloc(STRING_LENGTH + sizeof insert_query); len = strchr(insert_query, 'Z') - insert_query; strcpy(str, insert_query); memset(str+len, 'Z', STRING_LENGTH); strcpy(str+len+STRING_LENGTH, insert_query+len+1); r = try_query( hdb, str ); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); - - HeapFree(GetProcessHeap(), 0, str); + free(str);
r = MsiDatabaseCommit(hdb); ok(r == ERROR_SUCCESS, "MsiDatabaseCommit failed\n"); diff --git a/dlls/msi/tests/format.c b/dlls/msi/tests/format.c index 88d8180a50c..06f901fb84c 100644 --- a/dlls/msi/tests/format.c +++ b/dlls/msi/tests/format.c @@ -61,13 +61,12 @@ static UINT helper_createpackage( const char *szName, MSIHANDLE *handle ) DeleteFileA(szName);
len = MultiByteToWideChar( CP_ACP, 0, szName, -1, NULL, 0 ); - if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) - return ERROR_OUTOFMEMORY; + if (!(nameW = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY; MultiByteToWideChar( CP_ACP, 0, szName, -1, nameW, len );
/* create an empty database */ res = MsiOpenDatabaseW( nameW, MSIDBOPEN_CREATEDIRECT, &hdb ); - HeapFree( GetProcessHeap(), 0, nameW ); + free( nameW ); ok( res == ERROR_SUCCESS , "Failed to create database %u\n", res ); if (res != ERROR_SUCCESS) return res; diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index ce650b84d61..ae5b03e248c 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2125,12 +2125,12 @@ static const msi_table sr_tables[] =
static void * CDECL mem_alloc(ULONG cb) { - return HeapAlloc(GetProcessHeap(), 0, cb); + return malloc(cb); }
static void CDECL mem_free(void *memory) { - HeapFree(GetProcessHeap(), 0, memory); + free(memory); }
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv) @@ -2302,18 +2302,17 @@ static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv) { LPSTR tempname;
- tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); + tempname = malloc(MAX_PATH); GetTempFileNameA(".", "xx", 0, tempname);
if (tempname && (strlen(tempname) < (unsigned)cbTempName)) { lstrcpyA(pszTempName, tempname); - HeapFree(GetProcessHeap(), 0, tempname); + free(tempname); return TRUE; }
- HeapFree(GetProcessHeap(), 0, tempname); - + free(tempname); return FALSE; }
@@ -2551,12 +2550,11 @@ static BOOL compare_pf_data(const char *filename, const char *data, DWORD size) lstrcatA(path, filename);
handle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - buffer = HeapAlloc(GetProcessHeap(), 0, size); - if (buffer) + if ((buffer = malloc(size))) { ReadFile(handle, buffer, size, &read, NULL); if (read == size && !memcmp(data, buffer, size)) ret = TRUE; - HeapFree(GetProcessHeap(), 0, buffer); + free(buffer); } CloseHandle(handle); return ret; @@ -2707,7 +2705,7 @@ void create_database_wordcount(const CHAR *name, const msi_table *tables, int nu int j, len;
len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); - if (!(nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return; + if (!(nameW = malloc( len * sizeof(WCHAR) ))) return; MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
r = MsiOpenDatabaseW(nameW, MSIDBOPEN_CREATE, &db); @@ -2733,7 +2731,7 @@ void create_database_wordcount(const CHAR *name, const msi_table *tables, int nu ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
MsiCloseHandle(db); - HeapFree( GetProcessHeap(), 0, nameW ); + free( nameW ); }
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status) @@ -5266,8 +5264,8 @@ static void process_pending_renames(HKEY hkey) ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size); ok(!ret, "RegQueryValueExA failed %d\n", ret);
- buf = HeapAlloc(GetProcessHeap(), 0, size + 1); - buf2ptr = buf2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1); + buf = malloc(size + 1); + buf2ptr = buf2 = calloc(1, size + 1);
ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, (LPBYTE)buf, &size); buf[size] = 0; @@ -5318,8 +5316,8 @@ static void process_pending_renames(HKEY hkey) else RegDeleteValueA(hkey, rename_ops);
- HeapFree(GetProcessHeap(), 0, buf); - HeapFree(GetProcessHeap(), 0, buf2); + free(buf); + free(buf2); }
static BOOL file_matches_data(LPCSTR file, LPCSTR data) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 5e0fa680c89..7bfddee4e4e 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -966,9 +966,7 @@ static void test_null(void) ok ( r == ERROR_SUCCESS || r == ERROR_FILE_NOT_FOUND, "wrong error %d\n", r); if ( r == ERROR_SUCCESS ) { - lpData = HeapAlloc(GetProcessHeap(), 0, cbData); - if (!lpData) - skip("Out of memory\n"); + if (!(lpData = malloc(cbData))) skip("Out of memory\n"); else { r = RegQueryValueExA(hkey, NULL, 0, &dwType, lpData, &cbData); @@ -980,7 +978,7 @@ static void test_null(void) if (r == ERROR_ACCESS_DENIED) { skip("Not enough rights to perform tests\n"); - HeapFree(GetProcessHeap(), 0, lpData); + free(lpData); RegCloseKey(hkey); return; } @@ -993,8 +991,7 @@ static void test_null(void) { r = RegSetValueExA(hkey, NULL, 0, dwType, lpData, cbData); ok ( r == ERROR_SUCCESS, "wrong error %d\n", r); - - HeapFree(GetProcessHeap(), 0, lpData); + free(lpData); } else { @@ -1257,10 +1254,10 @@ static char *get_user_sid(void) OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size);
- user = HeapAlloc(GetProcessHeap(), 0, size); + user = malloc(size); GetTokenInformation(token, TokenUser, user, size, &size); ConvertSidToStringSidA(user->User.Sid, &usersid); - HeapFree(GetProcessHeap(), 0, user); + free(user);
CloseHandle(token); return usersid; @@ -4087,22 +4084,22 @@ static void get_version_info(LPSTR path, LPSTR *vercheck, LPDWORD verchecksz, DWORD size = GetFileVersionInfoSizeA(path, NULL); USHORT *lang;
- version = HeapAlloc(GetProcessHeap(), 0, size); + version = malloc(size); GetFileVersionInfoA(path, 0, size, version);
VerQueryValueA(version, "\", (LPVOID *)&ffi, &size); - *vercheck = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); + *vercheck = malloc(MAX_PATH); sprintf(*vercheck, "%d.%d.%d.%d", HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS), HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS)); *verchecksz = lstrlenA(*vercheck);
VerQueryValueA(version, "\VarFileInfo\Translation", (void **)&lang, &size); - *langcheck = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); + *langcheck = malloc(MAX_PATH); sprintf(*langcheck, "%d", *lang); *langchecksz = lstrlenA(*langcheck);
- HeapFree(GetProcessHeap(), 0, version); + free(version); }
static void test_MsiGetFileVersion(void) @@ -4286,8 +4283,8 @@ static void test_MsiGetFileVersion(void) if (langchecksz && !langsz) { win_skip("broken MsiGetFileVersionA detected\n"); - HeapFree(GetProcessHeap(), 0, vercheck); - HeapFree(GetProcessHeap(), 0, langcheck); + free(vercheck); + free(langcheck); return; } ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz); @@ -4372,8 +4369,8 @@ static void test_MsiGetFileVersion(void) r = MsiGetFileVersionA(path, NULL, NULL, NULL, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- HeapFree(GetProcessHeap(), 0, vercheck); - HeapFree(GetProcessHeap(), 0, langcheck); + free(vercheck); + free(langcheck); }
static void test_MsiGetProductInfo(void) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 3b98d9ef111..556bc016997 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -133,10 +133,10 @@ static char *get_user_sid(void) OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size);
- user = HeapAlloc(GetProcessHeap(), 0, size); + user = malloc(size); GetTokenInformation(token, TokenUser, user, size, &size); ConvertSidToStringSidA(user->User.Sid, &usersid); - HeapFree(GetProcessHeap(), 0, user); + free(user);
CloseHandle(token); return usersid; @@ -167,7 +167,7 @@ static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM acce if (dwMaxLen > ARRAY_SIZE(szNameBuf)) { /* Name too big: alloc a buffer for it */ - if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR)))) + if (!(lpszName = malloc(dwMaxLen * sizeof(WCHAR)))) { ret = ERROR_NOT_ENOUGH_MEMORY; goto cleanup; @@ -204,10 +204,8 @@ static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM acce }
cleanup: - if (lpszName != szNameBuf) - HeapFree(GetProcessHeap(), 0, lpszName); - if(lpszSubKey) - RegCloseKey(hSubKey); + if (lpszName != szNameBuf) free(lpszName); + if (lpszSubKey) RegCloseKey(hSubKey); return ret; }
@@ -750,10 +748,10 @@ static inline UINT add_entry(const char *file, int line, const char *type, MSIHA UINT sz, r;
sz = strlen(values) + strlen(insert) + 1; - query = HeapAlloc(GetProcessHeap(), 0, sz); + query = malloc(sz); sprintf(query, insert, values); r = run_query(hdb, query); - HeapFree(GetProcessHeap(), 0, query); + free(query); ok_(file, line)(r == ERROR_SUCCESS, "failed to insert into %s table: %u\n", type, r); return r; } @@ -867,10 +865,10 @@ static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, con UINT sz, r;
sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert ); - query = HeapAlloc( GetProcessHeap(), 0, sz ); + query = malloc( sz ); sprintf( query, insert, sig, root, path, name, type ); r = run_query( hdb, query ); - HeapFree( GetProcessHeap(), 0, query ); + free( query ); ok(r == ERROR_SUCCESS, "failed to insert into reglocator table: %u\n", r); \ return r; } @@ -1028,7 +1026,7 @@ static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls) CopyFileA(path, name, FALSE);
size = GetFileVersionInfoSizeA(path, &handle); - buffer = HeapAlloc(GetProcessHeap(), 0, size); + buffer = malloc(size);
GetFileVersionInfoA(path, 0, size, buffer);
@@ -1055,7 +1053,7 @@ static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls) ret = TRUE;
done: - HeapFree(GetProcessHeap(), 0, buffer); + free(buffer); return ret; }
@@ -4722,21 +4720,21 @@ static void test_appsearch_reglocator(void) if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) { size = ExpandEnvironmentStringsA("%PATH%", NULL, 0); - pathvar = HeapAlloc(GetProcessHeap(), 0, size); + pathvar = malloc(size); ExpandEnvironmentStringsA("%PATH%", pathvar, size);
size = 0; r = MsiGetPropertyA(hpkg, "SIGPROP4", NULL, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- pathdata = HeapAlloc(GetProcessHeap(), 0, ++size); + pathdata = malloc(++size); r = MsiGetPropertyA(hpkg, "SIGPROP4", pathdata, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(pathdata, pathvar), "Expected "%s", got "%s"\n", pathvar, pathdata);
- HeapFree(GetProcessHeap(), 0, pathvar); - HeapFree(GetProcessHeap(), 0, pathdata); + free(pathvar); + free(pathdata); }
size = MAX_PATH; @@ -8802,22 +8800,21 @@ static void add_message(const struct externalui_message *msg) if (!sequence) { sequence_size = 10; - sequence = HeapAlloc(GetProcessHeap(), 0, sequence_size * sizeof(*sequence)); + sequence = malloc(sequence_size * sizeof(*sequence)); } if (sequence_count == sequence_size) { sequence_size *= 2; - sequence = HeapReAlloc(GetProcessHeap(), 0, sequence, sequence_size * sizeof(*sequence)); + sequence = realloc(sequence, sequence_size * sizeof(*sequence)); }
assert(sequence); - sequence[sequence_count++] = *msg; }
static void flush_sequence(void) { - HeapFree(GetProcessHeap(), 0, sequence); + free(sequence); sequence = NULL; sequence_count = sequence_size = 0; } diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c index 65b3a5f1d48..8e8bd356e71 100644 --- a/dlls/msi/tests/patch.c +++ b/dlls/msi/tests/patch.c @@ -321,7 +321,7 @@ static void create_database( const char *filename, const struct msi_table *table int len;
len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 ); - if (!(filenameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return; + if (!(filenameW = malloc( len * sizeof(WCHAR) ))) return; MultiByteToWideChar( CP_ACP, 0, filename, -1, filenameW, len );
r = MsiOpenDatabaseW( filenameW, MSIDBOPEN_CREATE, &hdb ); @@ -345,7 +345,7 @@ static void create_database( const char *filename, const struct msi_table *table
MsiCloseHandle( hdb ); set_suminfo( filenameW ); - HeapFree( GetProcessHeap(), 0, filenameW ); + free( filenameW ); }
/* data for generating a patch */ @@ -704,11 +704,11 @@ static void create_patch( const char *filename ) const CLSID CLSID_MsiTransform = {0xc1082, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 ); - filenameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + filenameW = malloc( len * sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, filename, -1, filenameW, len );
r = StgCreateDocfile( filenameW, mode, 0, &stg ); - HeapFree( GetProcessHeap(), 0, filenameW ); + free( filenameW ); ok( r == S_OK, "failed to create storage 0x%08x\n", r ); if (!stg) return; diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index 32b5621e3bf..d141307e0ba 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -144,10 +144,10 @@ static char *get_user_sid(void) OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); GetTokenInformation(token, TokenUser, NULL, size, &size);
- user = HeapAlloc(GetProcessHeap(), 0, size); + user = malloc(size); GetTokenInformation(token, TokenUser, user, size, &size); ConvertSidToStringSidA(user->User.Sid, &usersid); - HeapFree(GetProcessHeap(), 0, user); + free(user);
CloseHandle(token); return usersid; @@ -188,7 +188,7 @@ static inline WCHAR *strdupAW( const char *str ) int len; WCHAR *ret; len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); - if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; + if (!(ret = malloc( len * sizeof(WCHAR) ))) return NULL; MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); return ret; } @@ -448,8 +448,8 @@ static void test_MsiSourceListGetInfo(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!valueW[0], "Expected """); ok(size == 0, "Expected 0, got %d\n", size); - HeapFree(GetProcessHeap(), 0, usersidW); - HeapFree(GetProcessHeap(), 0, prodcodeW); + free(usersidW); + free(prodcodeW);
data = ""; res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=106723
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
msi: 0908:action: unhandled exception c0000005 at 77745D79
=== w7u_el (32 bit report) ===
msi: 0864:action: unhandled exception c0000005 at 77875D79
=== w8 (32 bit report) ===
msi: 0ce0:action: unhandled exception c0000005 at 7792BA59
=== w864 (32 bit report) ===
msi: 09f4:action: unhandled exception c0000005 at 7783FE42
=== w1064v1507 (32 bit report) ===
msi: 0ea0:action: unhandled exception c0000005 at 774AC79F
=== w1064v1809 (32 bit report) ===
msi: 1904:action: unhandled exception c0000005 at 77BE3F73
=== w1064 (32 bit report) ===
msi: 1b00:action: unhandled exception c0000005 at 77165D99
=== w1064_tsign (32 bit report) ===
msi: 1010:action: unhandled exception c0000005 at 77875D72
=== w10pro64 (32 bit report) ===
msi: 1124:action: unhandled exception c0000005 at 7771745C
=== w864 (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w1064v1507 (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w1064v1809 (64 bit report) ===
msi: 19a4:action: unhandled exception c0000005 at 00007FFFB7522575
=== w1064 (64 bit report) ===
msi: 1cb8:action: unhandled exception c0000005 at 00007FFDE4915E0E
=== w1064_2qxl (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w1064_tsign (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w10pro64 (64 bit report) ===
msi: 1a90:action: unhandled exception c0000005 at 00007FFF7A796C3B
=== w10pro64_ar (64 bit report) ===
msi: 1fd4:action: unhandled exception c0000005 at 00007FFB50716C3B
=== w10pro64_he (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w10pro64_ja (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== w10pro64_zh_CN (64 bit report) ===
Report validation errors: msi:action crashed (c0000374)
=== debian11 (build log) ===
error: patch failed: dlls/webservices/channel.c:25 error: patch failed: dlls/webservices/error.c:17 error: patch failed: dlls/webservices/heap.c:17 error: patch failed: dlls/webservices/listener.c:24 error: patch failed: dlls/webservices/msg.c:17 error: patch failed: dlls/webservices/proxy.c:17 error: patch failed: dlls/webservices/reader.c:17 error: patch failed: dlls/webservices/string.c:17 error: patch failed: dlls/webservices/tests/writer.c:901 error: patch failed: dlls/webservices/url.c:17 error: patch failed: dlls/webservices/writer.c:18 error: patch failed: dlls/msi/custom.c:36 error: patch failed: dlls/msi/handle.c:92 error: patch failed: dlls/msi/install.c:34 error: patch failed: dlls/msi/msipriv.h:1141 error: patch failed: dlls/msi/package.c:43 error: patch failed: dlls/msi/streams.c:57 error: patch failed: dlls/msi/string.c:139 error: patch failed: dlls/msi/where.c:131 error: patch failed: dlls/msi/tests/action.c:2409 error: patch failed: dlls/msi/tests/automation.c:306 error: patch failed: dlls/msi/tests/db.c:323 error: patch failed: dlls/msi/tests/format.c:61 error: patch failed: dlls/msi/tests/install.c:2125 error: patch failed: dlls/msi/tests/msi.c:966 error: patch failed: dlls/msi/tests/package.c:133 error: patch failed: dlls/msi/tests/patch.c:321 error: patch failed: dlls/msi/tests/source.c:144 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/webservices/channel.c:25 error: patch failed: dlls/webservices/error.c:17 error: patch failed: dlls/webservices/heap.c:17 error: patch failed: dlls/webservices/listener.c:24 error: patch failed: dlls/webservices/msg.c:17 error: patch failed: dlls/webservices/proxy.c:17 error: patch failed: dlls/webservices/reader.c:17 error: patch failed: dlls/webservices/string.c:17 error: patch failed: dlls/webservices/tests/writer.c:901 error: patch failed: dlls/webservices/url.c:17 error: patch failed: dlls/webservices/writer.c:18 error: patch failed: dlls/msi/custom.c:36 error: patch failed: dlls/msi/handle.c:92 error: patch failed: dlls/msi/install.c:34 error: patch failed: dlls/msi/msipriv.h:1141 error: patch failed: dlls/msi/package.c:43 error: patch failed: dlls/msi/streams.c:57 error: patch failed: dlls/msi/string.c:139 error: patch failed: dlls/msi/where.c:131 error: patch failed: dlls/msi/tests/action.c:2409 error: patch failed: dlls/msi/tests/automation.c:306 error: patch failed: dlls/msi/tests/db.c:323 error: patch failed: dlls/msi/tests/format.c:61 error: patch failed: dlls/msi/tests/install.c:2125 error: patch failed: dlls/msi/tests/msi.c:966 error: patch failed: dlls/msi/tests/package.c:133 error: patch failed: dlls/msi/tests/patch.c:321 error: patch failed: dlls/msi/tests/source.c:144 Task: Patch failed to apply