#include <msi.h>
#include <winsvc.h>
#include <objbase.h>
-#include <stdio.h>
#include "wine/debug.h"
-#include "wine/heap.h"
+#include "msiexec_internal.h"
#include "initguid.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
typedef HRESULT (WINAPI *DLLUNREGISTERSERVER)(void);
DWORD DoService(void);
+static BOOL silent;
struct string_list
{
WCHAR str[1];
};
+void report_error(const char* msg, ...)
+{
+ char buffer[2048];
+ va_list va_args;
+
+ va_start(va_args, msg);
+ vsnprintf(buffer, sizeof(buffer), msg, va_args);
+ va_end(va_args);
+
+ if (silent)
+ MESSAGE("%s", buffer);
+ else
+ MsiMessageBoxA(NULL, buffer, "MsiExec", 0, GetUserDefaultLangID(), 0);
+}
+
static void ShowUsage(int ExitCode)
{
WCHAR msiexec_version[40];
No typo: The LPWSTR parameter must be a LPWSTR * for this mode */
len = LoadStringW(hmsi, 10, (LPWSTR) &msi_res, 0);
- msi_res = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
- msiexec_help = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) + sizeof(msiexec_version));
+ msi_res = malloc((len + 1) * sizeof(WCHAR));
+ msiexec_help = malloc((len + 1) * sizeof(WCHAR) + sizeof(msiexec_version));
if (msi_res && msiexec_help) {
*msi_res = 0;
LoadStringW(hmsi, 10, msi_res, len + 1);
swprintf(msiexec_help, len + 1 + ARRAY_SIZE(msiexec_version), msi_res, msiexec_version);
MsiMessageBoxW(0, msiexec_help, NULL, 0, GetUserDefaultLangID(), 0);
}
- HeapFree(GetProcessHeap(), 0, msi_res);
- HeapFree(GetProcessHeap(), 0, msiexec_help);
+ free(msi_res);
+ free(msiexec_help);
ExitProcess(ExitCode);
}
{
struct string_list *entry;
- entry = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(struct string_list, str[lstrlenW(str) + 1]));
+ entry = malloc(FIELD_OFFSET(struct string_list, str[wcslen(str) + 1]));
if(!entry)
{
WINE_ERR("Out of memory!\n");
for(list = property_list; list; list = list->next)
len += lstrlenW(list->str) + 3;
- ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+ ret = malloc(len * sizeof(WCHAR));
/* add a space before each string, and quote the value */
p = ret;
for(list = transform_list; list; list = list->next)
len += lstrlenW(list->str) + 1;
- ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+ ret = malloc(len * sizeof(WCHAR));
/* add all the transforms with a semicolon between each one */
p = ret;
return FALSE;
if( lstrlenW(str1) != (len-1) )
return FALSE;
- strW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
+ strW = malloc(sizeof(WCHAR) * len);
MultiByteToWideChar( CP_ACP, 0, str2, -1, strW, len);
ret = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, str1, len, strW, len);
- HeapFree(GetProcessHeap(), 0, strW);
+ free(strW);
return (ret == CSTR_EQUAL);
}
return FALSE;
if( lstrlenW(str1) < (len-1) )
return FALSE;
- strW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len);
+ strW = malloc(sizeof(WCHAR) * len);
MultiByteToWideChar( CP_ACP, 0, str2, -1, strW, len);
ret = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, str1, len-1, strW, len-1);
- HeapFree(GetProcessHeap(), 0, strW);
+ free(strW);
return (ret == CSTR_EQUAL);
}
*DllHandle = LoadLibraryExW(DllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if(!*DllHandle)
{
- fprintf(stderr, "Unable to load dll %s\n", wine_dbgstr_w(DllName));
+ report_error("Unable to load dll %s\n", wine_dbgstr_w(DllName));
ExitProcess(1);
}
proc = (VOID *) GetProcAddress(*DllHandle, ProcName);
if(!proc)
{
- fprintf(stderr, "Dll %s does not implement function %s\n",
- wine_dbgstr_w(DllName), ProcName);
+ report_error("Dll %s does not implement function %s\n",
+ wine_dbgstr_w(DllName), ProcName);
FreeLibrary(*DllHandle);
ExitProcess(1);
}
hr = pfDllRegisterServer();
if(FAILED(hr))
{
- fprintf(stderr, "Failed to register dll %s\n", wine_dbgstr_w(DllName));
+ report_error("Failed to register dll %s\n", wine_dbgstr_w(DllName));
return 1;
}
- printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName));
+ MESSAGE("Successfully registered dll %s\n", wine_dbgstr_w(DllName));
if(DllHandle)
FreeLibrary(DllHandle);
return 0;
hr = pfDllUnregisterServer();
if(FAILED(hr))
{
- fprintf(stderr, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName));
+ report_error("Failed to unregister dll %s\n", wine_dbgstr_w(DllName));
return 1;
}
- printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName));
+ MESSAGE("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName));
if(DllHandle)
FreeLibrary(DllHandle);
return 0;
if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CREATE_SERVICE)))
{
- fprintf(stderr, "Failed to open the service control manager.\n");
+ report_error("Failed to open the service control manager.\n");
return 1;
}
len = GetSystemDirectoryW(path, MAX_PATH);
}
else if (GetLastError() != ERROR_SERVICE_EXISTS)
{
- fprintf(stderr, "Failed to create MSI service\n");
+ report_error("Failed to create MSI service\n");
ret = 1;
}
CloseServiceHandle(scm);
if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CONNECT)))
{
- fprintf(stderr, "Failed to open service control manager\n");
+ report_error("Failed to open service control manager\n");
return 1;
}
if ((service = OpenServiceW(scm, L"MSIServer", DELETE)))
{
if (!DeleteService(service))
{
- fprintf(stderr, "Failed to delete MSI service\n");
+ report_error("Failed to delete MSI service\n");
ret = 1;
}
CloseServiceHandle(service);
}
else if (GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST)
{
- fprintf(stderr, "Failed to open MSI service\n");
+ report_error("Failed to open MSI service\n");
ret = 1;
}
CloseServiceHandle(scm);
static DWORD CALLBACK custom_action_thread(void *arg)
{
GUID guid = *(GUID *)arg;
- heap_free(arg);
+ free(arg);
return __wine_msi_call_dll_function(client_pid, &guid);
}
return 0;
}
- thread_guid = heap_alloc(sizeof(GUID));
+ thread_guid = malloc(sizeof(GUID));
memcpy(thread_guid, &guid, sizeof(GUID));
thread = CreateThread(NULL, 0, custom_action_thread, thread_guid, 0, NULL);
*pargv = NULL;
count = chomp( cmdline, NULL );
- if (!(p = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(cmdline) + count + 1) * sizeof(WCHAR) )))
+ if (!(p = malloc( (wcslen(cmdline) + count + 1) * sizeof(WCHAR) )))
return;
count = chomp( cmdline, p );
- if (!(argv = HeapAlloc( GetProcessHeap(), 0, (count + 1) * sizeof(WCHAR *) )))
+ if (!(argv = malloc( (count + 1) * sizeof(WCHAR *) )))
{
- HeapFree( GetProcessHeap(), 0, p );
+ free( p );
return;
}
for (i = 0; i < count; i++)
if(r == ERROR_SUCCESS && type == REG_SZ)
{
int len = lstrlenW( *pargv[0] );
- if (!(buf = HeapAlloc( GetProcessHeap(), 0, sz + (len + 1) * sizeof(WCHAR) )))
+ if (!(buf = malloc( (len + 1) * sizeof(WCHAR) )))
{
RegCloseKey( hkey );
return FALSE;
process_args(buf, pargc, pargv);
ret = TRUE;
}
- HeapFree(GetProcessHeap(), 0, buf);
+ free(buf);
}
RegCloseKey(hkey);
return ret;
unsigned int p;
WCHAR *path;
- if (!(path = heap_alloc(lstrlenW(package_name) * sizeof(WCHAR) + sizeof(ext))))
+ if (!(path = malloc(wcslen(package_name) * sizeof(WCHAR) + sizeof(ext))))
{
WINE_ERR("No memory.\n");
return NULL;
--p;
if (path[p] == '.')
{
- heap_free(path);
+ free(path);
return NULL;
}
lstrcatW(path, ext);
RepairMode |= REINSTALLMODE_PACKAGE;
break;
default:
- fprintf(stderr, "Unknown option \"%c\" in Repair mode\n", argvW[i][j]);
+ report_error("Unknown option \"%c\" in Repair mode\n", argvW[i][j]);
break;
}
}
AdvertiseMode = ADVERTISEFLAGS_MACHINEASSIGN;
break;
default:
- fprintf(stderr, "Unknown option \"%c\" in Advertise mode\n", argvW[i][j]);
+ report_error("Unknown option \"%c\" in Advertise mode\n", argvW[i][j]);
break;
}
}
LogFileName = argvW[i];
if(MsiEnableLogW(LogMode, LogFileName, LogAttributes) != ERROR_SUCCESS)
{
- fprintf(stderr, "Logging in %s (0x%08x, %u) failed\n",
- wine_dbgstr_w(LogFileName), LogMode, LogAttributes);
+ report_error("Logging in %s (0x%08lx, %lu) failed\n",
+ wine_dbgstr_w(LogFileName), LogMode, LogAttributes);
ExitProcess(1);
}
}
if(lstrlenW(argvW[i]) == 2 || msi_strequal(argvW[i]+2, "n") ||
msi_strequal(argvW[i] + 2, "uiet"))
{
+ silent = TRUE;
InstallUILevel = INSTALLUILEVEL_NONE;
}
else if(msi_strequal(argvW[i]+2, "r"))
}
else
{
- fprintf(stderr, "Unknown option \"%s\" for UI level\n",
- wine_dbgstr_w(argvW[i]+2));
+ report_error("Unknown option \"%s\" for UI level\n",
+ wine_dbgstr_w(argvW[i]+2));
}
}
else if(msi_option_equal(argvW[i], "passive"))
&& (path = get_path_with_extension(PackageName)))
{
ReturnCode = MsiInstallProductW(path, Properties);
- heap_free(path);
+ free(path);
}
}
}
&& (path = get_path_with_extension(PackageName)))
{
ReturnCode = MsiReinstallProductW(path, RepairMode);
- heap_free(path);
+ free(path);
}
}
}
--- /dev/null
+/*
+ * msiexec.exe internal definitions
+ *
+ * Copyright 2023 Eric Pouech for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef __WINE_CRT_PRINTF_ATTR
+extern void report_error(const char* msg, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
+#else
+extern void report_error(const char* msg, ...);
+#endif
#define WIN32_LEAN_AND_MEAN
-#include <stdio.h>
#include <windows.h>
#include <winsvc.h>
#include "wine/debug.h"
+#include "msiexec_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(msiexec);
if (!SetServiceStatus(hstatus, &status))
{
- fprintf(stderr, "Failed to set service status\n");
+ report_error("Failed to set service status\n");
KillService();
return FALSE;
}
static void WINAPI ServiceCtrlHandler(DWORD code)
{
- WINE_TRACE("%u\n", code);
+ WINE_TRACE("%ld\n", code);
switch (code)
{
KillService();
break;
default:
- fprintf(stderr, "Unhandled service control code: %u\n", code);
+ report_error("Unhandled service control code: %ld\n", code);
UpdateSCMStatus(SERVICE_RUNNING, NO_ERROR, 0);
break;
}
thread = CreateThread(0, 0, ServiceExecutionThread, 0, 0, &id);
if (!thread)
{
- fprintf(stderr, "Failed to create thread\n");
+ report_error("Failed to create thread\n");
return FALSE;
}
hstatus = RegisterServiceCtrlHandlerA("MSIServer", ServiceCtrlHandler);
if (!hstatus)
{
- fprintf(stderr, "Failed to register service ctrl handler\n");
+ report_error("Failed to register service ctrl handler\n");
return;
}
kill_event = CreateEventW(0, TRUE, FALSE, 0);
if (!kill_event)
{
- fprintf(stderr, "Failed to create event\n");
+ report_error("Failed to create event\n");
KillService();
UpdateSCMStatus(SERVICE_STOPPED, NO_ERROR, 0);
return;
if (!StartServiceCtrlDispatcherA(service))
{
- fprintf(stderr, "Failed to start MSIServer service\n");
+ report_error("Failed to start MSIServer service\n");
return 1;
}
return rc;
}
-static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
- INT rc)
+static void ui_actioninfo(MSIPACKAGE *package, const WCHAR *action, BOOL start, INT rc)
{
MSIRECORD *row;
WCHAR *template;
row = MSI_CreateRecord(2);
if (!row)
{
- msi_free(template);
+ free(template);
return;
}
MSI_RecordSetStringW(row, 0, template);
MSI_RecordSetInteger(row, 2, start ? package->LastActionResult : rc);
MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row);
msiobj_release(&row->hdr);
- msi_free(template);
+ free(template);
if (!start) package->LastActionResult = rc;
}
while (ptr[len - 1] == ' ') len--;
- prop = msi_alloc( (len + 1) * sizeof(WCHAR) );
+ prop = malloc( (len + 1) * sizeof(WCHAR) );
memcpy( prop, ptr, len * sizeof(WCHAR) );
prop[len] = 0;
if (!preserve_case) wcsupr( prop );
while (*ptr2 == ' ') ptr2++;
num_quotes = 0;
- val = msi_alloc( (lstrlenW( ptr2 ) + 1) * sizeof(WCHAR) );
+ val = malloc( (wcslen( ptr2 ) + 1) * sizeof(WCHAR) );
len = parse_prop( ptr2, val, &num_quotes );
if (num_quotes % 2)
{
WARN("unbalanced quotes\n");
- msi_free( val );
- msi_free( prop );
+ free( val );
+ free( prop );
return ERROR_INVALID_COMMAND_LINE;
}
remove_quotes( val );
if (r == ERROR_SUCCESS && !wcscmp( prop, L"SourceDir" ))
msi_reset_source_folders( package );
- msi_free( val );
- msi_free( prop );
+ free( val );
+ free( prop );
ptr = ptr2 + len;
}
}
/* allocate space for an array of substring pointers and the substrings */
- ret = msi_alloc( (count+1) * sizeof (LPWSTR) +
- (lstrlenW(str)+1) * sizeof(WCHAR) );
+ ret = malloc( (count + 1) * sizeof(WCHAR *) + (wcslen(str) + 1) * sizeof(WCHAR) );
if (!ret)
return ret;
if (!(p = wcsrchr( db, '\\' )) && !(p = wcsrchr( db, '/' )))
{
- msi_free(db);
+ free(db);
return ERROR_SUCCESS;
}
len = p - db + 2;
- source = msi_alloc( len * sizeof(WCHAR) );
+ source = malloc( len * sizeof(WCHAR) );
lstrcpynW( source, db, len );
- msi_free( db );
+ free( db );
check = msi_dup_property( package->db, L"SourceDir" );
if (!check || replace)
if (r == ERROR_SUCCESS)
msi_reset_source_folders( package );
}
- msi_free( check );
+ free( check );
check = msi_dup_property( package->db, L"SOURCEDIR" );
if (!check || replace)
msi_set_property( package->db, L"SOURCEDIR", source, -1 );
- msi_free( check );
- msi_free( source );
+ free( check );
+ free( source );
return ERROR_SUCCESS;
}
MSIPACKAGE *package = param;
MSICOMPONENT *comp;
- comp = msi_alloc_zero( sizeof(MSICOMPONENT) );
+ comp = calloc( 1, sizeof(MSICOMPONENT) );
if (!comp)
return ERROR_FUNCTION_FAILED;
return r;
}
-typedef struct {
- MSIPACKAGE *package;
- MSIFEATURE *feature;
-} _ilfs;
-
static UINT add_feature_component( MSIFEATURE *feature, MSICOMPONENT *comp )
{
ComponentList *cl;
- cl = msi_alloc( sizeof (*cl) );
+ cl = malloc( sizeof(*cl) );
if ( !cl )
return ERROR_NOT_ENOUGH_MEMORY;
cl->component = comp;
{
FeatureList *fl;
- fl = msi_alloc( sizeof(*fl) );
+ fl = malloc( sizeof(*fl) );
if ( !fl )
return ERROR_NOT_ENOUGH_MEMORY;
fl->feature = child;
return ERROR_SUCCESS;
}
+struct package_feature
+{
+ MSIPACKAGE *package;
+ MSIFEATURE *feature;
+};
+
static UINT iterate_load_featurecomponents(MSIRECORD *row, LPVOID param)
{
- _ilfs* ilfs = param;
+ struct package_feature *package_feature = param;
LPCWSTR component;
MSICOMPONENT *comp;
component = MSI_RecordGetString(row,1);
/* check to see if the component is already loaded */
- comp = msi_get_loaded_component( ilfs->package, component );
+ comp = msi_get_loaded_component( package_feature->package, component );
if (!comp)
{
WARN("ignoring unknown component %s\n", debugstr_w(component));
return ERROR_SUCCESS;
}
- add_feature_component( ilfs->feature, comp );
+ add_feature_component( package_feature->feature, comp );
comp->Enabled = TRUE;
return ERROR_SUCCESS;
MSIPACKAGE *package = param;
MSIFEATURE *feature;
MSIQUERY *view;
- _ilfs ilfs;
+ struct package_feature package_feature;
UINT rc;
/* fill in the data */
- feature = msi_alloc_zero( sizeof (MSIFEATURE) );
+ feature = calloc( 1, sizeof(MSIFEATURE) );
if (!feature)
return ERROR_NOT_ENOUGH_MEMORY;
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
- ilfs.package = package;
- ilfs.feature = feature;
+ package_feature.package = package;
+ package_feature.feature = feature;
- rc = MSI_IterateRecords(view, NULL, iterate_load_featurecomponents , &ilfs);
+ rc = MSI_IterateRecords(view, NULL, iterate_load_featurecomponents, &package_feature);
msiobj_release(&view->hdr);
return rc;
}
/* fill in the data */
- file = msi_alloc_zero( sizeof (MSIFILE) );
+ file = calloc( 1, sizeof(MSIFILE) );
if (!file)
return ERROR_NOT_ENOUGH_MEMORY;
if (!file->Component)
{
WARN("Component not found: %s\n", debugstr_w(component));
- msi_free(file->File);
- msi_free(file);
+ free(file->File);
+ free(file);
return ERROR_SUCCESS;
}
msi_reduce_to_long_filename( file->FileName );
file->ShortName = msi_dup_record_field( row, 3 );
- file->LongName = strdupW( folder_split_path(file->ShortName, '|'));
+ file->LongName = wcsdup( folder_split_path(file->ShortName, '|') );
file->FileSize = MSI_RecordGetInteger( row, 4 );
file->Version = msi_dup_record_field( row, 5 );
MSIFILEPATCH *patch;
const WCHAR *file_key;
- patch = msi_alloc_zero( sizeof (MSIFILEPATCH) );
+ patch = calloc( 1, sizeof(MSIFILEPATCH) );
if (!patch)
return ERROR_NOT_ENOUGH_MEMORY;
if (!patch->File)
{
ERR("Failed to find target for patch in File table\n");
- msi_free(patch);
+ free(patch);
return ERROR_FUNCTION_FAILED;
}
LPWSTR p, tgt_short, tgt_long, src_short, src_long;
MSIFOLDER *folder;
- if (!(folder = msi_alloc_zero( sizeof(*folder) ))) return ERROR_NOT_ENOUGH_MEMORY;
+ if (!(folder = calloc( 1, sizeof(*folder) ))) return ERROR_NOT_ENOUGH_MEMORY;
list_init( &folder->children );
folder->Directory = msi_dup_record_field( row, 1 );
folder->Parent = msi_dup_record_field( row, 2 );
src_long = src_short;
/* FIXME: use the target short path too */
- folder->TargetDefault = strdupW(tgt_long);
- folder->SourceShortPath = strdupW(src_short);
- folder->SourceLongPath = strdupW(src_long);
- msi_free(p);
+ folder->TargetDefault = wcsdup(tgt_long);
+ folder->SourceShortPath = wcsdup(src_short);
+ folder->SourceLongPath = wcsdup(src_long);
+ free(p);
TRACE("TargetDefault = %s\n",debugstr_w( folder->TargetDefault ));
TRACE("SourceLong = %s\n", debugstr_w( folder->SourceLongPath ));
{
FolderList *fl;
- if (!(fl = msi_alloc( sizeof(*fl) ))) return ERROR_NOT_ENOUGH_MEMORY;
+ if (!(fl = malloc( sizeof(*fl) ))) return ERROR_NOT_ENOUGH_MEMORY;
fl->folder = child;
list_add_tail( &parent->children, &fl->entry );
return ERROR_SUCCESS;
}
}
}
- msi_free(override);
+ free(override);
return TRUE;
}
{
GetTempPathW( MAX_PATH, tmp );
}
- if (!(db->tempfolder = strdupW( tmp ))) return NULL;
+ if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
}
- if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
+ if ((ret = malloc( (wcslen( db->tempfolder ) + 20) * sizeof(WCHAR) )))
{
for (;;)
{
if (!GetTempFileNameW( db->tempfolder, L"msi", ++id, ret ))
{
- msi_free( ret );
+ free( ret );
return NULL;
}
if (CreateDirectoryW( ret, NULL )) break;
}
va_end( va );
- dir = msi_alloc( sz * sizeof(WCHAR) );
+ dir = malloc( sz * sizeof(WCHAR) );
dir[0] = 0;
va_start( va, count );
static void set_target_path( MSIPACKAGE *package, MSIFILE *file )
{
- msi_free( file->TargetPath );
+ free( file->TargetPath );
if (msi_is_global_assembly( file->Component ))
{
MSIASSEMBLY *assembly = file->Component->assembly;
set_target_path( package, file );
- if ((comp->assembly && !comp->assembly->installed) ||
- msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
+ if (msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
{
- comp->Cost += file->FileSize;
+ comp->cost += cost_from_size( file->FileSize );
continue;
}
file_size = msi_get_disk_file_size( package, file->TargetPath );
{
if (msi_compare_file_versions( file_version, file->Version ) < 0)
{
- comp->Cost += file->FileSize - file_size;
+ comp->cost += cost_from_size( file->FileSize - file_size );
}
- msi_free( file_version );
+ free( file_version );
continue;
}
else if ((font_version = msi_get_font_file_version( package, file->TargetPath )))
{
if (msi_compare_font_versions( font_version, file->Version ) < 0)
{
- comp->Cost += file->FileSize - file_size;
+ comp->cost += cost_from_size( file->FileSize - file_size );
}
- msi_free( font_version );
+ free( font_version );
continue;
}
}
if (file_size != file->FileSize)
{
- comp->Cost += file->FileSize - file_size;
+ comp->cost += cost_from_size( file->FileSize - file_size );
}
}
WCHAR *q, *ret;
int n, len = lstrlenW( in ) + 2;
- if (!(q = ret = msi_alloc( len * sizeof(WCHAR) ))) return NULL;
+ if (!(q = ret = malloc( len * sizeof(WCHAR) ))) return NULL;
len = 0;
while (1)
if (MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE )) return NULL;
if ((path = msi_reg_get_val_str( hkey, L"InstallLocation" )) && !path[0])
{
- msi_free( path );
+ free( path );
path = NULL;
}
RegCloseKey( hkey );
normalized_path = msi_normalize_path( path );
msi_set_property( package->db, folder->Directory, normalized_path, -1 );
- msi_free( path );
+ free( path );
- msi_free( folder->ResolvedTarget );
+ free( folder->ResolvedTarget );
folder->ResolvedTarget = normalized_path;
LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{
- if (comp->Action == INSTALLSTATE_LOCAL) ret += comp->Cost;
+ if (comp->Action == INSTALLSTATE_LOCAL) ret += comp->cost;
}
return ret;
}
/* set default run level if not set */
level = msi_dup_property( package->db, L"INSTALLLEVEL" );
if (!level) msi_set_property( package->db, L"INSTALLLEVEL", L"1", -1 );
- msi_free(level);
+ free(level);
if ((rc = MSI_SetFeatureStates( package ))) return rc;
}
required = get_volume_space_required( package );
#ifdef __REACTOS__
- swprintf( buf, ARRAY_SIZE(buf), L"%I64u", required / 512 );
+ swprintf( buf, ARRAY_SIZE(buf), L"%I64u", required );
#else
- swprintf( buf, ARRAY_SIZE(buf), L"%lu", required / 512 );
+ swprintf( buf, ARRAY_SIZE(buf), L"%lu", required );
#endif
msi_set_property( package->db, L"PrimaryVolumeSpaceRequired", buf, -1 );
#ifdef __REACTOS__
- swprintf( buf, ARRAY_SIZE(buf), L"%I64u", (free.QuadPart - required) / 512 );
+ swprintf( buf, ARRAY_SIZE(buf), L"%I64u", (free.QuadPart / 512) - required );
#else
- swprintf( buf, ARRAY_SIZE(buf), L"%lu", (free.QuadPart - required) / 512 );
+ swprintf( buf, ARRAY_SIZE(buf), L"%lu", (free.QuadPart / 512) - required );
#endif
msi_set_property( package->db, L"PrimaryVolumeSpaceRemaining", buf, -1 );
msi_set_property( package->db, L"PrimaryVolumePath", primary_folder, 2 );
}
- msi_free( primary_folder );
+ free( primary_folder );
}
- msi_free( primary_key );
+ free( primary_key );
}
/* FIXME: check volume disk space */
{
*size = sizeof(WCHAR);
*type = REG_SZ;
- if ((data = msi_alloc( *size ))) *(WCHAR *)data = 0;
+ if ((data = malloc( *size ))) *(WCHAR *)data = 0;
return data;
}
if (value[0]=='#' && value[1]!='#' && value[1]!='%')
else
*size = lstrlenW(ptr)/2;
- data = msi_alloc(*size);
+ data = malloc(*size);
byte[0] = '0';
byte[1] = 'x';
data[count] = (BYTE)strtol(byte,NULL,0);
count ++;
}
- msi_free(deformated);
+ free(deformated);
TRACE( "data %lu bytes(%u)\n", *size, count );
}
*type=REG_DWORD;
*size = sizeof(DWORD);
- data = msi_alloc(*size);
+ data = malloc(*size);
p = deformated;
if (*p == '-')
p++;
*(DWORD *)data = d;
TRACE( "DWORD %lu\n", *(DWORD *)data);
- msi_free(deformated);
+ free(deformated);
}
}
else
access |= get_registry_view( comp );
- if (!(subkey = strdupW( path ))) return NULL;
+ if (!(subkey = wcsdup( path ))) return NULL;
p = subkey;
if ((q = wcschr( p, '\\' ))) *q = 0;
if (create)
if (res)
{
TRACE( "failed to open key %s (%ld)\n", debugstr_w(subkey), res );
- msi_free( subkey );
+ free( subkey );
return NULL;
}
if (q && q[1])
RegCloseKey( hkey );
}
else ret = hkey;
- msi_free( subkey );
+ free( subkey );
return ret;
}
p += lstrlenW( p ) + 1;
(*count)++;
}
- if (!(ret = msi_alloc( *count * sizeof(WCHAR *) ))) return NULL;
+ if (!(ret = malloc( *count * sizeof(WCHAR *) ))) return NULL;
p = str;
while ((p - str) < len)
{
- if (!(ret[i] = strdupW( p )))
+ if (!(ret[i] = wcsdup( p )))
{
- for (; i >= 0; i--) msi_free( ret[i] );
- msi_free( ret );
+ for (; i >= 0; i--) free( ret[i] );
+ free( ret );
return NULL;
}
p += lstrlenW( p ) + 1;
for (i = 0; i < left_count; i++) *size += (lstrlenW( left[i] ) + 1) * sizeof(WCHAR);
for (i = 0; i < right_count; i++) *size += (lstrlenW( right[i] ) + 1) * sizeof(WCHAR);
- if (!(ret = p = msi_alloc( *size ))) return NULL;
+ if (!(ret = p = malloc( *size ))) return NULL;
for (i = 0; i < left_count; i++)
{
{
if (old[j] && !wcscmp( new[i], old[j] ))
{
- msi_free( old[j] );
+ free( old[j] );
for (k = j; k < old_count - 1; k++) { old[k] = old[k + 1]; }
old[k] = NULL;
ret--;
old = split_multi_string_values( old_ptr, old_len, &old_count );
}
ret = (BYTE *)join_multi_string_values( op, old, old_count, new, new_count, size );
- for (i = 0; i < old_count; i++) msi_free( old[i] );
- for (i = 0; i < new_count; i++) msi_free( new[i] );
- msi_free( old );
- msi_free( new );
+ for (i = 0; i < old_count; i++) free( old[i] );
+ for (i = 0; i < new_count; i++) free( new[i] );
+ free( old );
+ free( new );
return ret;
}
{
BYTE *ret;
if (RegQueryValueExW( hkey, name, NULL, NULL, NULL, size )) return NULL;
- if (!(ret = msi_alloc( *size ))) return NULL;
+ if (!(ret = malloc( *size ))) return NULL;
RegQueryValueExW( hkey, name, NULL, type, ret, size );
return ret;
}
return ERROR_SUCCESS;
deformat_string(package, key , &deformated);
- uikey = msi_alloc( (lstrlenW(deformated) + lstrlenW(szRoot) + 1) * sizeof(WCHAR) );
+ uikey = malloc( (wcslen(deformated) + wcslen(szRoot) + 1) * sizeof(WCHAR) );
lstrcpyW(uikey,szRoot);
lstrcatW(uikey,deformated);
if (!(hkey = open_key( comp, root_key, deformated, TRUE, KEY_QUERY_VALUE | KEY_SET_VALUE )))
{
ERR("Could not create key %s\n", debugstr_w(deformated));
- msi_free(uikey);
- msi_free(deformated);
+ free(uikey);
+ free(deformated);
return ERROR_FUNCTION_FAILED;
}
- msi_free( deformated );
+ free( deformated );
str = msi_record_get_string( row, 5, NULL );
len = deformat_string( package, str, &deformated );
new_value = parse_value( package, deformated, len, &type, &new_size );
- msi_free( deformated );
+ free( deformated );
deformat_string(package, name, &deformated);
if (!is_special_entry( name ))
BYTE *new;
if (old_value && old_type != REG_MULTI_SZ)
{
- msi_free( old_value );
+ free( old_value );
old_value = NULL;
old_size = 0;
}
new = build_multi_string_value( old_value, old_size, new_value, new_size, &new_size );
- msi_free( new_value );
+ free( new_value );
new_value = new;
}
if (!check_first)
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(new_value);
- msi_free(old_value);
- msi_free(deformated);
- msi_free(uikey);
+ free(new_value);
+ free(old_value);
+ free(deformated);
+ free(uikey);
return ERROR_SUCCESS;
}
WCHAR *subkey, *p;
HKEY hkey;
- if (!(subkey = strdupW( path ))) return;
+ if (!(subkey = wcsdup( path ))) return;
do
{
if ((p = wcsrchr( subkey, '\\' )))
break;
}
} while (p);
- msi_free( subkey );
+ free( subkey );
}
static void delete_value( const MSICOMPONENT *comp, HKEY root, const WCHAR *path, const WCHAR *value )
deformat_string( package, key_str, &deformated_key );
size = lstrlenW( deformated_key ) + lstrlenW( root_key_str ) + 1;
- ui_key_str = msi_alloc( size * sizeof(WCHAR) );
+ ui_key_str = malloc( size * sizeof(WCHAR) );
lstrcpyW( ui_key_str, root_key_str );
lstrcatW( ui_key_str, deformated_key );
if (delete_key) delete_tree( comp, hkey_root, deformated_key );
else delete_value( comp, hkey_root, deformated_key, deformated_name );
- msi_free( deformated_key );
+ free( deformated_key );
uirow = MSI_CreateRecord( 2 );
MSI_RecordSetStringW( uirow, 1, ui_key_str );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( ui_key_str );
- msi_free( deformated_name );
+ free( ui_key_str );
+ free( deformated_name );
return ERROR_SUCCESS;
}
deformat_string( package, key_str, &deformated_key );
size = lstrlenW( deformated_key ) + lstrlenW( root_key_str ) + 1;
- ui_key_str = msi_alloc( size * sizeof(WCHAR) );
+ ui_key_str = malloc( size * sizeof(WCHAR) );
lstrcpyW( ui_key_str, root_key_str );
lstrcatW( ui_key_str, deformated_key );
if (delete_key) delete_tree( comp, hkey_root, deformated_key );
else delete_value( comp, hkey_root, deformated_key, deformated_name );
- msi_free( deformated_key );
+ free( deformated_key );
uirow = MSI_CreateRecord( 2 );
MSI_RecordSetStringW( uirow, 1, ui_key_str );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( ui_key_str );
- msi_free( deformated_name );
+ free( ui_key_str );
+ free( deformated_name );
return ERROR_SUCCESS;
}
message = MSI_RecordGetString(row, 2);
deformat_string(package, message, &deformated);
MessageBoxW(NULL, deformated, L"Install Failed", MB_OK);
- msi_free(deformated);
+ free(deformated);
}
return ERROR_INSTALL_FAILURE;
{
if (!cmp->KeyPath)
- return strdupW( msi_get_target_folder( package, cmp->Directory ) );
+ return wcsdup( msi_get_target_folder( package, cmp->Directory ) );
if (cmp->Attributes & msidbComponentAttributesRegistryKeyPath)
{
if (deformated_name)
len+=lstrlenW(deformated_name);
- buffer = msi_alloc( len *sizeof(WCHAR));
+ buffer = malloc(len * sizeof(WCHAR));
if (deformated_name)
swprintf(buffer, len, L"%02d:\\%s\\%s", root, deformated, deformated_name);
else
swprintf(buffer, len, L"%02d:\\%s\\", root, deformated);
- msi_free(deformated);
- msi_free(deformated_name);
+ free(deformated);
+ free(deformated_name);
msiobj_release(&row->hdr);
return buffer;
MSIFILE *file = msi_get_loaded_file( package, cmp->KeyPath );
if (file)
- return strdupW( file->TargetPath );
+ return wcsdup( file->TargetPath );
}
return NULL;
}
if (comp->assembly)
{
DWORD len = lstrlenW( L"<\\" ) + lstrlenW( comp->assembly->display_name );
- WCHAR *keypath = msi_alloc( (len + 1) * sizeof(WCHAR) );
+ WCHAR *keypath = malloc( (len + 1) * sizeof(WCHAR) );
if (keypath)
{
continue;
squash_guid( comp->ComponentId, squashed_cc );
- msi_free( comp->FullKeypath );
+ free( comp->FullKeypath );
comp->FullKeypath = build_full_keypath( package, comp );
refcount_component( package, comp );
sourcepath = msi_resolve_file_source(package, file);
ptr = sourcepath + lstrlenW(base);
lstrcpyW(ptr2, ptr);
- msi_free(sourcepath);
+ free(sourcepath);
msi_reg_set_val_str( hkey, squashed_pc, source );
}
return ERROR_SUCCESS;
}
-typedef struct {
+struct typelib
+{
CLSID clsid;
LPWSTR source;
-
LPWSTR path;
ITypeLib *ptLib;
-} typelib_struct;
+};
static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType,
LPWSTR lpszName, LONG_PTR lParam)
{
TLIBATTR *attr;
- typelib_struct *tl_struct = (typelib_struct*) lParam;
+ struct typelib *tl_struct = (struct typelib *)lParam;
int sz;
HRESULT res;
sz = lstrlenW(tl_struct->source)+4;
if ((INT_PTR)lpszName == 1)
- tl_struct->path = strdupW(tl_struct->source);
+ tl_struct->path = wcsdup(tl_struct->source);
else
{
- tl_struct->path = msi_alloc(sz * sizeof(WCHAR));
+ tl_struct->path = malloc(sz * sizeof(WCHAR));
#ifdef __REACTOS__
swprintf(tl_struct->path, sz, L"%s\\%d", tl_struct->source, (WORD)(INT_PTR)lpszName);
#else
res = LoadTypeLib(tl_struct->path,&tl_struct->ptLib);
if (FAILED(res))
{
- msi_free(tl_struct->path);
+ free(tl_struct->path);
tl_struct->path = NULL;
return TRUE;
return FALSE;
}
- msi_free(tl_struct->path);
+ free(tl_struct->path);
tl_struct->path = NULL;
ITypeLib_ReleaseTLibAttr(tl_struct->ptLib, attr);
return TRUE;
}
-static HMODULE msi_load_library( MSIPACKAGE *package, const WCHAR *filename, DWORD flags )
+static HMODULE load_library( MSIPACKAGE *package, const WCHAR *filename, DWORD flags )
{
HMODULE module;
msi_disable_fs_redirection( package );
return module;
}
-static HRESULT msi_load_typelib( MSIPACKAGE *package, const WCHAR *filename, REGKIND kind, ITypeLib **lib )
+static HRESULT load_typelib( MSIPACKAGE *package, const WCHAR *filename, REGKIND kind, ITypeLib **lib )
{
HRESULT hr;
msi_disable_fs_redirection( package );
LPCWSTR component;
MSICOMPONENT *comp;
MSIFILE *file;
- typelib_struct tl_struct;
+ struct typelib tl_struct;
ITypeLib *tlib;
HMODULE module;
HRESULT hr;
}
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row);
- module = msi_load_library( package, file->TargetPath, LOAD_LIBRARY_AS_DATAFILE );
+ module = load_library( package, file->TargetPath, LOAD_LIBRARY_AS_DATAFILE );
if (module)
{
LPCWSTR guid;
guid = MSI_RecordGetString(row,1);
CLSIDFromString( guid, &tl_struct.clsid);
- tl_struct.source = strdupW( file->TargetPath );
+ tl_struct.source = wcsdup( file->TargetPath );
tl_struct.path = NULL;
EnumResourceNamesW(module, L"TYPELIB", Typelib_EnumResNameProc,
TRACE("Registered %s\n", debugstr_w(tl_struct.path));
ITypeLib_Release(tl_struct.ptLib);
- msi_free(tl_struct.path);
+ free(tl_struct.path);
}
else ERR("Failed to load type library %s\n", debugstr_w(tl_struct.source));
FreeLibrary(module);
- msi_free(tl_struct.source);
+ free(tl_struct.source);
}
else
{
- hr = msi_load_typelib( package, file->TargetPath, REGKIND_REGISTER, &tlib );
+ hr = load_typelib( package, file->TargetPath, REGKIND_REGISTER, &tlib );
if (FAILED(hr))
{
ERR( "failed to load type library: %#lx\n", hr );
static WCHAR *get_link_file( MSIPACKAGE *package, MSIRECORD *row )
{
LPCWSTR directory, extension, link_folder;
- LPWSTR link_file, filename;
+ WCHAR *link_file = NULL, *filename, *new_filename;
directory = MSI_RecordGetString( row, 2 );
link_folder = msi_get_target_folder( package, directory );
msi_create_full_path( package, link_folder );
filename = msi_dup_record_field( row, 3 );
+ if (!filename) return NULL;
msi_reduce_to_long_filename( filename );
extension = wcsrchr( filename, '.' );
if (!extension || wcsicmp( extension, L".lnk" ))
{
int len = lstrlenW( filename );
- filename = msi_realloc( filename, len * sizeof(WCHAR) + sizeof(L".lnk") );
+ new_filename = realloc( filename, len * sizeof(WCHAR) + sizeof(L".lnk") );
+ if (!new_filename) goto done;
+ filename = new_filename;
memcpy( filename + len, L".lnk", sizeof(L".lnk") );
}
link_file = msi_build_directory_name( 2, link_folder, filename );
- msi_free( filename );
+done:
+ free( filename );
return link_file;
}
{
WCHAR *appdata = msi_dup_property( package->db, L"AppDataFolder" );
folder = msi_build_directory_name( 2, appdata, L"Microsoft\\" );
- msi_free( appdata );
+ free( appdata );
}
dest = msi_build_directory_name( 3, folder, L"Installer\\", package->ProductCode );
msi_create_full_path( package, dest );
path = msi_build_directory_name( 2, dest, icon_name );
- msi_free( folder );
- msi_free( dest );
+ free( folder );
+ free( dest );
return path;
}
deformat_string( package, target, &path );
TRACE("target path is %s\n", debugstr_w(path));
IShellLinkW_SetPath( sl, path );
- msi_free( path );
+ free( path );
}
else
{
FIXME("poorly handled shortcut format, advertised shortcut\n");
path = resolve_keypath( package, comp );
IShellLinkW_SetPath( sl, path );
- msi_free( path );
+ free( path );
}
if (!MSI_RecordIsNull(row,6))
LPCWSTR arguments = MSI_RecordGetString(row, 6);
deformat_string(package, arguments, &deformated);
IShellLinkW_SetArguments(sl,deformated);
- msi_free(deformated);
+ free(deformated);
}
if (!MSI_RecordIsNull(row,7))
index = 0;
IShellLinkW_SetIconLocation(sl, path, index);
- msi_free(path);
+ free(path);
}
if (!MSI_RecordIsNull(row,11))
IPersistFile_Save(pf, link_file, FALSE);
msi_revert_fs_redirection( package );
- msi_free(link_file);
+ free(link_file);
err:
if (pf)
link_file = get_link_file( package, row );
TRACE("Removing shortcut file %s\n", debugstr_w( link_file ));
if (!msi_delete_file( package, link_file )) WARN( "failed to remove shortcut file %lu\n", GetLastError() );
- msi_free( link_file );
+ free( link_file );
return ERROR_SUCCESS;
}
if (handle == INVALID_HANDLE_VALUE)
{
ERR("Unable to create file %s\n", debugstr_w(icon_path));
- msi_free( icon_path );
+ free( icon_path );
return ERROR_SUCCESS;
}
WriteFile( handle, buffer, sz, &count, NULL );
} while (sz == 1024);
- msi_free( icon_path );
+ free( icon_path );
CloseHandle( handle );
return ERROR_SUCCESS;
}
-static UINT msi_publish_icons(MSIPACKAGE *package)
+static UINT publish_icons(MSIPACKAGE *package)
{
MSIQUERY *view;
UINT r;
return ERROR_SUCCESS;
}
-static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey)
+static UINT publish_sourcelist(MSIPACKAGE *package, HKEY hkey)
{
UINT r;
HKEY source;
return ERROR_SUCCESS;
}
-static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey)
+static UINT publish_product_properties(MSIPACKAGE *package, HKEY hkey)
{
WCHAR *buffer, *ptr, *guids, packcode[SQUASHED_GUID_SIZE];
DWORD langid;
buffer = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTNAMEW, buffer);
- msi_free(buffer);
+ free(buffer);
langid = msi_get_property_int(package->db, L"ProductLanguage", 0);
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_LANGUAGEW, langid);
{
LPWSTR path = msi_build_icon_path(package, buffer);
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTICONW, path);
- msi_free(path);
- msi_free(buffer);
+ free(path);
+ free(buffer);
}
buffer = msi_dup_property(package->db, L"ProductVersion");
{
DWORD verdword = msi_version_str_to_dword(buffer);
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONW, verdword);
- msi_free(buffer);
+ free(buffer);
}
msi_reg_set_val_dword(hkey, L"Assignment", 0);
if (!(guids = msi_get_package_code(package->db))) return ERROR_OUTOFMEMORY;
if ((ptr = wcschr(guids, ';'))) *ptr = 0;
squash_guid(guids, packcode);
- msi_free( guids);
+ free(guids);
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGECODEW, packcode);
return ERROR_SUCCESS;
}
-static UINT msi_publish_upgrade_code(MSIPACKAGE *package)
+static UINT publish_upgrade_code(MSIPACKAGE *package)
{
UINT r;
HKEY hkey;
if (r != ERROR_SUCCESS)
{
WARN("failed to open upgrade code key\n");
- msi_free(upgrade);
+ free(upgrade);
return ERROR_SUCCESS;
}
squash_guid(package->ProductCode, squashed_pc);
msi_reg_set_val_str(hkey, squashed_pc, NULL);
RegCloseKey(hkey);
- msi_free(upgrade);
+ free(upgrade);
return ERROR_SUCCESS;
}
-static BOOL msi_check_publish(MSIPACKAGE *package)
+static BOOL check_publish(MSIPACKAGE *package)
{
MSIFEATURE *feature;
return FALSE;
}
-static BOOL msi_check_unpublish(MSIPACKAGE *package)
+static BOOL check_unpublish(MSIPACKAGE *package)
{
MSIFEATURE *feature;
return TRUE;
}
-static UINT msi_publish_patches( MSIPACKAGE *package )
+static UINT publish_patches( MSIPACKAGE *package )
{
WCHAR patch_squashed[GUID_SIZE];
HKEY patches_key = NULL, product_patches_key = NULL, product_key;
len += lstrlenW( patch_squashed ) + 1;
}
- p = all_patches = msi_alloc( (len + 1) * sizeof(WCHAR) );
+ p = all_patches = malloc( (len + 1) * sizeof(WCHAR) );
if (!all_patches)
goto done;
RegCloseKey( product_patches_key );
RegCloseKey( patches_key );
RegCloseKey( product_key );
- msi_free( all_patches );
+ free( all_patches );
return r;
}
if (!list_empty(&package->patches))
{
- rc = msi_publish_patches(package);
+ rc = publish_patches(package);
if (rc != ERROR_SUCCESS)
goto end;
}
WCHAR packed[SQUASHED_GUID_SIZE];
squash_guid(guid, packed);
- msi_free(guid);
+ free(guid);
if (!wcscmp(packed, package_code))
{
TRACE("re-publishing product - new package\n");
republish = TRUE;
}
}
- msi_free(package_code);
+ free(package_code);
}
}
/* FIXME: also need to publish if the product is in advertise mode */
- if (!republish && !msi_check_publish(package))
+ if (!republish && !check_publish(package))
{
if (hukey)
RegCloseKey(hukey);
if (rc != ERROR_SUCCESS)
goto end;
- rc = msi_publish_upgrade_code(package);
+ rc = publish_upgrade_code(package);
if (rc != ERROR_SUCCESS)
goto end;
- rc = msi_publish_product_properties(package, hukey);
+ rc = publish_product_properties(package, hukey);
if (rc != ERROR_SUCCESS)
goto end;
- rc = msi_publish_sourcelist(package, hukey);
+ rc = publish_sourcelist(package, hukey);
if (rc != ERROR_SUCCESS)
goto end;
- rc = msi_publish_icons(package);
+ rc = publish_icons(package);
end:
uirow = MSI_CreateRecord( 1 );
dirprop = MSI_RecordGetString( row, 3 );
if (dirprop)
{
- folder = strdupW( msi_get_target_folder( package, dirprop ) );
+ folder = wcsdup( msi_get_target_folder( package, dirprop ) );
if (!folder) folder = msi_dup_property( package->db, dirprop );
}
else
if (!folder)
{
ERR("Unable to resolve folder %s\n", debugstr_w(dirprop));
- msi_free( filename );
+ free( filename );
return NULL;
}
ret = msi_build_directory_name( 2, folder, ptr );
- msi_free( filename );
- msi_free( folder );
+ free( filename );
+ free( folder );
return ret;
}
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(fullname);
- msi_free(deformated_key);
- msi_free(deformated_value);
- msi_free(deformated_section);
+ free(fullname);
+ free(deformated_key);
+ free(deformated_value);
+ free(deformated_section);
return ERROR_SUCCESS;
}
{
WARN( "unable to remove key %lu\n", GetLastError() );
}
- msi_free( filename );
+ free( filename );
}
else
FIXME("Unsupported action %d\n", action);
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( deformated_key );
- msi_free( deformated_value );
- msi_free( deformated_section );
+ free( deformated_key );
+ free( deformated_value );
+ free( deformated_section );
return ERROR_SUCCESS;
}
{
WARN( "unable to remove key %lu\n", GetLastError() );
}
- msi_free( filename );
+ free( filename );
}
else
FIXME("Unsupported action %d\n", action);
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( deformated_key );
- msi_free( deformated_value );
- msi_free( deformated_section );
+ free( deformated_key );
+ free( deformated_value );
+ free( deformated_section );
return ERROR_SUCCESS;
}
static void register_dll( const WCHAR *dll, BOOL unregister )
{
-#ifdef __REACTOS__
static const WCHAR regW[] = L"regsvr32.exe /s \"%s\"";
static const WCHAR unregW[] = L"regsvr32.exe /s /u \"%s\"";
-#else /* __REACTOS__ */
- static const WCHAR regW[] = L"regsvr32.exe \"%s\"";
- static const WCHAR unregW[] = L"regsvr32.exe /u \"%s\"";
-#endif /* __REACTOS__ */
PROCESS_INFORMATION pi;
STARTUPINFOW si;
WCHAR *cmd;
- if (!(cmd = msi_alloc( lstrlenW(dll) * sizeof(WCHAR) + sizeof(unregW) ))) return;
+ if (!(cmd = malloc( wcslen(dll) * sizeof(WCHAR) + sizeof(unregW) ))) return;
if (unregister) swprintf( cmd, lstrlenW(dll) + ARRAY_SIZE(unregW), unregW, dll );
else swprintf( cmd, lstrlenW(dll) + ARRAY_SIZE(unregW), regW, dll );
msi_dialog_check_messages( pi.hProcess );
CloseHandle( pi.hProcess );
}
- msi_free( cmd );
+ free( cmd );
}
static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param)
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishFeatures");
- if (!msi_check_publish(package))
+ if (!check_publish(package))
return ERROR_SUCCESS;
rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context,
if (feature->Feature_Parent)
size += lstrlenW( feature->Feature_Parent )+2;
- data = msi_alloc(size * sizeof(WCHAR));
+ data = malloc(size * sizeof(WCHAR));
data[0] = 0;
LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
}
msi_reg_set_val_str( userdata, feature->Feature, data );
- msi_free(data);
+ free(data);
size = 0;
if (feature->Feature_Parent)
else
{
size += 2*sizeof(WCHAR);
- data = msi_alloc(size);
+ data = malloc(size);
data[0] = 0x6;
data[1] = 0;
if (feature->Feature_Parent)
lstrcpyW( &data[1], feature->Feature_Parent );
RegSetValueExW(hkey,feature->Feature,0,REG_SZ,
(LPBYTE)data,size);
- msi_free(data);
+ free(data);
}
/* the UI chunk */
return rc;
}
-static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
+static UINT unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
{
UINT r;
HKEY hkey;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishFeatures");
- if (!msi_check_unpublish(package))
+ if (!check_unpublish(package))
return ERROR_SUCCESS;
LIST_FOR_EACH_ENTRY(feature, &package->features, MSIFEATURE, entry)
{
- msi_unpublish_feature(package, feature);
+ unpublish_feature(package, feature);
}
return ERROR_SUCCESS;
}
-static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey)
+static UINT publish_install_properties(MSIPACKAGE *package, HKEY hkey)
{
static const WCHAR *propval[] =
{
key = *p++;
val = msi_dup_property(package->db, prop);
msi_reg_set_val_str(hkey, key, val);
- msi_free(val);
+ free(val);
}
msi_reg_set_val_dword(hkey, L"WindowsInstaller", 1);
size = deformat_string(package, fmt, &buffer) * sizeof(WCHAR);
RegSetValueExW(hkey, L"ModifyPath", 0, REG_EXPAND_SZ, (LPBYTE)buffer, size);
RegSetValueExW(hkey, L"UninstallString", 0, REG_EXPAND_SZ, (LPBYTE)buffer, size);
- msi_free(buffer);
+ free(buffer);
}
/* FIXME: Write real Estimated Size when we have it */
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONW, verdword);
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONMAJORW, verdword >> 24);
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_VERSIONMINORW, (verdword >> 16) & 0xFF);
- msi_free(buffer);
+ free(buffer);
}
return ERROR_SUCCESS;
return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterProduct");
/* FIXME: also need to publish if the product is in advertise mode */
- if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 )
- && !msi_check_publish(package))
+ if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 ) && !check_publish(package))
return ERROR_SUCCESS;
rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE);
if (rc != ERROR_SUCCESS)
goto done;
- rc = msi_publish_install_properties(package, hkey);
+ rc = publish_install_properties(package, hkey);
if (rc != ERROR_SUCCESS)
goto done;
- rc = msi_publish_install_properties(package, props);
+ rc = publish_install_properties(package, props);
if (rc != ERROR_SUCCESS)
goto done;
msi_reg_set_val_str( upgrade_key, squashed_pc, NULL );
RegCloseKey( upgrade_key );
}
- msi_free( upgrade_code );
+ free( upgrade_code );
}
msi_reg_set_val_str( props, INSTALLPROPERTY_LOCALPACKAGEW, package->localfile );
package->delete_on_close = FALSE;
*p = 0;
msi_remove_directory( package, icon_path );
}
- msi_free( icon_path );
+ free( icon_path );
}
return ERROR_SUCCESS;
}
-static UINT msi_unpublish_icons( MSIPACKAGE *package )
+static UINT unpublish_icons( MSIPACKAGE *package )
{
MSIQUERY *view;
UINT r;
if (!res && !count) MSIREG_DeleteClassesUpgradeCodesKey( code );
}
- msi_free( code );
+ free( code );
}
static UINT ACTION_UnpublishProduct(MSIPACKAGE *package)
TRACE("removing local package %s\n", debugstr_w(package->localfile));
package->delete_on_close = TRUE;
- msi_unpublish_icons( package );
+ unpublish_icons( package );
return ERROR_SUCCESS;
}
static UINT ACTION_InstallFinalize(MSIPACKAGE *package)
{
UINT rc;
+ MSIFILE *file;
+ MSIFILEPATCH *patch;
/* first do the same as an InstallExecute */
rc = execute_script(package, SCRIPT_INSTALL);
if (rc != ERROR_SUCCESS)
return rc;
+ /* install global assemblies */
+ LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
+ {
+ MSICOMPONENT *comp = file->Component;
+
+ if (!msi_is_global_assembly( comp ) || (file->state != msifs_missing && file->state != msifs_overwrite))
+ continue;
+
+ rc = msi_install_assembly( package, comp );
+ if (rc != ERROR_SUCCESS)
+ {
+ ERR("Failed to install assembly\n");
+ return ERROR_INSTALL_FAILURE;
+ }
+ file->state = msifs_installed;
+ }
+
+ /* patch global assemblies */
+ LIST_FOR_EACH_ENTRY( patch, &package->filepatches, MSIFILEPATCH, entry )
+ {
+ MSICOMPONENT *comp = patch->File->Component;
+
+ if (!msi_is_global_assembly( comp ) || !patch->path) continue;
+
+ rc = msi_patch_assembly( package, comp->assembly, patch );
+ if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
+ {
+ ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
+ return rc;
+ }
+
+ if ((rc = msi_install_assembly( package, comp )))
+ {
+ ERR("Failed to install patched assembly\n");
+ return rc;
+ }
+ }
+
/* then handle commit actions */
rc = execute_script(package, SCRIPT_COMMIT);
if (rc != ERROR_SUCCESS)
INSTALLPROPERTY_DISKPROMPTW,NULL,&size);
if (rc == ERROR_MORE_DATA)
{
- prompt = msi_alloc(size * sizeof(WCHAR));
+ prompt = malloc(size * sizeof(WCHAR));
MsiSourceListGetInfoW(package->ProductCode, NULL,
package->Context, MSICODE_PRODUCT,
INSTALLPROPERTY_DISKPROMPTW,prompt,&size);
}
else
- prompt = strdupW(package->db->path);
+ prompt = wcsdup(package->db->path);
record = MSI_CreateRecord(2);
MSI_RecordSetInteger(record, 1, MSIERR_INSERTDISK);
MSI_RecordSetStringW(record, 2, prompt);
- msi_free(prompt);
+ free(prompt);
while(attrib == INVALID_FILE_ATTRIBUTES)
{
MSI_RecordSetStringW(record, 0, NULL);
rc = MSI_ProcessMessage(package, INSTALLMESSAGE_ERROR, record);
if (rc == IDCANCEL)
+ {
+ msiobj_release(&record->hdr);
return ERROR_INSTALL_USEREXIT;
+ }
attrib = GetFileAttributesW(package->db->path);
}
+ msiobj_release(&record->hdr);
rc = ERROR_SUCCESS;
}
else
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterUser");
- if (msi_check_unpublish(package))
+ if (check_unpublish(package))
{
MSIREG_DeleteUserDataProductKey(package->ProductCode, package->Context);
goto end;
{
buffer = msi_dup_property( package->db, szPropKeys[i] );
msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
- msi_free( buffer );
+ free( buffer );
}
end:
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(productid);
+ free(productid);
RegCloseKey(hkey);
return rc;
}
}
info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
MSI_RecordSetStringW(uirow_info, 0, info_template);
- msi_free(info_template);
+ free(info_template);
MSI_ProcessMessage(package, INSTALLMESSAGE_INFO|MB_ICONHAND, uirow_info);
msiobj_release(&uirow_info->hdr);
}
msiobj_release(&uirow->hdr);
end:
- msi_free(productname);
- msi_free(action);
+ free(productname);
+ free(action);
return rc;
}
debugstr_w(component_85));
sz = 20 + lstrlenW( feature ) + 20 + 3;
- ret = msi_alloc_zero( sz * sizeof(WCHAR) );
+ ret = calloc( 1, sz * sizeof(WCHAR) );
if (ret) swprintf( ret, sz, L"%s%s%c%s", productid_85, feature, component ? '>' : '<', component_85 );
return ret;
}
text = MSI_RecordGetString( rec, 4 );
if (text)
{
- p = msi_alloc( (lstrlenW( advertise ) + lstrlenW( text ) + 1) * sizeof(WCHAR) );
+ p = malloc( (wcslen( advertise ) + wcslen( text ) + 1) * sizeof(WCHAR) );
lstrcpyW( p, advertise );
lstrcatW( p, text );
- msi_free( advertise );
+ free( advertise );
advertise = p;
}
existing = msi_reg_get_val_str( hkey, qualifier );
if (wcscmp( advertise, p )) sz += len;
}
}
- if (!(output = msi_alloc( (sz + 1) * sizeof(WCHAR) )))
+ if (!(output = malloc( (sz + 1) * sizeof(WCHAR) )))
{
rc = ERROR_OUTOFMEMORY;
goto end;
end:
RegCloseKey(hkey);
- msi_free( output );
- msi_free( advertise );
- msi_free( existing );
+ free( output );
+ free( advertise );
+ free( existing );
/* the UI chunk */
uirow = MSI_CreateRecord( 2 );
else
{
int len = lstrlenW(file->TargetPath) + lstrlenW(args) + 2;
- if (!(image_path = msi_alloc(len * sizeof(WCHAR))))
+ if (!(image_path = malloc(len * sizeof(WCHAR))))
{
ret = ERROR_OUTOFMEMORY;
goto done;
WARN( "failed to set service description %lu\n", GetLastError() );
}
- if (image_path != file->TargetPath) msi_free(image_path);
+ if (image_path != file->TargetPath) free(image_path);
done:
if (service) CloseServiceHandle(service);
if (hscm) CloseServiceHandle(hscm);
- msi_free(name);
- msi_free(disp);
- msi_free(sd.lpDescription);
- msi_free(load_order);
- msi_free(serv_name);
- msi_free(pass);
- msi_free(depends);
- msi_free(args);
+ free(name);
+ free(disp);
+ free(sd.lpDescription);
+ free(load_order);
+ free(serv_name);
+ free(pass);
+ free(depends);
+ free(args);
return ret;
}
}
/* converts arg1[~]arg2[~]arg3 to a list of ptrs to the strings */
-static LPCWSTR *msi_service_args_to_vector(LPWSTR args, DWORD *numargs)
+static const WCHAR **service_args_to_vector(WCHAR *args, DWORD *numargs)
{
LPCWSTR *vector, *temp_vector;
LPWSTR p, q;
if (!args)
return NULL;
- vector = msi_alloc(sizeof(LPWSTR));
+ vector = malloc(sizeof(WCHAR *));
if (!vector)
return NULL;
{
*q = '\0';
- temp_vector = msi_realloc(vector, (*numargs + 1) * sizeof(LPWSTR));
+ temp_vector = realloc(vector, (*numargs + 1) * sizeof(WCHAR *));
if (!temp_vector)
{
- msi_free(vector);
+ free(vector);
return NULL;
}
vector = temp_vector;
!(comp->Action == INSTALLSTATE_ABSENT && (event & msidbServiceControlEventUninstallStart)))
{
TRACE("not starting %s\n", debugstr_w(name));
- msi_free( name );
+ free(name);
return ERROR_SUCCESS;
}
if (!GetServiceDisplayNameW( scm, name, NULL, &len ) &&
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
- if ((display_name = msi_alloc( ++len * sizeof(WCHAR ))))
+ if ((display_name = malloc(++len * sizeof(WCHAR))))
GetServiceDisplayNameW( scm, name, display_name, &len );
}
goto done;
}
- vector = msi_service_args_to_vector(args, &numargs);
+ vector = service_args_to_vector(args, &numargs);
if (!StartServiceW(service, numargs, vector) &&
GetLastError() != ERROR_SERVICE_ALREADY_RUNNING)
if (service) CloseServiceHandle(service);
if (scm) CloseServiceHandle(scm);
- msi_free(name);
- msi_free(args);
- msi_free(vector);
- msi_free(display_name);
+ free(name);
+ free(args);
+ free(vector);
+ free(display_name);
return r;
}
if (GetLastError() != ERROR_MORE_DATA)
return FALSE;
- dependencies = msi_alloc(needed);
+ dependencies = malloc(needed);
if (!dependencies)
return FALSE;
ret = TRUE;
done:
- msi_free(dependencies);
+ free(dependencies);
return ret;
}
!(comp->Action == INSTALLSTATE_ABSENT && (event & msidbServiceControlEventUninstallStop)))
{
TRACE("not stopping %s\n", debugstr_w(name));
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
if (!GetServiceDisplayNameW( scm, name, NULL, &len ) &&
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
- if ((display_name = msi_alloc( ++len * sizeof(WCHAR ))))
+ if ((display_name = malloc( ++len * sizeof(WCHAR ))))
GetServiceDisplayNameW( scm, name, display_name, &len );
}
CloseServiceHandle( scm );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( name );
- msi_free( display_name );
+ free( name );
+ free( display_name );
return ERROR_SUCCESS;
}
!(comp->Action == INSTALLSTATE_ABSENT && (event & msidbServiceControlEventUninstallDelete)))
{
TRACE("service %s not scheduled for removal\n", debugstr_w(name));
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
stop_service( name );
if (!GetServiceDisplayNameW( scm, name, NULL, &len ) &&
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
- if ((display_name = msi_alloc( ++len * sizeof(WCHAR ))))
+ if ((display_name = malloc( ++len * sizeof(WCHAR ))))
GetServiceDisplayNameW( scm, name, display_name, &len );
}
if (service) CloseServiceHandle( service );
if (scm) CloseServiceHandle( scm );
- msi_free( name );
- msi_free( display_name );
+ free( name );
+ free( display_name );
return ERROR_SUCCESS;
}
len += lstrlenW(L"Setup=%s") + lstrlenW(setup_file->FileName);
len += lstrlenW(L"FileUsage=1") + 2; /* \0\0 */
- driver = msi_alloc(len * sizeof(WCHAR));
+ driver = malloc(len * sizeof(WCHAR));
if (!driver)
return ERROR_OUTOFMEMORY;
const WCHAR *dir = msi_get_target_folder( package, driver_file->Component->Directory );
driver_file->TargetPath = msi_build_directory_name( 2, dir, driver_file->FileName );
}
- driver_path = strdupW(driver_file->TargetPath);
+ driver_path = wcsdup(driver_file->TargetPath);
ptr = wcsrchr(driver_path, '\\');
if (ptr) *ptr = '\0';
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(driver);
- msi_free(driver_path);
+ free(driver);
+ free(driver_path);
return r;
}
if (setup_file)
len += lstrlenW(L"Setup=%s") + lstrlenW(setup_file->FileName);
- translator = msi_alloc(len * sizeof(WCHAR));
+ translator = malloc(len * sizeof(WCHAR));
if (!translator)
return ERROR_OUTOFMEMORY;
}
*ptr = '\0';
- translator_path = strdupW(translator_file->TargetPath);
+ translator_path = wcsdup(translator_file->TargetPath);
ptr = wcsrchr(translator_path, '\\');
if (ptr) *ptr = '\0';
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(translator);
- msi_free(translator_path);
+ free(translator);
+ free(translator_path);
return r;
}
else if (registration == msidbODBCDataSourceRegistrationPerUser) request = ODBC_ADD_DSN;
len = lstrlenW(L"DSN=%s") + lstrlenW(desc) + 2; /* \0\0 */
- attrs = msi_alloc(len * sizeof(WCHAR));
+ attrs = malloc(len * sizeof(WCHAR));
if (!attrs)
return ERROR_OUTOFMEMORY;
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(attrs);
+ free(attrs);
return r;
}
else if (registration == msidbODBCDataSourceRegistrationPerUser) request = ODBC_REMOVE_DSN;
len = lstrlenW( L"DSN=%s" ) + lstrlenW( desc ) + 2; /* \0\0 */
- attrs = msi_alloc( len * sizeof(WCHAR) );
+ attrs = malloc( len * sizeof(WCHAR) );
if (!attrs)
return ERROR_OUTOFMEMORY;
{
WARN("Failed to remove ODBC data source\n");
}
- msi_free( attrs );
+ free( attrs );
uirow = MSI_CreateRecord( 3 );
MSI_RecordSetStringW( uirow, 1, desc );
goto done;
}
size = (lstrlenW(value) + 1) * sizeof(WCHAR);
- newval = strdupW(value);
+ newval = wcsdup(value);
if (!newval)
{
res = ERROR_OUTOFMEMORY;
goto done;
}
- if (!(p = q = data = msi_alloc( size )))
+ if (!(p = q = data = malloc( size )))
{
- msi_free(deformatted);
+ free(deformatted);
RegCloseKey(env);
return ERROR_OUTOFMEMORY;
}
}
size = (len_value + 1 + lstrlenW( data ) + 1) * sizeof(WCHAR);
- if (!(p = newval = msi_alloc( size )))
+ if (!(p = newval = malloc( size )))
{
res = ERROR_OUTOFMEMORY;
goto done;
msiobj_release( &uirow->hdr );
if (env) RegCloseKey(env);
- msi_free(deformatted);
- msi_free(data);
- msi_free(newval);
+ free(deformatted);
+ free(data);
+ free(newval);
return res;
}
if (res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ))
goto done;
- if (!(new_value = msi_alloc( size ))) goto done;
+ if (!(new_value = malloc( size ))) goto done;
res = RegQueryValueExW( env, name, NULL, &type, (BYTE *)new_value, &size );
if (res != ERROR_SUCCESS)
msiobj_release( &uirow->hdr );
if (env) RegCloseKey( env );
- msi_free( deformatted );
- msi_free( new_value );
+ free( deformatted );
+ free( new_value );
return r;
}
id = msi_dup_property( package->db, L"ProductID" );
if (id)
{
- msi_free( id );
+ free( id );
return ERROR_SUCCESS;
}
template = msi_dup_property( package->db, L"PIDTemplate" );
r = msi_set_property( package->db, L"ProductID", key, -1 );
#endif
}
- msi_free( template );
- msi_free( key );
+ free( template );
+ free( key );
return r;
}
else
len += ARRAY_SIZE( L"ALL" );
- if (!(cmd = msi_alloc( len * sizeof(WCHAR) )))
+ if (!(cmd = malloc( len * sizeof(WCHAR) )))
{
- msi_free( product );
- msi_free( features );
+ free( product );
+ free( features );
return ERROR_OUTOFMEMORY;
}
swprintf( cmd, len, L"msiexec /qn /i %s REMOVE=%s", product, features ? features : L"ALL" );
- msi_free( product );
- msi_free( features );
+ free( product );
+ free( features );
memset( &si, 0, sizeof(STARTUPINFOW) );
ret = CreateProcessW( NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &info );
- msi_free( cmd );
+ free( cmd );
if (!ret) return GetLastError();
CloseHandle( info.hThread );
return ERROR_SUCCESS;
}
-static BOOL msi_bind_image( MSIPACKAGE *package, const char *filename, const char *path )
+static void bind_image( MSIPACKAGE *package, const char *filename, const char *path )
{
- BOOL ret;
msi_disable_fs_redirection( package );
- ret = BindImage( filename, path, NULL );
+ if (!BindImage( filename, path, NULL )) WARN( "failed to bind image %lu\n", GetLastError() );
msi_revert_fs_redirection( package );
- return ret;
-}
-
-static void bind_image( MSIPACKAGE *package, const char *filename, const char *path )
-{
- if (!msi_bind_image( package, filename, path ))
- {
- WARN( "failed to bind image %lu\n", GetLastError() );
- }
}
static UINT ITERATE_BindImage( MSIRECORD *rec, LPVOID param )
if ((pathA = strdupWtoA( pathW )))
{
bind_image( package, filenameA, pathA );
- msi_free( pathA );
+ free( pathA );
}
- msi_free( pathW );
+ free( pathW );
}
}
- msi_free( path_list );
- msi_free( filenameA );
+ free( path_list );
+ free( filenameA );
return ERROR_SUCCESS;
}
return ERROR_SUCCESS;
}
-static UINT msi_unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, LPCWSTR table )
+static UINT unimplemented_action_stub( MSIPACKAGE *package, LPCSTR action, LPCWSTR table )
{
MSIQUERY *view;
DWORD count = 0;
static UINT ACTION_IsolateComponents( MSIPACKAGE *package )
{
- return msi_unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" );
+ return unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" );
}
static UINT ACTION_RMCCPSearch( MSIPACKAGE *package )
{
- return msi_unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" );
+ return unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" );
}
static UINT ACTION_RegisterComPlus( MSIPACKAGE *package )
{
- return msi_unimplemented_action_stub( package, "RegisterComPlus", L"Complus" );
+ return unimplemented_action_stub( package, "RegisterComPlus", L"Complus" );
}
static UINT ACTION_UnregisterComPlus( MSIPACKAGE *package )
{
- return msi_unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" );
+ return unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" );
}
static UINT ACTION_InstallSFPCatalogFile( MSIPACKAGE *package )
{
- return msi_unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" );
+ return unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" );
}
static const struct
LPWSTR p, dir;
LPCWSTR file;
- dir = strdupW(szPackagePath);
+ dir = wcsdup(szPackagePath);
p = wcsrchr(dir, '\\');
if (p)
{
}
else
{
- msi_free(dir);
- dir = msi_alloc(MAX_PATH * sizeof(WCHAR));
+ free(dir);
+ dir = malloc(MAX_PATH * sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH, dir);
lstrcatW(dir, L"\\");
file = szPackagePath;
}
- msi_free( package->PackagePath );
- package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(file) + 1) * sizeof(WCHAR));
+ free(package->PackagePath);
+ package->PackagePath = malloc((wcslen(dir) + wcslen(file) + 1) * sizeof(WCHAR));
if (!package->PackagePath)
{
- msi_free(dir);
+ free(dir);
return ERROR_OUTOFMEMORY;
}
lstrcpyW(package->PackagePath, dir);
lstrcatW(package->PackagePath, file);
- msi_free(dir);
+ free(dir);
msi_set_sourcedir_props(package, FALSE);
}
if (wcsicmp( productcode, package->ProductCode ))
{
TRACE( "product code changed %s -> %s\n", debugstr_w(package->ProductCode), debugstr_w(productcode) );
- msi_free( package->ProductCode );
+ free( package->ProductCode );
package->ProductCode = productcode;
}
- else msi_free( productcode );
+ else free( productcode );
if (msi_get_property_int( package->db, L"DISABLEROLLBACK", 0 ))
{
WARN("installation failed, running rollback script\n");
execute_script( package, SCRIPT_ROLLBACK );
}
- msi_free( reinstall );
- msi_free( action );
+ free( reinstall );
+ free( action );
if (rc == ERROR_SUCCESS && package->need_reboot_at_end)
return ERROR_SUCCESS_REBOOT_REQUIRED;
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagMSIALTERVIEW
+struct alter_view
{
MSIVIEW view;
MSIDATABASE *db;
MSIVIEW *table;
column_info *colinfo;
INT hold;
-} MSIALTERVIEW;
+};
static UINT ALTER_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %d %p\n", av, row, col, val );
static UINT ALTER_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %d %p\n", av, row, col, stm );
static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
UINT ref;
TRACE("%p %p\n", av, record);
static UINT ALTER_close( struct tagMSIVIEW *view )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av );
static UINT ALTER_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p %p %p\n", av, rows, cols );
static UINT ALTER_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %p %p %p %p\n", av, n, name, type, temporary, table_name );
static UINT ALTER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p %d %p\n", av, eModifyMode, rec );
static UINT ALTER_delete( struct tagMSIVIEW *view )
{
- MSIALTERVIEW *av = (MSIALTERVIEW*)view;
+ struct alter_view *av = (struct alter_view *)view;
TRACE("%p\n", av );
if (av->table)
av->table->ops->delete( av->table );
- msi_free( av );
+ free( av );
return ERROR_SUCCESS;
}
UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold )
{
- MSIALTERVIEW *av;
+ struct alter_view *av;
UINT r;
TRACE("%p %p %s %d\n", view, colinfo, debugstr_w(name), hold );
- av = msi_alloc_zero( sizeof *av );
+ av = calloc( 1, sizeof *av );
if( !av )
return ERROR_FUNCTION_FAILED;
r = TABLE_CreateView( db, name, &av->table );
if (r != ERROR_SUCCESS)
{
- msi_free( av );
+ free( av );
return r;
}
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-typedef struct tagMSISIGNATURE
+struct signature
{
LPCWSTR Name; /* NOT owned by this structure */
LPWSTR File;
FILETIME MinTime;
FILETIME MaxTime;
LPWSTR Languages;
-}MSISIGNATURE;
+};
void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
{
* Returns ERROR_SUCCESS upon success (where not finding the record counts as
* success), something else on error.
*/
-static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *name )
+static UINT get_signature( MSIPACKAGE *package, struct signature *sig, const WCHAR *name )
{
WCHAR *minVersion, *maxVersion, *p;
MSIRECORD *row;
if (minVersion)
{
msi_parse_version_string( minVersion, &sig->MinVersionMS, &sig->MinVersionLS );
- msi_free( minVersion );
+ free( minVersion );
}
maxVersion = msi_dup_record_field(row,4);
if (maxVersion)
{
msi_parse_version_string( maxVersion, &sig->MaxVersionMS, &sig->MaxVersionLS );
- msi_free( maxVersion );
+ free( maxVersion );
}
sig->MinSize = MSI_RecordGetInteger(row,5);
if (sig->MinSize == MSI_NULL_INTEGER)
}
/* Frees any memory allocated in sig */
-static void free_signature( MSISIGNATURE *sig )
+static void free_signature( struct signature *sig )
{
- msi_free(sig->File);
- msi_free(sig->Languages);
+ free(sig->File);
+ free(sig->Languages);
}
-static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig )
+static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, struct signature *sig )
{
VS_FIXEDFILEINFO *info;
DWORD attr;
attr = msi_get_file_attributes( package, path );
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
- return strdupW(path);
+ return wcsdup(path);
return NULL;
}
size = msi_get_file_version_info( package, path, 0, NULL );
if (!size)
- return strdupW(path);
+ return wcsdup(path);
- buffer = msi_alloc(size);
+ buffer = malloc(size);
if (!buffer)
return NULL;
goto done;
}
- val = strdupW(path);
+ val = wcsdup(path);
done:
- msi_free(buffer);
+ free(buffer);
return val;
}
-static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
+static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{
MSIRECORD *row, *rec;
LPCWSTR signature, guid;
else
PathAddBackslashW(path);
- *appValue = strdupW(path);
+ *appValue = wcsdup(path);
}
else if (sigpresent)
{
attr = msi_get_file_attributes( package, path );
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
- *appValue = strdupW(path);
+ *appValue = wcsdup(path);
}
done:
if (*(LPCWSTR)value == '#')
{
/* escape leading pound with another */
- *appValue = msi_alloc(sz + sizeof(WCHAR));
+ *appValue = malloc(sz + sizeof(WCHAR));
(*appValue)[0] = '#';
lstrcpyW(*appValue + 1, (LPCWSTR)value);
}
else
{
- *appValue = msi_alloc(sz);
+ *appValue = malloc(sz);
lstrcpyW(*appValue, (LPCWSTR)value);
}
break;
/* 7 chars for digits, 1 for NULL, 1 for #, and 1 for sign
* char if needed
*/
- *appValue = msi_alloc(10 * sizeof(WCHAR));
+ *appValue = malloc(10 * sizeof(WCHAR));
swprintf(*appValue, 10, L"#%d", *(const DWORD *)value);
break;
case REG_EXPAND_SZ:
sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0);
- *appValue = msi_alloc(sz * sizeof(WCHAR));
+ *appValue = malloc(sz * sizeof(WCHAR));
ExpandEnvironmentStringsW((LPCWSTR)value, *appValue, sz);
break;
case REG_BINARY:
/* #x<nibbles>\0 */
- *appValue = msi_alloc((sz * 2 + 3) * sizeof(WCHAR));
+ *appValue = malloc((sz * 2 + 3) * sizeof(WCHAR));
lstrcpyW(*appValue, L"#x");
ptr = *appValue + lstrlenW(L"#x");
for (i = 0; i < sz; i++, ptr += 2)
}
}
-static UINT search_directory( MSIPACKAGE *, MSISIGNATURE *, const WCHAR *, int, WCHAR ** );
+static UINT search_directory( MSIPACKAGE *, struct signature *, const WCHAR *, int, WCHAR ** );
-static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
+static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{
const WCHAR *keyPath, *valueName;
WCHAR *deformatted = NULL, *ptr = NULL, *end;
goto end;
}
- msi_free(deformatted);
+ free(deformatted);
deformat_string(package, valueName, &deformatted);
rc = RegQueryValueExW(key, deformatted, NULL, NULL, NULL, &sz);
/* FIXME: sanity-check sz before allocating (is there an upper-limit
* on the value of a property?)
*/
- value = msi_alloc( sz );
+ value = malloc(sz);
rc = RegQueryValueExW(key, deformatted, NULL, ®Type, value, &sz);
if (rc)
{
sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0);
if (sz)
{
- LPWSTR buf = msi_alloc(sz * sizeof(WCHAR));
+ WCHAR *buf = malloc(sz * sizeof(WCHAR));
ExpandEnvironmentStringsW((LPCWSTR)value, buf, sz);
- msi_free(value);
+ free(value);
value = (LPBYTE)buf;
}
}
type, debugstr_w(keyPath), debugstr_w(valueName));
}
end:
- msi_free( value );
+ free( value );
RegCloseKey( key );
- msi_free( deformatted );
+ free( deformatted );
msiobj_release(&row->hdr);
return ERROR_SUCCESS;
int i = 1;
if (field == 0)
- return strdupW(buf);
+ return wcsdup(buf);
beg = buf;
while ((end = wcschr(beg, ',')) && i < field)
end = beg + lstrlenW(beg);
*end = '\0';
- return strdupW(beg);
+ return wcsdup(beg);
}
-static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
+static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{
MSIRECORD *row;
LPWSTR fileName, section, key;
}
}
- msi_free(fileName);
- msi_free(section);
- msi_free(key);
+ free(fileName);
+ free(section);
+ free(key);
msiobj_release(&row->hdr);
deformat_string(package, ptr, &deformatted);
if (!deformatted || lstrlenW(deformatted) > len - 1)
{
- msi_free(deformatted);
+ free(deformatted);
return;
}
lstrcpyW(dst, deformatted);
dst[lstrlenW(deformatted)] = '\0';
- msi_free(deformatted);
+ free(deformatted);
}
static LANGID *parse_languages( const WCHAR *languages, DWORD *num_ids )
{
UINT i, count = 1;
- WCHAR *str = strdupW( languages ), *p, *q;
+ WCHAR *str = wcsdup( languages ), *p, *q;
LANGID *ret;
if (!str) return NULL;
for (p = q = str; (q = wcschr( q, ',' )); q++) count++;
- if (!(ret = msi_alloc( count * sizeof(LANGID) )))
+ if (!(ret = malloc( count * sizeof(LANGID) )))
{
- msi_free( str );
+ free( str );
return NULL;
}
i = 0;
p = q + 1;
i++;
}
- msi_free( str );
+ free( str );
*num_ids = count;
return ret;
}
}
done:
- msi_free( ids );
+ free( ids );
return found;
}
* Return ERROR_SUCCESS in case of success (whether or not the file matches),
* something else if an install-halting error occurs.
*/
-static UINT file_version_matches( MSIPACKAGE *package, const MSISIGNATURE *sig, const WCHAR *filePath,
+static UINT file_version_matches( MSIPACKAGE *package, const struct signature *sig, const WCHAR *filePath,
BOOL *matches )
{
UINT len;
*matches = FALSE;
if (!size) return ERROR_SUCCESS;
- if (!(version = msi_alloc( size ))) return ERROR_OUTOFMEMORY;
+ if (!(version = malloc( size ))) return ERROR_OUTOFMEMORY;
if (msi_get_file_version_info( package, filePath, size, version ))
VerQueryValueW( version, L"\\", (void **)&info, &len );
}
else *matches = TRUE;
}
- msi_free( version );
+ free( version );
return ERROR_SUCCESS;
}
* Return ERROR_SUCCESS in case of success (whether or not the file matches),
* something else if an install-halting error occurs.
*/
-static UINT file_matches_sig( MSIPACKAGE *package, const MSISIGNATURE *sig, const WIN32_FIND_DATAW *findData,
+static UINT file_matches_sig( MSIPACKAGE *package, const struct signature *sig, const WIN32_FIND_DATAW *findData,
const WCHAR *fullFilePath, BOOL *matches )
{
UINT rc = ERROR_SUCCESS;
* Returns ERROR_SUCCESS on success (which may include non-critical errors),
* something else on failures which should halt the install.
*/
-static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig, const WCHAR *dir,
+static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig, const WCHAR *dir,
int depth )
{
HANDLE hFind;
* isn't backslash-terminated.
*/
len = dirLen + max(fileLen, lstrlenW(L"*.*")) + 2;
- buf = msi_alloc(len * sizeof(WCHAR));
+ buf = malloc(len * sizeof(WCHAR));
if (!buf)
return ERROR_OUTOFMEMORY;
}
if (*appValue != buf)
- msi_free(buf);
+ free(buf);
return rc;
}
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
{
TRACE("directory exists, returning %s\n", debugstr_w(dir));
- *appValue = strdupW(dir);
+ *appValue = wcsdup(dir);
}
return ERROR_SUCCESS;
return ret;
}
-static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *path, int depth, WCHAR **appValue )
+static UINT search_directory( MSIPACKAGE *package, struct signature *sig, const WCHAR *path, int depth, WCHAR **appValue )
{
UINT rc;
DWORD attr;
- LPWSTR val = NULL;
+ WCHAR *val = NULL, *new_val;
TRACE("%p, %p, %s, %d, %p\n", package, sig, debugstr_w(path), depth, appValue);
if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) &&
val && val[lstrlenW(val) - 1] != '\\')
{
- val = msi_realloc(val, (lstrlenW(val) + 2) * sizeof(WCHAR));
- if (!val)
+ new_val = realloc(val, (wcslen(val) + 2) * sizeof(WCHAR));
+ if (!new_val)
+ {
+ free(val);
+ val = NULL;
rc = ERROR_OUTOFMEMORY;
+ }
else
+ {
+ val = new_val;
PathAddBackslashW(val);
+ }
}
*appValue = val;
return rc;
}
-static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, MSISIGNATURE *, WCHAR ** );
+static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, struct signature *, WCHAR ** );
-static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
+static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig )
{
LPWSTR parent = NULL;
LPCWSTR parentName;
parentName = MSI_RecordGetString(row, 2);
if (parentName)
{
- MSISIGNATURE parentSig;
+ struct signature parentSig;
search_sig_name( package, parentName, &parentSig, &parent );
free_signature( &parentSig );
rc = search_directory( package, sig, path, depth, appValue );
- msi_free(parent);
+ free(parent);
msiobj_release(&row->hdr);
TRACE("returning %d\n", rc);
return rc;
}
-static UINT search_sig_name( MSIPACKAGE *package, const WCHAR *sigName, MSISIGNATURE *sig, WCHAR **appValue )
+static UINT search_sig_name( MSIPACKAGE *package, const WCHAR *sigName, struct signature *sig, WCHAR **appValue )
{
UINT rc;
MSIPACKAGE *package = param;
LPCWSTR propName, sigName;
LPWSTR value = NULL;
- MSISIGNATURE sig;
+ struct signature sig;
MSIRECORD *uirow;
UINT r;
if (r == ERROR_SUCCESS && !wcscmp( propName, L"SourceDir" ))
msi_reset_source_folders( package );
- msi_free(value);
+ free(value);
}
free_signature( &sig );
MSIPACKAGE *package = param;
LPCWSTR signature;
LPWSTR value = NULL;
- MSISIGNATURE sig;
+ struct signature sig;
UINT r = ERROR_SUCCESS;
signature = MSI_RecordGetString(row, 1);
{
TRACE("Found signature %s\n", debugstr_w(signature));
msi_set_property( package->db, L"CCP_Success", L"1", -1 );
- msi_free(value);
+ free(value);
r = ERROR_NO_MORE_ITEMS;
}
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-static BOOL load_fusion_dlls( MSIPACKAGE *package )
+static void load_fusion_dlls( MSIPACKAGE *package )
{
HRESULT (WINAPI *pLoadLibraryShim)( const WCHAR *, const WCHAR *, void *, HMODULE * );
WCHAR path[MAX_PATH];
DWORD len = GetSystemDirectoryW( path, MAX_PATH );
lstrcpyW( path + len, L"\\mscoree.dll" );
- if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE;
+ if (!package->hmscoree && !(package->hmscoree = LoadLibraryW( path ))) return;
if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" )))
{
FreeLibrary( package->hmscoree );
package->hmscoree = NULL;
- return TRUE;
+ return;
}
- pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 );
- pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 );
- pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 );
- pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 );
-
- return TRUE;
+ if (!package->hfusion10) pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 );
+ if (!package->hfusion11) pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 );
+ if (!package->hfusion20) pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 );
+ if (!package->hfusion40) pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 );
}
-BOOL msi_init_assembly_caches( MSIPACKAGE *package )
+static BOOL init_assembly_caches( MSIPACKAGE *package )
{
HRESULT (WINAPI *pCreateAssemblyCache)( IAssemblyCache **, DWORD );
- if (package->cache_sxs) return TRUE;
- if (CreateAssemblyCache( &package->cache_sxs, 0 ) != S_OK) return FALSE;
+ if (!package->cache_sxs && CreateAssemblyCache( &package->cache_sxs, 0 ) != S_OK) return FALSE;
- if (!load_fusion_dlls( package )) return FALSE;
+ load_fusion_dlls( package );
package->pGetFileVersion = (void *)GetProcAddress( package->hmscoree, "GetFileVersion" ); /* missing from v1.0.3705 */
- if (package->hfusion10)
+ if (package->hfusion10 && !package->cache_net[CLR_VERSION_V10])
{
pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion10, "CreateAssemblyCache" );
pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V10], 0 );
}
- if (package->hfusion11)
+ if (package->hfusion11 && !package->cache_net[CLR_VERSION_V11])
{
pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion11, "CreateAssemblyCache" );
pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V11], 0 );
}
- if (package->hfusion20)
+ if (package->hfusion20 && !package->cache_net[CLR_VERSION_V20])
{
pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion20, "CreateAssemblyCache" );
pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V20], 0 );
}
- if (package->hfusion40)
+ if (package->hfusion40 && !package->cache_net[CLR_VERSION_V40])
{
pCreateAssemblyCache = (void *)GetProcAddress( package->hfusion40, "CreateAssemblyCache" );
pCreateAssemblyCache( &package->cache_net[CLR_VERSION_V40], 0 );
const WCHAR *value = MSI_RecordGetString( rec, 3 );
int len = lstrlenW( L"%s=\"%s\"" ) + lstrlenW( attr ) + lstrlenW( value );
- if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) )))
+ if (!(name->attrs[name->index] = malloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY;
if (!wcsicmp( attr, L"name" )) lstrcpyW( name->attrs[name->index++], value );
MSI_IterateRecords( view, &name.count, NULL, NULL );
if (!name.count) goto done;
- name.attrs = msi_alloc( name.count * sizeof(WCHAR *) );
+ name.attrs = malloc( name.count * sizeof(WCHAR *) );
if (!name.attrs) goto done;
MSI_IterateRecords( view, NULL, get_assembly_name_attribute, &name );
len = 0;
for (i = 0; i < name.count; i++) len += lstrlenW( name.attrs[i] ) + 1;
- display_name = msi_alloc( (len + 1) * sizeof(WCHAR) );
+ display_name = malloc( (len + 1) * sizeof(WCHAR) );
if (display_name)
{
display_name[0] = 0;
msiobj_release( &view->hdr );
if (name.attrs)
{
- for (i = 0; i < name.count; i++) msi_free( name.attrs[i] );
- msi_free( name.attrs );
+ for (i = 0; i < name.count; i++) free( name.attrs[i] );
+ free( name.attrs );
}
return display_name;
}
-static BOOL is_assembly_installed( IAssemblyCache *cache, const WCHAR *display_name )
-{
- HRESULT hr;
- ASSEMBLY_INFO info;
-
- if (!cache) return FALSE;
-
- memset( &info, 0, sizeof(info) );
- info.cbAssemblyInfo = sizeof(info);
- hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, display_name, &info );
- if (hr == S_OK /* sxs version */ || hr == E_NOT_SUFFICIENT_BUFFER)
- {
- return (info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED);
- }
- TRACE( "QueryAssemblyInfo returned %#lx\n", hr );
- return FALSE;
-}
-
WCHAR *msi_get_assembly_path( MSIPACKAGE *package, const WCHAR *displayname )
{
HRESULT hr;
ASSEMBLY_INFO info;
- IAssemblyCache *cache = package->cache_net[CLR_VERSION_V40];
+ IAssemblyCache *cache;
- if (!cache) return NULL;
+ if (!init_assembly_caches( package ) || !(cache = package->cache_net[CLR_VERSION_V40])) return NULL;
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
if (hr != E_NOT_SUFFICIENT_BUFFER) return NULL;
- if (!(info.pszCurrentAssemblyPathBuf = msi_alloc( info.cchBuf * sizeof(WCHAR) ))) return NULL;
+ if (!(info.pszCurrentAssemblyPathBuf = malloc( info.cchBuf * sizeof(WCHAR) ))) return NULL;
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
if (FAILED( hr ))
{
- msi_free( info.pszCurrentAssemblyPathBuf );
+ free( info.pszCurrentAssemblyPathBuf );
return NULL;
}
TRACE("returning %s\n", debugstr_w(info.pszCurrentAssemblyPathBuf));
WCHAR *str;
DWORD len = 0;
- if (!package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum) return NULL;
+ if (!init_assembly_caches( package ) || !package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum)
+ return NULL;
hr = package->pCreateAssemblyNameObject( &name, displayname, CANOF_PARSE_DISPLAY_NAME, NULL );
if (FAILED( hr )) return NULL;
hr = IAssemblyName_GetName( name, &len, NULL );
- if (hr != E_NOT_SUFFICIENT_BUFFER || !(str = msi_alloc( len * sizeof(WCHAR) )))
+ if (hr != E_NOT_SUFFICIENT_BUFFER || !(str = malloc( len * sizeof(WCHAR) )))
{
IAssemblyName_Release( name );
return NULL;
IAssemblyName_Release( name );
if (FAILED( hr ))
{
- msi_free( str );
+ free( str );
return NULL;
}
hr = package->pCreateAssemblyNameObject( &name, str, 0, NULL );
- msi_free( str );
+ free( str );
if (FAILED( hr )) return NULL;
hr = package->pCreateAssemblyEnum( &ret, NULL, name, ASM_CACHE_GAC, NULL );
L"v4.0.30319"
};
-static const WCHAR *get_clr_version_str( enum clr_version version )
-{
- if (version >= ARRAY_SIZE( clr_version )) return L"unknown";
- return clr_version[version];
-}
-
-/* assembly caches must be initialized */
MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp )
{
MSIRECORD *rec;
MSIASSEMBLY *a;
if (!(rec = get_assembly_record( package, comp->Component ))) return NULL;
- if (!(a = msi_alloc_zero( sizeof(MSIASSEMBLY) )))
+ if (!(a = calloc( 1, sizeof(MSIASSEMBLY) )))
{
msiobj_release( &rec->hdr );
return NULL;
}
- a->feature = strdupW( MSI_RecordGetString( rec, 2 ) );
+ a->feature = wcsdup( MSI_RecordGetString( rec, 2 ) );
TRACE("feature %s\n", debugstr_w(a->feature));
- a->manifest = strdupW( MSI_RecordGetString( rec, 3 ) );
+ a->manifest = wcsdup( MSI_RecordGetString( rec, 3 ) );
TRACE("manifest %s\n", debugstr_w(a->manifest));
- a->application = strdupW( MSI_RecordGetString( rec, 4 ) );
+ a->application = wcsdup( MSI_RecordGetString( rec, 4 ) );
TRACE("application %s\n", debugstr_w(a->application));
a->attributes = MSI_RecordGetInteger( rec, 5 );
{
WARN("can't get display name\n");
msiobj_release( &rec->hdr );
- msi_free( a->feature );
- msi_free( a->manifest );
- msi_free( a->application );
- msi_free( a );
+ free( a->feature );
+ free( a->manifest );
+ free( a->application );
+ free( a );
return NULL;
}
TRACE("display name %s\n", debugstr_w(a->display_name));
- if (a->application)
- {
- /* We can't check the manifest here because the target path may still change.
- So we assume that the assembly is not installed and lean on the InstallFiles
- action to determine which files need to be installed.
- */
- a->installed = FALSE;
- }
- else
- {
- if (a->attributes == msidbAssemblyAttributesWin32)
- a->installed = is_assembly_installed( package->cache_sxs, a->display_name );
- else
- {
- UINT i;
- for (i = 0; i < CLR_VERSION_MAX; i++)
- {
- a->clr_version[i] = is_assembly_installed( package->cache_net[i], a->display_name );
- if (a->clr_version[i])
- {
- TRACE("runtime version %s\n", debugstr_w(get_clr_version_str( i )));
- a->installed = TRUE;
- break;
- }
- }
- }
- }
- TRACE("assembly is %s\n", a->installed ? "installed" : "not installed");
msiobj_release( &rec->hdr );
return a;
}
hr = package->pGetFileVersion( filename, NULL, 0, &len );
if (hr != E_NOT_SUFFICIENT_BUFFER) return CLR_VERSION_V11;
- if ((strW = msi_alloc( len * sizeof(WCHAR) )))
+ if ((strW = malloc( len * sizeof(WCHAR) )))
{
hr = package->pGetFileVersion( filename, strW, len, &len );
if (hr == S_OK)
for (i = 0; i < CLR_VERSION_MAX; i++)
if (!wcscmp( strW, clr_version[i] )) version = i;
}
- msi_free( strW );
+ free( strW );
}
return version;
}
MSIASSEMBLY *assembly = comp->assembly;
MSIFEATURE *feature = NULL;
+ if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
+
if (comp->assembly->feature)
feature = msi_get_loaded_feature( package, comp->assembly->feature );
return ERROR_FUNCTION_FAILED;
}
if (feature) feature->Action = INSTALLSTATE_LOCAL;
- assembly->installed = TRUE;
return ERROR_SUCCESS;
}
MSIASSEMBLY *assembly = comp->assembly;
MSIFEATURE *feature = NULL;
+ if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
+
if (comp->assembly->feature)
feature = msi_get_loaded_feature( package, comp->assembly->feature );
}
}
if (feature) feature->Action = INSTALLSTATE_ABSENT;
- assembly->installed = FALSE;
return ERROR_SUCCESS;
}
UINT i;
WCHAR *ret;
- if (!(ret = msi_alloc( (lstrlenW( filename ) + 1) * sizeof(WCHAR) )))
+ if (!(ret = malloc( (wcslen( filename ) + 1) * sizeof(WCHAR) )))
return NULL;
for (i = 0; filename[i]; i++)
if ((res = open_assemblies_key( context, win32, &root )))
{
- msi_free( path );
+ free( path );
return res;
}
res = RegCreateKeyW( root, path, hkey );
RegCloseKey( root );
- msi_free( path );
+ free( path );
return res;
}
if ((res = open_assemblies_key( context, win32, &root )))
{
- msi_free( path );
+ free( path );
return res;
}
res = RegDeleteKeyW( root, path );
RegCloseKey( root );
- msi_free( path );
+ free( path );
return res;
}
#define REG_INDEX_CLASSES_ROOT 0
#define REG_INDEX_DYN_DATA 6
-typedef struct AutomationObject AutomationObject;
+struct automation_object;
-/* function that is called from AutomationObject::Invoke, specific to this type of object */
-typedef HRESULT (*auto_invoke_func)(AutomationObject* This,
- DISPID dispIdMember, REFIID riid, LCID lcid, WORD flags, DISPPARAMS* pDispParams,
- VARIANT* result, EXCEPINFO* ei, UINT* arg_err);
-/* function that is called from AutomationObject::Release when the object is being freed
- to free any private data structures (or NULL) */
-typedef void (*auto_free_func)(AutomationObject* This);
-
-typedef struct {
+struct tid_id
+{
REFIID riid;
- auto_invoke_func fn_invoke;
- auto_free_func fn_free;
-} tid_id_t;
-
+ /* function that is called from AutomationObject::Invoke, specific to this type of object */
+ HRESULT (*fn_invoke)(struct automation_object *, DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *,
+ EXCEPINFO *, UINT *);
+ /* function that is called from AutomationObject::Release when the object is being freed
+ to free any private data structures (or NULL) */
+ void (*fn_free)(struct automation_object *);
+};
-static HRESULT database_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static HRESULT installer_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static HRESULT record_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static HRESULT session_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static HRESULT list_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static void list_free(AutomationObject*);
-static HRESULT summaryinfo_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static HRESULT view_invoke(AutomationObject*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT database_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT installer_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT record_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT session_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT list_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static void list_free(struct automation_object*);
+static HRESULT summaryinfo_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
+static HRESULT view_invoke(struct automation_object*,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
-static tid_id_t tid_ids[] = {
+static struct tid_id tid_ids[] =
+{
{ &DIID_Database, database_invoke },
{ &DIID_Installer, installer_invoke },
{ &DIID_Record, record_invoke },
}
/*
- * AutomationObject - "base" class for all automation objects. For each interface, we implement Invoke function
- * called from AutomationObject::Invoke.
+ * struct automation_object - "base" class for all automation objects. For each interface, we implement Invoke
+ * function called from AutomationObject::Invoke.
*/
-struct AutomationObject {
+struct automation_object
+{
IDispatch IDispatch_iface;
IProvideMultipleClassInfo IProvideMultipleClassInfo_iface;
LONG ref;
MSIHANDLE msiHandle;
};
-typedef struct {
- AutomationObject autoobj;
+struct list_object
+{
+ struct automation_object autoobj;
int count;
VARIANT *data;
-} ListObject;
+};
static HRESULT create_database(MSIHANDLE, IDispatch**);
-static HRESULT create_list_enumerator(ListObject*, void**);
+static HRESULT create_list_enumerator(struct list_object *, void **);
static HRESULT create_summaryinfo(MSIHANDLE, IDispatch**);
static HRESULT create_view(MSIHANDLE, IDispatch**);
-/* ListEnumerator - IEnumVARIANT implementation for MSI automation lists */
-typedef struct {
+/* struct list_enumerator - IEnumVARIANT implementation for MSI automation lists */
+struct list_enumerator
+{
IEnumVARIANT IEnumVARIANT_iface;
LONG ref;
- /* Current position and pointer to AutomationObject that stores actual data */
+ /* Current position and pointer to struct automation_object that stores actual data */
ULONG pos;
- ListObject *list;
-} ListEnumerator;
+ struct list_object *list;
+};
-typedef struct {
- AutomationObject autoobj;
+struct session_object
+{
+ struct automation_object autoobj;
IDispatch *installer;
-} SessionObject;
+};
-static inline AutomationObject *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface )
+static inline struct automation_object *impl_from_IProvideMultipleClassInfo( IProvideMultipleClassInfo *iface )
{
- return CONTAINING_RECORD(iface, AutomationObject, IProvideMultipleClassInfo_iface);
+ return CONTAINING_RECORD(iface, struct automation_object, IProvideMultipleClassInfo_iface);
}
-static inline AutomationObject *impl_from_IDispatch( IDispatch *iface )
+static inline struct automation_object *impl_from_IDispatch( IDispatch *iface )
{
- return CONTAINING_RECORD(iface, AutomationObject, IDispatch_iface);
+ return CONTAINING_RECORD(iface, struct automation_object, IDispatch_iface);
}
/* AutomationObject methods */
static HRESULT WINAPI AutomationObject_QueryInterface(IDispatch* iface, REFIID riid, void** ppvObject)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
static ULONG WINAPI AutomationObject_AddRef(IDispatch* iface)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)\n", iface, This);
static ULONG WINAPI AutomationObject_Release(IDispatch* iface)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)\n", iface, This);
{
if (tid_ids[This->tid].fn_free) tid_ids[This->tid].fn_free(This);
MsiCloseHandle(This->msiHandle);
- msi_free(This);
+ free(This);
}
return ref;
IDispatch* iface,
UINT* pctinfo)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, pctinfo);
*pctinfo = 1;
LCID lcid,
ITypeInfo** ppTInfo)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
HRESULT hr;
TRACE( "(%p/%p)->(%u, %ld, %p)\n", iface, This, iTInfo, lcid, ppTInfo );
LCID lcid,
DISPID* rgDispId)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
ITypeInfo *ti;
HRESULT hr;
EXCEPINFO* pExcepInfo,
UINT* puArgErr)
{
- AutomationObject *This = impl_from_IDispatch(iface);
+ struct automation_object *This = impl_from_IDispatch(iface);
HRESULT hr;
unsigned int uArgErr;
VARIANT varResultDummy;
REFIID riid,
VOID** ppvoid)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
return IDispatch_QueryInterface(&This->IDispatch_iface, riid, ppvoid);
}
static ULONG WINAPI ProvideMultipleClassInfo_AddRef(IProvideMultipleClassInfo* iface)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
return IDispatch_AddRef(&This->IDispatch_iface);
}
static ULONG WINAPI ProvideMultipleClassInfo_Release(IProvideMultipleClassInfo* iface)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
return IDispatch_Release(&This->IDispatch_iface);
}
static HRESULT WINAPI ProvideMultipleClassInfo_GetClassInfo(IProvideMultipleClassInfo* iface, ITypeInfo** ppTI)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, ppTI);
static HRESULT WINAPI ProvideMultipleClassInfo_GetGUID(IProvideMultipleClassInfo* iface, DWORD dwGuidKind, GUID* pGUID)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
TRACE("(%p/%p)->(%lu, %s)\n", iface, This, dwGuidKind, debugstr_guid(pGUID));
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo* iface, ULONG* pcti)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, pcti);
*pcti = 1;
IID* piidPrimary,
IID* piidSource)
{
- AutomationObject *This = impl_from_IProvideMultipleClassInfo(iface);
+ struct automation_object *This = impl_from_IProvideMultipleClassInfo(iface);
TRACE("(%p/%p)->(%lu, %#lx, %p, %p, %p, %p, %p)\n", iface, This, iti, dwFlags, ti, pdwTIFlags, pcdispidReserved,
piidPrimary, piidSource);
ProvideMultipleClassInfo_GetInfoOfIndex
};
-static void init_automation_object(AutomationObject *This, MSIHANDLE msiHandle, tid_t tid)
+static void init_automation_object(struct automation_object *This, MSIHANDLE msiHandle, tid_t tid)
{
TRACE("%p, %lu, %s\n", This, msiHandle, debugstr_guid(get_riid_from_tid(tid)));
* ListEnumerator methods
*/
-static inline ListEnumerator *impl_from_IEnumVARIANT(IEnumVARIANT* iface)
+static inline struct list_enumerator *impl_from_IEnumVARIANT(IEnumVARIANT* iface)
{
- return CONTAINING_RECORD(iface, ListEnumerator, IEnumVARIANT_iface);
+ return CONTAINING_RECORD(iface, struct list_enumerator, IEnumVARIANT_iface);
}
static HRESULT WINAPI ListEnumerator_QueryInterface(IEnumVARIANT* iface, REFIID riid,
void** ppvObject)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
static ULONG WINAPI ListEnumerator_AddRef(IEnumVARIANT* iface)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p/%p)\n", iface, This);
static ULONG WINAPI ListEnumerator_Release(IEnumVARIANT* iface)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)\n", iface, This);
if (!ref)
{
if (This->list) IDispatch_Release(&This->list->autoobj.IDispatch_iface);
- msi_free(This);
+ free(This);
}
return ref;
static HRESULT WINAPI ListEnumerator_Next(IEnumVARIANT* iface, ULONG celt, VARIANT* rgVar,
ULONG* fetched)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
ULONG i, local;
TRACE("%p, %lu, %p, %p\n", iface, celt, rgVar, fetched);
static HRESULT WINAPI ListEnumerator_Skip(IEnumVARIANT* iface, ULONG celt)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("%p, %lu\n", iface, celt);
static HRESULT WINAPI ListEnumerator_Reset(IEnumVARIANT* iface)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
TRACE("(%p)\n", iface);
static HRESULT WINAPI ListEnumerator_Clone(IEnumVARIANT* iface, IEnumVARIANT **ppEnum)
{
- ListEnumerator *This = impl_from_IEnumVARIANT(iface);
+ struct list_enumerator *This = impl_from_IEnumVARIANT(iface);
HRESULT hr;
TRACE("(%p,%p)\n", iface, ppEnum);
};
/* Create a list enumerator, placing the result in the pointer ppObj. */
-static HRESULT create_list_enumerator(ListObject *list, void **ppObj)
+static HRESULT create_list_enumerator(struct list_object *list, void **ppObj)
{
- ListEnumerator *object;
+ struct list_enumerator *object;
TRACE("(%p, %p)\n", list, ppObj);
- object = msi_alloc(sizeof(ListEnumerator));
+ object = malloc(sizeof(*object));
/* Set all the VTable references */
object->IEnumVARIANT_iface.lpVtbl = &ListEnumerator_Vtbl;
}
static HRESULT summaryinfo_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
break;
case VT_LPSTR:
- if (!(str = msi_alloc(++size * sizeof(WCHAR))))
+ if (!(str = malloc(++size * sizeof(WCHAR))))
ERR("Out of memory\n");
else if ((ret = MsiSummaryInfoGetPropertyW(This->msiHandle, V_I4(&varg0), &type, NULL,
NULL, str, &size)) != ERROR_SUCCESS)
V_VT(pVarResult) = VT_BSTR;
V_BSTR(pVarResult) = SysAllocString(str);
}
- msi_free(str);
+ free(str);
break;
case VT_FILETIME:
}
static HRESULT record_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
V_BSTR(pVarResult) = NULL;
if ((ret = MsiRecordGetStringW(This->msiHandle, V_I4(&varg0), NULL, &dwLen)) == ERROR_SUCCESS)
{
- if (!(szString = msi_alloc((++dwLen)*sizeof(WCHAR))))
+ if (!(szString = malloc((++dwLen) * sizeof(WCHAR))))
ERR("Out of memory\n");
else if ((ret = MsiRecordGetStringW(This->msiHandle, V_I4(&varg0), szString, &dwLen)) == ERROR_SUCCESS)
V_BSTR(pVarResult) = SysAllocString(szString);
- msi_free(szString);
+ free(szString);
}
if (ret != ERROR_SUCCESS)
ERR("MsiRecordGetString returned %d\n", ret);
static HRESULT create_record(MSIHANDLE msiHandle, IDispatch **disp)
{
- AutomationObject *record;
+ struct automation_object *record;
- record = msi_alloc(sizeof(*record));
+ record = malloc(sizeof(*record));
if (!record) return E_OUTOFMEMORY;
init_automation_object(record, msiHandle, Record_tid);
}
static HRESULT list_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
EXCEPINFO* pExcepInfo,
UINT* puArgErr)
{
- ListObject *list = CONTAINING_RECORD(This, ListObject, autoobj);
+ struct list_object *list = CONTAINING_RECORD(This, struct list_object, autoobj);
IUnknown *pUnk = NULL;
HRESULT hr;
return S_OK;
}
-static void list_free(AutomationObject *This)
+static void list_free(struct automation_object *This)
{
- ListObject *list = CONTAINING_RECORD(This, ListObject, autoobj);
+ struct list_object *list = CONTAINING_RECORD(This, struct list_object, autoobj);
int i;
for (i = 0; i < list->count; i++)
VariantClear(&list->data[i]);
- msi_free(list->data);
+ free(list->data);
}
static HRESULT get_products_count(const WCHAR *product, int *len)
static HRESULT create_list(const WCHAR *product, IDispatch **dispatch)
{
- ListObject *list;
+ struct list_object *list;
HRESULT hr;
int i;
- list = msi_alloc_zero(sizeof(ListObject));
+ list = calloc(1, sizeof(*list));
if (!list) return E_OUTOFMEMORY;
init_automation_object(&list->autoobj, 0, StringList_tid);
return hr;
}
- list->data = msi_alloc(list->count*sizeof(VARIANT));
+ list->data = malloc(list->count * sizeof(VARIANT));
if (!list->data)
{
IDispatch_Release(*dispatch);
}
static HRESULT view_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
{
hr = DispGetParam(pDispParams, 0, VT_DISPATCH, &varg0, puArgErr);
if (SUCCEEDED(hr) && V_DISPATCH(&varg0) != NULL)
- MsiViewExecute(This->msiHandle, ((AutomationObject *)V_DISPATCH(&varg0))->msiHandle);
+ MsiViewExecute(This->msiHandle, ((struct automation_object *)V_DISPATCH(&varg0))->msiHandle);
else
MsiViewExecute(This->msiHandle, 0);
}
hr = DispGetParam(pDispParams, 1, VT_DISPATCH, &varg1, puArgErr);
if (FAILED(hr)) return hr;
if (!V_DISPATCH(&varg1)) return DISP_E_EXCEPTION;
- if ((ret = MsiViewModify(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle)) != ERROR_SUCCESS)
+ if ((ret = MsiViewModify(This->msiHandle, V_I4(&varg0),
+ ((struct automation_object *)V_DISPATCH(&varg1))->msiHandle)) != ERROR_SUCCESS)
{
VariantClear(&varg1);
ERR("MsiViewModify returned %d\n", ret);
}
HRESULT database_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
}
static HRESULT session_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
EXCEPINFO* pExcepInfo,
UINT* puArgErr)
{
- SessionObject *session = CONTAINING_RECORD(This, SessionObject, autoobj);
+ struct session_object *session = CONTAINING_RECORD(This, struct session_object, autoobj);
WCHAR *szString;
DWORD dwLen = 0;
MSIHANDLE msiHandle;
V_BSTR(pVarResult) = NULL;
if ((ret = MsiGetPropertyW(This->msiHandle, V_BSTR(&varg0), NULL, &dwLen)) == ERROR_SUCCESS)
{
- if (!(szString = msi_alloc((++dwLen)*sizeof(WCHAR))))
+ if (!(szString = malloc((++dwLen) * sizeof(WCHAR))))
ERR("Out of memory\n");
else if ((ret = MsiGetPropertyW(This->msiHandle, V_BSTR(&varg0), szString, &dwLen)) == ERROR_SUCCESS)
V_BSTR(pVarResult) = SysAllocString(szString);
- msi_free(szString);
+ free(szString);
}
if (ret != ERROR_SUCCESS)
ERR("MsiGetProperty returned %d\n", ret);
V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) =
- MsiProcessMessage(This->msiHandle, V_I4(&varg0), ((AutomationObject *)V_DISPATCH(&varg1))->msiHandle);
+ MsiProcessMessage(This->msiHandle, V_I4(&varg0), ((struct automation_object *)V_DISPATCH(&varg1))->msiHandle);
break;
case DISPID_SESSION_SETINSTALLLEVEL:
case REG_EXPAND_SZ:
if (!(dwNewSize = ExpandEnvironmentStringsW(szString, szNewString, dwNewSize)))
ERR("ExpandEnvironmentStrings returned error %lu\n", GetLastError());
- else if (!(szNewString = msi_alloc(dwNewSize * sizeof(WCHAR))))
+ else if (!(szNewString = malloc(dwNewSize * sizeof(WCHAR))))
ERR("Out of memory\n");
else if (!(dwNewSize = ExpandEnvironmentStringsW(szString, szNewString, dwNewSize)))
ERR("ExpandEnvironmentStrings returned error %lu\n", GetLastError());
V_VT(pVarResult) = VT_BSTR;
V_BSTR(pVarResult) = SysAllocStringLen(szNewString, dwNewSize);
}
- msi_free(szNewString);
+ free(szNewString);
break;
case REG_DWORD:
return create_record(hrec, &V_DISPATCH(pVarResult));
}
-static HRESULT InstallerImpl_OpenPackage(AutomationObject* This,
+static HRESULT InstallerImpl_OpenPackage(struct automation_object *This,
WORD wFlags,
DISPPARAMS* pDispParams,
VARIANT* pVarResult,
goto done;
}
- szString = msi_alloc(size);
+ szString = malloc(size);
if (!szString)
{
hr = E_OUTOFMEMORY;
&type, (LPBYTE)szString, &size);
if (ret != ERROR_SUCCESS)
{
- msi_free(szString);
+ free(szString);
hr = DISP_E_BADINDEX;
goto done;
}
variant_from_registry_value(pVarResult, type,
(LPBYTE)szString, size);
- msi_free(szString);
+ free(szString);
break;
/* Try to make it into VT_I4, can use VariantChangeType for this. */
if (ret != ERROR_SUCCESS)
goto done;
- szString = msi_alloc(++size * sizeof(WCHAR));
+ szString = malloc(++size * sizeof(WCHAR));
if (!szString)
{
hr = E_OUTOFMEMORY;
V_BSTR(pVarResult) = SysAllocString(szString);
}
- msi_free(szString);
+ free(szString);
}
done:
goto done;
}
- str = msi_alloc(++size * sizeof(WCHAR));
+ str = malloc(++size * sizeof(WCHAR));
if (!str)
{
hr = E_OUTOFMEMORY;
hr = S_OK;
done:
- msi_free(str);
+ free(str);
VariantClear(&varg0);
VariantClear(&varg1);
return hr;
}
static HRESULT installer_invoke(
- AutomationObject* This,
+ struct automation_object *This,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
HRESULT create_msiserver(IUnknown *outer, void **ppObj)
{
- AutomationObject *installer;
+ struct automation_object *installer;
TRACE("(%p %p)\n", outer, ppObj);
if (outer)
return CLASS_E_NOAGGREGATION;
- installer = msi_alloc(sizeof(AutomationObject));
+ installer = malloc(sizeof(*installer));
if (!installer) return E_OUTOFMEMORY;
init_automation_object(installer, 0, Installer_tid);
HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp)
{
- SessionObject *session;
+ struct session_object *session;
- session = msi_alloc(sizeof(SessionObject));
+ session = malloc(sizeof(*session));
if (!session) return E_OUTOFMEMORY;
init_automation_object(&session->autoobj, msiHandle, Session_tid);
static HRESULT create_database(MSIHANDLE msiHandle, IDispatch **dispatch)
{
- AutomationObject *database;
+ struct automation_object *database;
TRACE("%lu %p\n", msiHandle, dispatch);
- database = msi_alloc(sizeof(AutomationObject));
+ database = malloc(sizeof(*database));
if (!database) return E_OUTOFMEMORY;
init_automation_object(database, msiHandle, Database_tid);
static HRESULT create_view(MSIHANDLE msiHandle, IDispatch **dispatch)
{
- AutomationObject *view;
+ struct automation_object *view;
TRACE("%lu %p\n", msiHandle, dispatch);
- view = msi_alloc(sizeof(AutomationObject));
+ view = malloc(sizeof(*view));
if (!view) return E_OUTOFMEMORY;
init_automation_object(view, msiHandle, View_tid);
static HRESULT create_summaryinfo(MSIHANDLE msiHandle, IDispatch **disp)
{
- AutomationObject *info;
+ struct automation_object *info;
- info = msi_alloc(sizeof(*info));
+ info = malloc(sizeof(*info));
if (!info) return E_OUTOFMEMORY;
init_automation_object(info, msiHandle, SummaryInfo_tid);
/* fill in the data */
- appid = msi_alloc_zero( sizeof(MSIAPPID) );
+ appid = calloc( 1, sizeof(MSIAPPID) );
if (!appid)
return NULL;
/* fill in the data */
- progid = msi_alloc_zero( sizeof(MSIPROGID) );
+ progid = calloc( 1, sizeof(MSIPROGID) );
if (!progid)
return NULL;
FilePath = msi_build_icon_path(package, FileName);
- progid->IconPath = msi_alloc( (lstrlenW(FilePath) + 10) * sizeof(WCHAR) );
+ progid->IconPath = malloc( (wcslen(FilePath) + 10) * sizeof(WCHAR) );
swprintf( progid->IconPath, lstrlenW(FilePath) + 10, L"%s,%d", FilePath, icon_index );
- msi_free(FilePath);
+ free(FilePath);
}
else
{
/* fill in the data */
- cls = msi_alloc_zero( sizeof(MSICLASS) );
+ cls = calloc( 1, sizeof(MSICLASS) );
if (!cls)
return NULL;
FilePath = msi_build_icon_path(package, FileName);
- cls->IconPath = msi_alloc( (lstrlenW(FilePath) + 5) * sizeof(WCHAR) );
+ cls->IconPath = malloc( (wcslen(FilePath) + 5) * sizeof(WCHAR) );
swprintf( cls->IconPath, lstrlenW(FilePath) + 5, L"%s,%d", FilePath, icon_index );
- msi_free(FilePath);
+ free(FilePath);
}
else
{
switch(i)
{
case 1:
- cls->DefInprocHandler = strdupW(L"ole2.dll");
+ cls->DefInprocHandler = wcsdup(L"ole2.dll");
break;
case 2:
- cls->DefInprocHandler32 = strdupW(L"ole32.dll");
+ cls->DefInprocHandler32 = wcsdup(L"ole32.dll");
break;
case 3:
- cls->DefInprocHandler = strdupW(L"ole2.dll");
- cls->DefInprocHandler32 = strdupW(L"ole32.dll");
+ cls->DefInprocHandler = wcsdup(L"ole2.dll");
+ cls->DefInprocHandler32 = wcsdup(L"ole32.dll");
break;
}
}
/* fill in the data */
- mt = msi_alloc_zero( sizeof(MSIMIME) );
+ mt = calloc( 1, sizeof(MSIMIME) );
if (!mt)
return mt;
extension = MSI_RecordGetString( row, 2 );
mt->Extension = load_given_extension( package, extension );
- mt->suffix = strdupW( extension );
+ mt->suffix = wcsdup( extension );
mt->clsid = msi_dup_record_field( row, 3 );
mt->Class = load_given_class( package, mt->clsid );
/* fill in the data */
- ext = msi_alloc_zero( sizeof(MSIEXTENSION) );
+ ext = calloc( 1, sizeof(MSIEXTENSION) );
if (!ext)
return NULL;
/* fill in the data */
- verb = msi_alloc_zero( sizeof(MSIVERB) );
+ verb = calloc( 1, sizeof(MSIVERB) );
if (!verb)
return ERROR_OUTOFMEMORY;
if (cls->Argument)
size += lstrlenW(cls->Argument)+1;
- argument = msi_alloc( size * sizeof(WCHAR) );
+ argument = malloc( size * sizeof(WCHAR) );
lstrcpyW( argument, file->TargetPath );
if (cls->Argument)
}
msi_reg_set_val_str( hkey3, NULL, argument );
- msi_free(argument);
+ free(argument);
RegCloseKey(hkey3);
ptr2 = wcschr(ptr,';');
if (ptr2)
*ptr2 = 0;
- keyname = msi_alloc( (lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4) * sizeof(WCHAR));
+ keyname = malloc( sizeof(L"FileType\\%s\\%d") + (wcslen(cls->clsid) + 3) * sizeof(WCHAR) );
swprintf( keyname, lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4,
L"FileType\\%s\\%d", cls->clsid, index );
msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, keyname, NULL, ptr );
- msi_free(keyname);
+ free( keyname );
if (ptr2)
ptr = ptr2+1;
}
if (cls->FileTypeMask)
{
- filetype = msi_alloc( (lstrlenW( L"FileType\\" ) + lstrlenW( cls->clsid ) + 1) * sizeof(WCHAR) );
+ filetype = malloc( sizeof( L"FileType\\" ) + wcslen( cls->clsid ) * sizeof(WCHAR) );
if (filetype)
{
lstrcpyW( filetype, L"FileType\\" );
lstrcatW( filetype, cls->clsid );
res = RegDeleteTreeW( HKEY_CLASSES_ROOT, filetype );
- msi_free( filetype );
+ free( filetype );
if (res != ERROR_SUCCESS)
WARN("failed to delete file type %ld\n", res);
size += lstrlenW(verb->Argument);
size += 4;
- command = msi_alloc(size * sizeof (WCHAR));
+ command = malloc(size * sizeof(WCHAR));
if (verb->Argument)
swprintf(command, size, L"\"%s\" %s", component->FullKeypath, verb->Argument);
else
swprintf(command, size, L"\"%s\"", component->FullKeypath);
msi_reg_set_val_str( key, NULL, command );
- msi_free(command);
+ free(command);
advertise = msi_create_component_advertise_string(package, component,
extension->Feature->Feature);
size += lstrlenW(verb->Argument);
size += 4;
- command = msi_alloc_zero(size * sizeof (WCHAR));
+ command = calloc(size, sizeof(WCHAR));
lstrcpyW(command,advertise);
if (verb->Argument)
msi_reg_set_val_multi_str( key, L"command", command );
RegCloseKey(key);
- msi_free(keyname);
- msi_free(advertise);
- msi_free(command);
+ free(keyname);
+ free(advertise);
+ free(command);
if (verb->Command)
{
keyname = msi_build_directory_name( 3, progid, L"shell", verb->Verb );
msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, keyname, NULL, verb->Command );
- msi_free(keyname);
+ free(keyname);
}
if (verb->Sequence != MSI_NULL_INTEGER)
*Sequence = verb->Sequence;
keyname = msi_build_directory_name( 2, progid, L"shell" );
msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, keyname, NULL, verb->Verb );
- msi_free(keyname);
+ free(keyname);
}
}
return ERROR_SUCCESS;
ext->action = INSTALLSTATE_LOCAL;
- extension = msi_alloc( (lstrlenW( ext->Extension ) + 2) * sizeof(WCHAR) );
+ extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
if (extension)
{
extension[0] = '.';
lstrcpyW( extension + 1, ext->Extension );
res = RegCreateKeyW( HKEY_CLASSES_ROOT, extension, &hkey );
- msi_free( extension );
+ free( extension );
if (res != ERROR_SUCCESS)
WARN("failed to create extension key %ld\n", res);
}
msi_reg_set_val_str( hkey, NULL, progid );
- newkey = msi_alloc( (lstrlenW(progid) + lstrlenW(L"\\ShellNew") + 1) * sizeof(WCHAR));
+ newkey = malloc( wcslen(progid) * sizeof(WCHAR) + sizeof(L"\\ShellNew") );
lstrcpyW(newkey, progid);
lstrcatW(newkey, L"\\ShellNew");
RegCreateKeyW(hkey, newkey, &hkey2);
RegCloseKey(hkey2);
- msi_free(newkey);
+ free(newkey);
/* do all the verbs */
LIST_FOR_EACH_ENTRY( verb, &ext->verbs, MSIVERB, entry )
ext->action = INSTALLSTATE_ABSENT;
- extension = msi_alloc( (lstrlenW( ext->Extension ) + 2) * sizeof(WCHAR) );
+ extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
if (extension)
{
extension[0] = '.';
lstrcpyW( extension + 1, ext->Extension );
res = RegDeleteTreeW( HKEY_CLASSES_ROOT, extension );
- msi_free( extension );
+ free( extension );
if (res != ERROR_SUCCESS)
WARN("failed to delete extension key %ld\n", res);
}
else
progid = ext->ProgIDText;
- progid_shell = msi_alloc( (lstrlenW( progid ) + lstrlenW( L"\\shell" ) + 1) * sizeof(WCHAR) );
+ progid_shell = malloc( wcslen( progid ) * sizeof(WCHAR) + sizeof( L"\\shell" ) );
if (progid_shell)
{
lstrcpyW( progid_shell, progid );
lstrcatW( progid_shell, L"\\shell" );
res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell );
- msi_free( progid_shell );
+ free( progid_shell );
if (res != ERROR_SUCCESS)
WARN("failed to delete shell key %ld\n", res);
RegDeleteKeyW( HKEY_CLASSES_ROOT, progid );
TRACE("Registering MIME type %s\n", debugstr_w(mt->ContentType));
- if (mt->Extension) extension = msi_alloc( (lstrlenW( mt->Extension->Extension ) + 2) * sizeof(WCHAR) );
- key = msi_alloc( (lstrlenW( mt->ContentType ) +
- lstrlenW( L"MIME\\Database\\Content Type\\" ) + 1) * sizeof(WCHAR) );
+ if (mt->Extension) extension = malloc( (wcslen( mt->Extension->Extension ) + 2) * sizeof(WCHAR) );
+ key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
+ wcslen( mt->ContentType ) * sizeof(WCHAR) );
if (extension && key)
{
if (mt->clsid)
msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, L"CLSID", mt->clsid );
}
- msi_free( extension );
- msi_free( key );
+ free( extension );
+ free( key );
uirow = MSI_CreateRecord( 2 );
MSI_RecordSetStringW( uirow, 1, mt->ContentType );
TRACE("Unregistering MIME type %s\n", debugstr_w(mime->ContentType));
- mime_key = msi_alloc( (lstrlenW( L"MIME\\Database\\Content Type\\" ) +
- lstrlenW( mime->ContentType ) + 1) * sizeof(WCHAR) );
+ mime_key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
+ wcslen( mime->ContentType ) * sizeof(WCHAR) );
if (mime_key)
{
lstrcpyW( mime_key, L"MIME\\Database\\Content Type\\" );
res = RegDeleteKeyW( HKEY_CLASSES_ROOT, mime_key );
if (res != ERROR_SUCCESS)
WARN("failed to delete MIME key %ld\n", res);
- msi_free( mime_key );
+ free( mime_key );
}
uirow = MSI_CreateRecord( 2 );
static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub )
{
LPWSTR strlower, sublower, r;
- strlower = CharLowerW( strdupW( str ) );
- sublower = CharLowerW( strdupW( sub ) );
+ strlower = CharLowerW( wcsdup( str ) );
+ sublower = CharLowerW( wcsdup( sub ) );
r = wcsstr( strlower, sublower );
if (r)
r = (LPWSTR)str + (r - strlower);
- msi_free( strlower );
- msi_free( sublower );
+ free( strlower );
+ free( sublower );
return r;
}
{
struct list *mem;
- mem = msi_alloc( sizeof (struct list) + sz );
+ mem = malloc( sizeof (struct list) + sz );
if( !mem )
return NULL;
new_ptr = cond_alloc( cond, sz );
if( !new_ptr )
{
- msi_free( ptr );
+ free( ptr );
return NULL;
}
memcpy( new_ptr, ptr, sz );
- msi_free( ptr );
+ free( ptr );
return new_ptr;
}
if( ptr )
{
list_remove( mem );
- msi_free( mem );
+ free( mem );
}
}
return MSICONDITION_ERROR;
r = MsiEvaluateConditionW( hInstall, szwCond );
- msi_free( szwCond );
+ free( szwCond );
return r;
}
/* below is the query interface to a table */
-typedef struct tagMSICREATEVIEW
+struct create_view
{
MSIVIEW view;
MSIDATABASE *db;
BOOL bIsTemp;
BOOL hold;
column_info *col_info;
-} MSICREATEVIEW;
+};
static UINT CREATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %d %p\n", cv, row, col, val );
static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
BOOL persist = (cv->bIsTemp) ? MSICONDITION_FALSE : MSICONDITION_TRUE;
TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name),
static UINT CREATE_close( struct tagMSIVIEW *view )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv);
static UINT CREATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p %p %p\n", cv, rows, cols );
static UINT CREATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %p %p %p %p\n", cv, n, name, type, temporary, table_name );
static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row)
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p %d %p\n", cv, eModifyMode, rec );
static UINT CREATE_delete( struct tagMSIVIEW *view )
{
- MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
+ struct create_view *cv = (struct create_view *)view;
TRACE("%p\n", cv );
msiobj_release( &cv->db->hdr );
- msi_free( cv );
+ free( cv );
return ERROR_SUCCESS;
}
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
column_info *col_info, BOOL hold )
{
- MSICREATEVIEW *cv = NULL;
+ struct create_view *cv = NULL;
UINT r;
column_info *col;
BOOL temp = TRUE;
if( r != ERROR_SUCCESS )
return r;
- cv = msi_alloc_zero( sizeof *cv );
+ cv = calloc( 1, sizeof *cv );
if( !cv )
return ERROR_FUNCTION_FAILED;
if ( !temp && tempprim )
{
- msi_free( cv );
+ free( cv );
return ERROR_FUNCTION_FAILED;
}
#define CUSTOM_ACTION_TYPE_MASK 0x3F
-typedef struct tagMSIRUNNINGACTION
+struct running_action
{
struct list entry;
HANDLE handle;
BOOL process;
LPWSTR name;
-} MSIRUNNINGACTION;
+};
typedef UINT (WINAPI *MsiCustomActionEntryPoint)( MSIHANDLE );
-static CRITICAL_SECTION msi_custom_action_cs;
-static CRITICAL_SECTION_DEBUG msi_custom_action_cs_debug =
+static CRITICAL_SECTION custom_action_cs;
+static CRITICAL_SECTION_DEBUG custom_action_cs_debug =
{
- 0, 0, &msi_custom_action_cs,
- { &msi_custom_action_cs_debug.ProcessLocksList,
- &msi_custom_action_cs_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": msi_custom_action_cs") }
+ 0, 0, &custom_action_cs,
+ { &custom_action_cs_debug.ProcessLocksList,
+ &custom_action_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": custom_action_cs") }
};
-static CRITICAL_SECTION msi_custom_action_cs = { &msi_custom_action_cs_debug, -1, 0, 0, 0, 0 };
+static CRITICAL_SECTION custom_action_cs = { &custom_action_cs_debug, -1, 0, 0, 0, 0 };
-static struct list msi_pending_custom_actions = LIST_INIT( msi_pending_custom_actions );
+static struct list pending_custom_actions = LIST_INIT( pending_custom_actions );
void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len)
{
count = package->script_actions_count[script];
package->script_actions_count[script]++;
- if (count != 0) newbuf = msi_realloc( package->script_actions[script],
- package->script_actions_count[script] * sizeof(WCHAR *) );
- else newbuf = msi_alloc( sizeof(WCHAR *) );
+ if (count != 0) newbuf = realloc( package->script_actions[script],
+ package->script_actions_count[script] * sizeof(WCHAR *) );
+ else newbuf = malloc( sizeof(WCHAR *) );
- newbuf[count] = strdupW( action );
+ newbuf[count] = wcsdup( action );
package->script_actions[script] = newbuf;
return ERROR_SUCCESS;
}
count = package->unique_actions_count;
package->unique_actions_count++;
- if (count != 0) newbuf = msi_realloc( package->unique_actions,
- package->unique_actions_count * sizeof(WCHAR *) );
- else newbuf = msi_alloc( sizeof(WCHAR *) );
+ if (count != 0) newbuf = realloc( package->unique_actions,
+ package->unique_actions_count * sizeof(WCHAR *) );
+ else newbuf = malloc( sizeof(WCHAR *) );
- newbuf[count] = strdupW( action );
+ newbuf[count] = wcsdup( action );
package->unique_actions = newbuf;
return ERROR_SUCCESS;
}
*
* [CustomActionData<=>UserSID<=>ProductCode]Action
*/
-static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
- LPCWSTR usersid, LPCWSTR prodcode)
+static WCHAR *get_deferred_action(const WCHAR *action, const WCHAR *actiondata, const WCHAR *usersid,
+ const WCHAR *prodcode)
{
LPWSTR deferred;
DWORD len;
if (!actiondata)
- return strdupW(action);
+ return wcsdup(action);
len = lstrlenW(action) + lstrlenW(actiondata) +
lstrlenW(usersid) + lstrlenW(prodcode) +
lstrlenW(L"[%s<=>%s<=>%s]%s") - 7;
- deferred = msi_alloc(len * sizeof(WCHAR));
+ deferred = malloc(len * sizeof(WCHAR));
swprintf(deferred, len, L"[%s<=>%s<=>%s]%s", actiondata, usersid, prodcode, action);
return deferred;
{
GetTempPathW( MAX_PATH, tmp );
}
- if (!(db->tempfolder = strdupW( tmp ))) return NULL;
+ if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
}
- if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
+ if ((ret = malloc( (wcslen( db->tempfolder ) + 20) * sizeof(WCHAR) )))
{
if (!GetTempFileNameW( db->tempfolder, L"msi", 0, ret ))
{
- msi_free( ret );
+ free( ret );
return NULL;
}
}
if (!(tmpfile = msi_create_temp_file( package->db ))) return NULL;
if (!(row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", source ))) goto error;
- if (!(binary = msi_alloc_zero( sizeof(MSIBINARY) ))) goto error;
+ if (!(binary = calloc( 1, sizeof(MSIBINARY) ))) goto error;
file = CreateFileW( tmpfile, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
if (file == INVALID_HANDLE_VALUE) goto error;
CloseHandle( file );
if (r != ERROR_SUCCESS) goto error;
- binary->source = strdupW( source );
+ binary->source = wcsdup( source );
binary->tmpfile = tmpfile;
list_add_tail( &package->binaries, &binary->entry );
error:
if (row) msiobj_release( &row->hdr );
DeleteFileW( tmpfile );
- msi_free( tmpfile );
- msi_free( binary );
+ free( tmpfile );
+ free( binary );
return NULL;
}
static void file_running_action(MSIPACKAGE* package, HANDLE Handle,
BOOL process, LPCWSTR name)
{
- MSIRUNNINGACTION *action;
+ struct running_action *action;
- action = msi_alloc( sizeof(MSIRUNNINGACTION) );
+ action = malloc( sizeof(*action) );
action->handle = Handle;
action->process = process;
- action->name = strdupW(name);
+ action->name = wcsdup(name);
list_add_tail( &package->RunningActions, &action->entry );
}
return rc;
}
-typedef struct _msi_custom_action_info {
+typedef struct
+{
struct list entry;
MSIPACKAGE *package;
LPWSTR source;
INT type;
GUID guid;
DWORD arch;
-} msi_custom_action_info;
+} custom_action_info;
-static void free_custom_action_data( msi_custom_action_info *info )
+static void free_custom_action_data( custom_action_info *info )
{
- EnterCriticalSection( &msi_custom_action_cs );
+ EnterCriticalSection( &custom_action_cs );
list_remove( &info->entry );
if (info->handle)
CloseHandle( info->handle );
- msi_free( info->action );
- msi_free( info->source );
- msi_free( info->target );
+ free( info->action );
+ free( info->source );
+ free( info->target );
msiobj_release( &info->package->hdr );
- msi_free( info );
+ free( info );
- LeaveCriticalSection( &msi_custom_action_cs );
+ LeaveCriticalSection( &custom_action_cs );
}
-static UINT wait_thread_handle( msi_custom_action_info *info )
+static UINT wait_thread_handle( custom_action_info *info )
{
UINT rc = ERROR_SUCCESS;
return rc;
}
-static msi_custom_action_info *find_action_by_guid( const GUID *guid )
+static custom_action_info *find_action_by_guid( const GUID *guid )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
BOOL found = FALSE;
- EnterCriticalSection( &msi_custom_action_cs );
+ EnterCriticalSection( &custom_action_cs );
- LIST_FOR_EACH_ENTRY( info, &msi_pending_custom_actions, msi_custom_action_info, entry )
+ LIST_FOR_EACH_ENTRY( info, &pending_custom_actions, custom_action_info, entry )
{
if (IsEqualGUID( &info->guid, guid ))
{
}
}
- LeaveCriticalSection( &msi_custom_action_cs );
+ LeaveCriticalSection( &custom_action_cs );
if (!found)
return NULL;
static DWORD WINAPI custom_client_thread(void *arg)
{
- msi_custom_action_info *info = arg;
+ custom_action_info *info = arg;
DWORD64 thread64;
HANDLE process;
HANDLE thread;
pipe = info->package->custom_server_64_pipe;
}
- EnterCriticalSection(&msi_custom_action_cs);
+ EnterCriticalSection(&custom_action_cs);
if (!WriteFile(pipe, &info->guid, sizeof(info->guid), &size, NULL) ||
size != sizeof(info->guid))
{
ERR("failed to write to custom action client pipe: %lu\n", GetLastError());
- LeaveCriticalSection(&msi_custom_action_cs);
+ LeaveCriticalSection(&custom_action_cs);
return GetLastError();
}
if (!ReadFile(pipe, &thread64, sizeof(thread64), &size, NULL) || size != sizeof(thread64))
{
ERR("failed to read from custom action client pipe: %lu\n", GetLastError());
- LeaveCriticalSection(&msi_custom_action_cs);
+ LeaveCriticalSection(&custom_action_cs);
return GetLastError();
}
- LeaveCriticalSection(&msi_custom_action_cs);
+ LeaveCriticalSection(&custom_action_cs);
if (DuplicateHandle(process, (HANDLE)(DWORD_PTR)thread64, GetCurrentProcess(),
&thread, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
}
}
-static msi_custom_action_info *do_msidbCustomActionTypeDll(
+static custom_action_info *do_msidbCustomActionTypeDll(
MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
RPC_STATUS status;
BOOL ret;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return NULL;
msiobj_addref( &package->hdr );
info->package = package;
info->type = type;
- info->target = strdupW( target );
- info->source = strdupW( source );
- info->action = strdupW( action );
+ info->target = wcsdup( target );
+ info->source = wcsdup( source );
+ info->action = wcsdup( action );
CoCreateGuid( &info->guid );
- EnterCriticalSection( &msi_custom_action_cs );
- list_add_tail( &msi_pending_custom_actions, &info->entry );
- LeaveCriticalSection( &msi_custom_action_cs );
+ EnterCriticalSection( &custom_action_cs );
+ list_add_tail( &pending_custom_actions, &info->entry );
+ LeaveCriticalSection( &custom_action_cs );
if (!package->rpc_server_started)
{
static UINT HANDLE_CustomType1( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
MSIBINARY *binary;
if (!(binary = get_temp_binary(package, source)))
int len_arg = 0;
DWORD len_exe;
- if (!(exe = msi_alloc( MAX_PATH * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
+ if (!(exe = malloc( MAX_PATH * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
len_exe = SearchPathW( NULL, app, L".exe", MAX_PATH, exe, NULL );
if (len_exe >= MAX_PATH)
{
- msi_free( exe );
- if (!(exe = msi_alloc( len_exe * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
+ free( exe );
+ if (!(exe = malloc( len_exe * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
len_exe = SearchPathW( NULL, app, L".exe", len_exe, exe, NULL );
}
if (!len_exe)
{
ERR("can't find executable %lu\n", GetLastError());
- msi_free( exe );
+ free( exe );
return INVALID_HANDLE_VALUE;
}
if (arg) len_arg = lstrlenW( arg );
- if (!(cmd = msi_alloc( (len_exe + len_arg + 4) * sizeof(WCHAR) )))
+ if (!(cmd = malloc( (len_exe + len_arg + 4) * sizeof(WCHAR) )))
{
- msi_free( exe );
+ free( exe );
return INVALID_HANDLE_VALUE;
}
p = cmd;
}
memset( &si, 0, sizeof(STARTUPINFOW) );
ret = CreateProcessW( exe, exe ? cmd : arg, NULL, NULL, FALSE, 0, NULL, dir, &si, &info );
- msi_free( cmd );
- msi_free( exe );
+ free( cmd );
+ free( exe );
if (!ret)
{
ERR("unable to execute command %lu\n", GetLastError());
TRACE("exe %s arg %s\n", debugstr_w(binary->tmpfile), debugstr_w(arg));
handle = execute_command( binary->tmpfile, arg, L"C:\\" );
- msi_free( arg );
+ free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
}
static UINT HANDLE_CustomType17( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
MSIFILE *file;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
TRACE("exe %s arg %s\n", debugstr_w(file->TargetPath), debugstr_w(arg));
handle = execute_command( file->TargetPath, arg, L"C:\\" );
- msi_free( arg );
+ free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
}
else if ((package->ui_level & INSTALLUILEVEL_MASK) != INSTALLUILEVEL_NONE)
MessageBoxW( NULL, deformated, NULL, MB_OK );
- msi_free( deformated );
+ free( deformated );
return ERROR_INSTALL_FAILURE;
}
UINT len = ARRAY_SIZE(L"/qb /i ") - 1;
WCHAR *ret;
- if (!(ret = msi_alloc( (len + len_filename + len_params + 4) * sizeof(WCHAR) ))) return NULL;
+ if (!(ret = malloc( (len + len_filename + len_params + 4) * sizeof(WCHAR) ))) return NULL;
memcpy( ret, L"/qb /i ", sizeof(L"/qb /i ") );
ret[len++] = '"';
memcpy( ret + len, filename, len_filename * sizeof(WCHAR) );
if (!(dir = msi_dup_property( package->db, L"OriginalDatabase" ))) return ERROR_OUTOFMEMORY;
if (!(p = wcsrchr( dir, '\\' )) && !(p = wcsrchr( dir, '/' )))
{
- msi_free( dir );
+ free( dir );
return ERROR_FUNCTION_FAILED;
}
*p = 0;
len_dir = p - dir;
- if (!(filename = msi_alloc( (len_dir + len_source + 2) * sizeof(WCHAR) )))
+ if (!(filename = malloc( (len_dir + len_source + 2) * sizeof(WCHAR) )))
{
- msi_free( dir );
+ free( dir );
return ERROR_OUTOFMEMORY;
}
memcpy( filename, dir, len_dir * sizeof(WCHAR) );
if (!(args = build_msiexec_args( filename, target )))
{
- msi_free( dir );
+ free( dir );
+ free( filename );
return ERROR_OUTOFMEMORY;
}
TRACE("installing %s concurrently\n", debugstr_w(source));
handle = execute_command( L"msiexec", args, dir );
- msi_free( dir );
- msi_free( args );
+ free( dir );
+ free( filename );
+ free( args );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
}
if (r != ERROR_SUCCESS)
goto error;
- if (!(binary = msi_alloc( sizeof(*binary) ))) goto error;
+ if (!(binary = malloc( sizeof(*binary) ))) goto error;
binary->source = NULL;
binary->tmpfile = tmpfile;
list_add_tail( &package->binaries, &binary->entry );
TRACE("installing %s concurrently\n", debugstr_w(source));
handle = execute_command( L"msiexec", args, L"C:\\" );
- msi_free( args );
+ free( args );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
error:
DeleteFileW( tmpfile );
- msi_free( tmpfile );
+ free( tmpfile );
return ERROR_FUNCTION_FAILED;
}
TRACE("exe %s arg %s\n", debugstr_w(exe), debugstr_w(arg));
handle = execute_command( exe, arg, L"C:\\" );
- msi_free( exe );
- msi_free( arg );
+ free( exe );
+ free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
}
TRACE("cmd %s dir %s\n", debugstr_w(cmd), debugstr_w(workingdir));
handle = execute_command( NULL, cmd, workingdir );
- msi_free( cmd );
+ free( cmd );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
}
static DWORD ACTION_CallScript( const GUID *guid )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
MSIHANDLE hPackage;
UINT r = ERROR_FUNCTION_FAILED;
return rc;
}
-static msi_custom_action_info *do_msidbCustomActionTypeScript(
+static custom_action_info *do_msidbCustomActionTypeScript(
MSIPACKAGE *package, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return NULL;
msiobj_addref( &package->hdr );
info->package = package;
info->type = type;
- info->target = strdupW( function );
- info->source = strdupW( script );
- info->action = strdupW( action );
+ info->target = wcsdup( function );
+ info->source = wcsdup( script );
+ info->action = wcsdup( action );
CoCreateGuid( &info->guid );
- EnterCriticalSection( &msi_custom_action_cs );
- list_add_tail( &msi_pending_custom_actions, &info->entry );
- LeaveCriticalSection( &msi_custom_action_cs );
+ EnterCriticalSection( &custom_action_cs );
+ list_add_tail( &pending_custom_actions, &info->entry );
+ LeaveCriticalSection( &custom_action_cs );
info->handle = CreateThread( NULL, 0, ScriptThread, &info->guid, 0, NULL );
if (!info->handle)
static UINT HANDLE_CustomType37_38( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
INT type, const WCHAR *action )
{
MSIRECORD *row = NULL;
- msi_custom_action_info *info;
+ custom_action_info *info;
CHAR *buffer = NULL;
WCHAR *bufferw = NULL;
DWORD sz = 0;
r = MSI_RecordReadStream(row, 2, NULL, &sz);
if (r != ERROR_SUCCESS) goto done;
- buffer = msi_alloc( sz + 1 );
+ buffer = malloc( sz + 1 );
if (!buffer)
{
r = ERROR_FUNCTION_FAILED;
r = wait_thread_handle( info );
done:
- msi_free(bufferw);
- msi_free(buffer);
+ free(bufferw);
+ free(buffer);
msiobj_release(&row->hdr);
return r;
}
static UINT HANDLE_CustomType21_22( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
MSIFILE *file;
HANDLE hFile;
DWORD sz, szHighWord = 0, read;
CloseHandle(hFile);
return ERROR_FUNCTION_FAILED;
}
- buffer = msi_alloc( sz + 1 );
+ buffer = malloc( sz + 1 );
if (!buffer)
{
CloseHandle(hFile);
r = wait_thread_handle( info );
done:
- msi_free(bufferw);
- msi_free(buffer);
+ free(bufferw);
+ free(buffer);
return r;
}
static UINT HANDLE_CustomType53_54( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- msi_custom_action_info *info;
+ custom_action_info *info;
WCHAR *prop;
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
if (!prop) return ERROR_SUCCESS;
info = do_msidbCustomActionTypeScript( package, type, prop, NULL, action );
- msi_free(prop);
+ free(prop);
return wait_thread_handle( info );
}
WCHAR *actiondata = msi_dup_property( package->db, action );
WCHAR *usersid = msi_dup_property( package->db, L"UserSID" );
WCHAR *prodcode = msi_dup_property( package->db, L"ProductCode" );
- WCHAR *deferred = msi_get_deferred_action( action, actiondata, usersid, prodcode );
+ WCHAR *deferred = get_deferred_action( action, actiondata, usersid, prodcode );
if (!deferred)
{
- msi_free( actiondata );
- msi_free( usersid );
- msi_free( prodcode );
+ free( actiondata );
+ free( usersid );
+ free( prodcode );
return ERROR_OUTOFMEMORY;
}
if (type & msidbCustomActionTypeCommit)
msi_schedule_action( package, SCRIPT_INSTALL, deferred );
}
- msi_free( actiondata );
- msi_free( usersid );
- msi_free( prodcode );
- msi_free( deferred );
+ free( actiondata );
+ free( usersid );
+ free( prodcode );
+ free( deferred );
return ERROR_SUCCESS;
}
else
msi_set_property( package->db, L"CustomActionData", L"", -1 );
- msi_free(actiondata);
+ free(actiondata);
}
}
else if (!check_execution_scheduling_options(package,action,type))
case 7: /* Concurrent install from substorage */
deformat_string( package, target, &deformated );
rc = HANDLE_CustomType7( package, source, target, type, action );
- msi_free( deformated );
+ free( deformated );
break;
case 17:
rc = HANDLE_CustomType17( package, source, target, type, action );
case 23: /* Installs another package in the source tree */
deformat_string( package, target, &deformated );
rc = HANDLE_CustomType23( package, source, deformated, type, action );
- msi_free( deformated );
+ free( deformated );
break;
case 34: /* EXE to be run in specified directory */
rc = HANDLE_CustomType34( package, source, target, type, action );
case 35: /* Directory set with formatted text */
deformat_string( package, target, &deformated );
MSI_SetTargetPathW( package, source, deformated );
- msi_free( deformated );
+ free( deformated );
break;
case 37: /* JScript/VBScript text stored in target column */
case 38:
len = deformat_string( package, target, &deformated );
rc = msi_set_property( package->db, source, deformated, len );
if (rc == ERROR_SUCCESS && !wcscmp( source, L"SourceDir" )) msi_reset_source_folders( package );
- msi_free( deformated );
+ free( deformated );
break;
case 53: /* JScript/VBScript text specified by a property value */
case 54:
struct list *item;
HANDLE *wait_handles;
unsigned int handle_count, i;
- msi_custom_action_info *info, *cursor;
+ custom_action_info *info, *cursor;
while ((item = list_head( &package->RunningActions )))
{
- MSIRUNNINGACTION *action = LIST_ENTRY( item, MSIRUNNINGACTION, entry );
+ struct running_action *action = LIST_ENTRY( item, struct running_action, entry );
list_remove( &action->entry );
msi_dialog_check_messages( action->handle );
CloseHandle( action->handle );
- msi_free( action->name );
- msi_free( action );
+ free( action->name );
+ free( action );
}
- EnterCriticalSection( &msi_custom_action_cs );
+ EnterCriticalSection( &custom_action_cs );
- handle_count = list_count( &msi_pending_custom_actions );
- wait_handles = msi_alloc( handle_count * sizeof(HANDLE) );
+ handle_count = list_count( &pending_custom_actions );
+ wait_handles = malloc( handle_count * sizeof(HANDLE) );
handle_count = 0;
- LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry )
+ LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &pending_custom_actions, custom_action_info, entry )
{
if (info->package == package )
{
}
}
- LeaveCriticalSection( &msi_custom_action_cs );
+ LeaveCriticalSection( &custom_action_cs );
for (i = 0; i < handle_count; i++)
{
msi_dialog_check_messages( wait_handles[i] );
CloseHandle( wait_handles[i] );
}
- msi_free( wait_handles );
+ free( wait_handles );
- EnterCriticalSection( &msi_custom_action_cs );
- LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry )
+ EnterCriticalSection( &custom_action_cs );
+ LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &pending_custom_actions, custom_action_info, entry )
{
if (info->package == package)
free_custom_action_data( info );
}
- LeaveCriticalSection( &msi_custom_action_cs );
+ LeaveCriticalSection( &custom_action_cs );
}
UINT __cdecl s_remote_GetActionInfo(const GUID *guid, WCHAR **name, int *type, WCHAR **dll, char **func, MSIHANDLE *hinst)
{
- msi_custom_action_info *info;
+ custom_action_info *info;
info = find_action_by_guid(guid);
if (!info)
return ERROR_INVALID_DATA;
- *name = strdupW(info->action);
+ *name = wcsdup(info->action);
*type = info->type;
*hinst = alloc_msihandle(&info->package->hdr);
- *dll = strdupW(info->source);
+ *dll = wcsdup(info->source);
*func = strdupWtoA(info->target);
return ERROR_SUCCESS;
MSITRANSFORM *t = LIST_ENTRY( list_head( &db->transforms ), MSITRANSFORM, entry );
list_remove( &t->entry );
IStorage_Release( t->stg );
- msi_free( t );
+ free( t );
}
}
{
if (db->streams[i].stream) IStream_Release( db->streams[i].stream );
}
- msi_free( db->streams );
+ free( db->streams );
}
void append_storage_to_db( MSIDATABASE *db, IStorage *stg )
{
MSITRANSFORM *t;
- t = msi_alloc( sizeof *t );
+ t = malloc( sizeof *t );
t->stg = stg;
IStorage_AddRef( stg );
list_add_head( &db->transforms, &t->entry );
{
MSIDATABASE *db = (MSIDATABASE *) arg;
- msi_free(db->path);
+ free( db->path );
free_streams( db );
free_cached_tables( db );
free_transforms( db );
if (db->deletefile)
{
DeleteFileW( db->deletefile );
- msi_free( db->deletefile );
+ free( db->deletefile );
}
- msi_free( db->tempfolder );
+ free( db->tempfolder );
}
static HRESULT db_initialize( IStorage *stg, const GUID *clsid )
else
lstrcpyW( path, save_path );
- db->path = strdupW( path );
+ db->path = wcsdup( path );
db->media_transform_offset = MSI_INITIAL_MEDIA_TRANSFORM_OFFSET;
db->media_transform_disk_id = MSI_INITIAL_MEDIA_TRANSFORM_DISKID;
db->storage = stg;
db->mode = mode;
if (created)
- db->deletefile = strdupW( szDBPath );
+ db->deletefile = wcsdup( szDBPath );
list_init( &db->tables );
list_init( &db->transforms );
end:
if( !IS_INTMSIDBOPEN(szPersist) )
- msi_free( szwPersist );
- msi_free( szwDBPath );
+ free( szwPersist );
+ free( szwDBPath );
return r;
}
-static LPWSTR msi_read_text_archive(LPCWSTR path, DWORD *len)
+static WCHAR *read_text_archive(const WCHAR *path, DWORD *len)
{
HANDLE file;
LPSTR data = NULL;
return NULL;
size = GetFileSize( file, NULL );
- if (!(data = msi_alloc( size ))) goto done;
+ if (!(data = malloc( size ))) goto done;
if (!ReadFile( file, data, size, &read, NULL ) || read != size) goto done;
while (!data[size - 1]) size--;
*len = MultiByteToWideChar( CP_ACP, 0, data, size, NULL, 0 );
- if ((wdata = msi_alloc( (*len + 1) * sizeof(WCHAR) )))
+ if ((wdata = malloc( (*len + 1) * sizeof(WCHAR) )))
{
MultiByteToWideChar( CP_ACP, 0, data, size, wdata, *len );
wdata[*len] = 0;
done:
CloseHandle( file );
- msi_free( data );
+ free( data );
return wdata;
}
-static void msi_parse_line(LPWSTR *line, LPWSTR **entries, DWORD *num_entries, DWORD *len)
+static UINT parse_line(WCHAR **line, WCHAR ***entries, DWORD *num_entries, DWORD *len)
{
LPWSTR ptr = *line, save;
DWORD i, count = 1, chars_left = *len;
chars_left--;
}
- *entries = msi_alloc(count * sizeof(LPWSTR));
+ /*
+ * make sure this line has the same number of entries as there are columns
+ * which are indicated by the first line.
+ */
+ if (*num_entries && *num_entries != count)
+ return ERROR_FUNCTION_FAILED;
+
+ *entries = malloc(count * sizeof(WCHAR *));
if (!*entries)
- return;
+ return ERROR_OUTOFMEMORY;
/* store pointers into the data */
chars_left = *len;
/* move to the next line if there's more, else EOF */
*line = ptr;
*len = chars_left;
- if (num_entries)
+ if (!*num_entries)
*num_entries = count;
+
+ return ERROR_SUCCESS;
}
-static LPWSTR msi_build_createsql_prelude(LPWSTR table)
+static WCHAR *build_createsql_prelude(const WCHAR *table)
{
LPWSTR prelude;
DWORD size;
size = ARRAY_SIZE(L"CREATE TABLE `%s` ( ") + lstrlenW(table) - 2;
- prelude = msi_alloc(size * sizeof(WCHAR));
+ prelude = malloc(size * sizeof(WCHAR));
if (!prelude)
return NULL;
return prelude;
}
-static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, DWORD num_columns)
+static WCHAR *build_createsql_columns(WCHAR **columns_data, WCHAR **types, DWORD num_columns)
{
LPWSTR columns, p;
LPCWSTR type;
WCHAR expanded[128], *ptr;
WCHAR size[10], comma[2], extra[30];
- columns = msi_alloc_zero(sql_size * sizeof(WCHAR));
+ columns = calloc(sql_size, sizeof(WCHAR));
if (!columns)
return NULL;
else
{
WARN("invalid int width %lu\n", len);
- msi_free(columns);
+ free(columns);
return NULL;
}
break;
break;
default:
ERR("Unknown type: %c\n", types[i][0]);
- msi_free(columns);
+ free(columns);
return NULL;
}
swprintf(expanded, ARRAY_SIZE(expanded), L"`%s` %s%s%s%s ", columns_data[i], type, size, extra, comma);
sql_size += lstrlenW(expanded);
- p = msi_realloc(columns, sql_size * sizeof(WCHAR));
+ p = realloc(columns, sql_size * sizeof(WCHAR));
if (!p)
{
- msi_free(columns);
+ free(columns);
return NULL;
}
columns = p;
return columns;
}
-static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys)
+static WCHAR *build_createsql_postlude(WCHAR **primary_keys, DWORD num_keys)
{
LPWSTR postlude, keys, ptr;
DWORD size, i;
for (i = 0, size = 1; i < num_keys; i++)
size += lstrlenW(L"`%s`, ") + lstrlenW(primary_keys[i]) - 2;
- keys = msi_alloc(size * sizeof(WCHAR));
+ keys = malloc(size * sizeof(WCHAR));
if (!keys)
return NULL;
*(ptr - 2) = '\0';
size = lstrlenW(L"PRIMARY KEY %s)") + size - 1;
- postlude = msi_alloc(size * sizeof(WCHAR));
+ postlude = malloc(size * sizeof(WCHAR));
if (!postlude)
goto done;
swprintf(postlude, size, L"PRIMARY KEY %s)", keys);
done:
- msi_free(keys);
+ free(keys);
return postlude;
}
-static UINT msi_add_table_to_db(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types, LPWSTR *labels, DWORD num_labels, DWORD num_columns)
+static UINT add_table_to_db(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, DWORD num_labels,
+ DWORD num_columns)
{
UINT r = ERROR_OUTOFMEMORY;
DWORD size;
LPWSTR create_sql = NULL;
LPWSTR prelude, columns_sql, postlude;
- prelude = msi_build_createsql_prelude(labels[0]);
- columns_sql = msi_build_createsql_columns(columns, types, num_columns);
- postlude = msi_build_createsql_postlude(labels + 1, num_labels - 1); /* skip over table name */
+ prelude = build_createsql_prelude(labels[0]);
+ columns_sql = build_createsql_columns(columns, types, num_columns);
+ postlude = build_createsql_postlude(labels + 1, num_labels - 1); /* skip over table name */
if (!prelude || !columns_sql || !postlude)
goto done;
size = lstrlenW(prelude) + lstrlenW(columns_sql) + lstrlenW(postlude) + 1;
- create_sql = msi_alloc(size * sizeof(WCHAR));
+ create_sql = malloc(size * sizeof(WCHAR));
if (!create_sql)
goto done;
msiobj_release(&view->hdr);
done:
- msi_free(prelude);
- msi_free(columns_sql);
- msi_free(postlude);
- msi_free(create_sql);
+ free(prelude);
+ free(columns_sql);
+ free(postlude);
+ free(create_sql);
return r;
}
-static LPWSTR msi_import_stream_filename(LPCWSTR path, LPCWSTR name)
+static WCHAR *import_stream_filename(const WCHAR *path, const WCHAR *name)
{
DWORD len;
LPWSTR fullname, ptr;
len = lstrlenW(path) + lstrlenW(name) + 1;
- fullname = msi_alloc(len*sizeof(WCHAR));
+ fullname = malloc(len * sizeof(WCHAR));
if (!fullname)
return NULL;
ptr = wcsrchr(fullname, '.');
if (!ptr)
{
- msi_free (fullname);
+ free(fullname);
return NULL;
}
*ptr++ = '\\';
if (*data[i])
{
UINT r;
- LPWSTR file = msi_import_stream_filename(path, data[i]);
+ WCHAR *file = import_stream_filename(path, data[i]);
if (!file)
return ERROR_FUNCTION_FAILED;
r = MSI_RecordSetStreamFromFileW(*rec, i + 1, file);
- msi_free (file);
+ free (file);
if (r != ERROR_SUCCESS)
return ERROR_FUNCTION_FAILED;
}
return ERROR_SUCCESS;
}
-static UINT msi_add_records_to_table(MSIDATABASE *db, LPWSTR *columns, LPWSTR *types,
- LPWSTR *labels, LPWSTR **records,
- int num_columns, int num_records,
- LPWSTR path)
+static UINT add_records_to_table(MSIDATABASE *db, WCHAR **columns, WCHAR **types, WCHAR **labels, WCHAR ***records,
+ int num_columns, int num_records, WCHAR *path)
{
UINT r;
int i;
static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
{
UINT r;
- DWORD len, i, num_labels, num_types, num_columns, num_records = 0;
+ DWORD len, i, num_labels = 0, num_types = 0, num_columns = 0, num_records = 0;
WCHAR **columns, **types, **labels, *path, *ptr, *data, ***records = NULL, ***temp_records;
TRACE("%p %s %s\n", db, debugstr_w(folder), debugstr_w(file) );
return ERROR_INVALID_PARAMETER;
len = lstrlenW(folder) + lstrlenW(L"\\") + lstrlenW(file) + 1;
- path = msi_alloc( len * sizeof(WCHAR) );
+ path = malloc( len * sizeof(WCHAR) );
if (!path)
return ERROR_OUTOFMEMORY;
lstrcatW( path, L"\\" );
lstrcatW( path, file );
- data = msi_read_text_archive( path, &len );
+ data = read_text_archive( path, &len );
if (!data)
{
- msi_free(path);
+ free(path);
return ERROR_FUNCTION_FAILED;
}
ptr = data;
- msi_parse_line( &ptr, &columns, &num_columns, &len );
- msi_parse_line( &ptr, &types, &num_types, &len );
- msi_parse_line( &ptr, &labels, &num_labels, &len );
+ parse_line( &ptr, &columns, &num_columns, &len );
+ parse_line( &ptr, &types, &num_types, &len );
+ parse_line( &ptr, &labels, &num_labels, &len );
if (num_columns == 1 && !columns[0][0] && num_labels == 1 && !labels[0][0] &&
num_types == 2 && !wcscmp( types[1], L"_ForceCodepage" ))
goto done;
}
- records = msi_alloc(sizeof(WCHAR **));
+ records = malloc(sizeof(WCHAR **));
if (!records)
{
r = ERROR_OUTOFMEMORY;
/* read in the table records */
while (len)
{
- msi_parse_line( &ptr, &records[num_records], NULL, &len );
+ r = parse_line( &ptr, &records[num_records], &num_columns, &len );
+ if (r != ERROR_SUCCESS)
+ goto done;
num_records++;
- temp_records = msi_realloc(records, (num_records + 1) * sizeof(WCHAR **));
+ temp_records = realloc(records, (num_records + 1) * sizeof(WCHAR **));
if (!temp_records)
{
r = ERROR_OUTOFMEMORY;
{
if (!TABLE_Exists(db, labels[0]))
{
- r = msi_add_table_to_db( db, columns, types, labels, num_labels, num_columns );
+ r = add_table_to_db( db, columns, types, labels, num_labels, num_columns );
if (r != ERROR_SUCCESS)
{
r = ERROR_FUNCTION_FAILED;
}
}
- r = msi_add_records_to_table( db, columns, types, labels, records, num_columns, num_records, path );
+ r = add_records_to_table( db, columns, types, labels, records, num_columns, num_records, path );
}
done:
- msi_free(path);
- msi_free(data);
- msi_free(columns);
- msi_free(types);
- msi_free(labels);
+ free(path);
+ free(data);
+ free(columns);
+ free(types);
+ free(labels);
for (i = 0; i < num_records; i++)
- msi_free(records[i]);
+ free(records[i]);
- msi_free(records);
+ free(records);
return r;
}
r = MsiDatabaseImportW( handle, path, file );
end:
- msi_free( path );
- msi_free( file );
+ free( path );
+ free( file );
return r;
}
-static UINT msi_export_field( HANDLE handle, MSIRECORD *row, UINT field )
+static UINT export_field( HANDLE handle, MSIRECORD *row, UINT field )
{
- char *buffer;
+ char *buffer, *ptr;
BOOL ret;
DWORD sz = 0x100;
UINT r;
- buffer = msi_alloc( sz );
+ buffer = malloc( sz );
if (!buffer)
return ERROR_OUTOFMEMORY;
char *tmp;
sz++; /* leave room for NULL terminator */
- tmp = msi_realloc( buffer, sz );
+ tmp = realloc( buffer, sz );
if (!tmp)
{
- msi_free( buffer );
+ free( buffer );
return ERROR_OUTOFMEMORY;
}
buffer = tmp;
r = MSI_RecordGetStringA( row, field, buffer, &sz );
if (r != ERROR_SUCCESS)
{
- msi_free( buffer );
+ free( buffer );
return r;
}
}
else if (r != ERROR_SUCCESS)
{
- msi_free( buffer );
+ free( buffer );
return r;
}
+ ptr = buffer;
+ while( *ptr )
+ {
+ if (*ptr == '\r' && *( ptr + 1 ) == '\n')
+ {
+ *ptr++ = '\x11';
+ *ptr++ = '\x19';
+ continue;
+ }
+
+ if (*ptr == '\n')
+ *ptr = '\x19';
+
+ ptr++;
+ }
+
ret = WriteFile( handle, buffer, sz, &sz, NULL );
- msi_free( buffer );
+ free( buffer );
return ret ? ERROR_SUCCESS : ERROR_FUNCTION_FAILED;
}
-static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECORD *row, UINT field, UINT start )
+static UINT export_stream( const WCHAR *folder, const WCHAR *table, MSIRECORD *row, UINT field, UINT start )
{
WCHAR stream[MAX_STREAM_NAME_LEN + 1], *path;
DWORD sz, read_size, write_size;
return r;
len = sz + lstrlenW( folder ) + lstrlenW( table ) + ARRAY_SIZE( L"%s\\%s" ) + 1;
- if (!(path = msi_alloc( len * sizeof(WCHAR) )))
+ if (!(path = malloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY;
len = swprintf( path, len, L"%s\\%s", folder, table );
if (!CreateDirectoryW( path, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
{
- msi_free( path );
+ free( path );
return ERROR_FUNCTION_FAILED;
}
lstrcpyW( path + len, stream );
file = CreateFileW( path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
- msi_free( path );
+ free( path );
if (file == INVALID_HANDLE_VALUE)
return ERROR_FUNCTION_FAILED;
const WCHAR *table;
};
-static UINT msi_export_record( struct row_export_info *row_export_info, MSIRECORD *row, UINT start )
+static UINT export_record( struct row_export_info *row_export_info, MSIRECORD *row, UINT start )
{
HANDLE handle = row_export_info->handle;
UINT i, count, r = ERROR_SUCCESS;
count = MSI_RecordGetFieldCount( row );
for (i = start; i <= count; i++)
{
- r = msi_export_field( handle, row, i );
+ r = export_field( handle, row, i );
if (r == ERROR_INVALID_PARAMETER)
{
- r = msi_export_stream( row_export_info->folder, row_export_info->table, row, i, start );
+ r = export_stream( row_export_info->folder, row_export_info->table, row, i, start );
if (r != ERROR_SUCCESS)
return r;
/* exporting a binary stream, repeat the "Name" field */
- r = msi_export_field( handle, row, start );
+ r = export_field( handle, row, start );
if (r != ERROR_SUCCESS)
return r;
}
return r;
}
-static UINT msi_export_row( MSIRECORD *row, void *arg )
+static UINT export_row( MSIRECORD *row, void *arg )
{
- return msi_export_record( arg, row, 1 );
+ return export_record( arg, row, 1 );
}
-static UINT msi_export_forcecodepage( HANDLE handle, UINT codepage )
+static UINT export_forcecodepage( HANDLE handle, UINT codepage )
{
static const char fmt[] = "\r\n\r\n%u\t_ForceCodepage\r\n";
char data[sizeof(fmt) + 10];
return ERROR_SUCCESS;
}
-static UINT msi_export_summaryinformation( MSIDATABASE *db, HANDLE handle )
+static UINT export_summaryinformation( MSIDATABASE *db, HANDLE handle )
{
static const char header[] = "PropertyId\tValue\r\n"
"i2\tl255\r\n"
return ERROR_INVALID_PARAMETER;
len = lstrlenW(folder) + lstrlenW(file) + 2;
- filename = msi_alloc(len * sizeof (WCHAR));
+ filename = malloc(len * sizeof(WCHAR));
if (!filename)
return ERROR_OUTOFMEMORY;
handle = CreateFileW( filename, GENERIC_READ | GENERIC_WRITE, 0,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
- msi_free( filename );
+ free( filename );
if (handle == INVALID_HANDLE_VALUE)
return ERROR_FUNCTION_FAILED;
if (!wcscmp( table, L"_ForceCodepage" ))
{
UINT codepage = msi_get_string_table_codepage( db->strings );
- r = msi_export_forcecodepage( handle, codepage );
+ r = export_forcecodepage( handle, codepage );
goto done;
}
if (!wcscmp( table, L"_SummaryInformation" ))
{
- r = msi_export_summaryinformation( db, handle );
+ r = export_summaryinformation( db, handle );
goto done;
}
r = MSI_ViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec);
if (r == ERROR_SUCCESS)
{
- msi_export_record( &row_export_info, rec, 1 );
+ export_record( &row_export_info, rec, 1 );
msiobj_release( &rec->hdr );
}
r = MSI_ViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec);
if (r == ERROR_SUCCESS)
{
- msi_export_record( &row_export_info, rec, 1 );
+ export_record( &row_export_info, rec, 1 );
msiobj_release( &rec->hdr );
}
if (r == ERROR_SUCCESS)
{
MSI_RecordSetStringW( rec, 0, table );
- msi_export_record( &row_export_info, rec, 0 );
+ export_record( &row_export_info, rec, 0 );
msiobj_release( &rec->hdr );
}
/* write out row 4 onwards, the data */
- r = MSI_IterateRecords( view, 0, msi_export_row, &row_export_info );
+ r = MSI_IterateRecords( view, 0, export_row, &row_export_info );
msiobj_release( &view->hdr );
}
r = MsiDatabaseExportW( handle, table, path, file );
end:
- msi_free( table );
- msi_free( path );
- msi_free( file );
+ free( table );
+ free( path );
+ free( file );
return r;
}
table = strdupAtoW(szTableName);
r = MsiDatabaseMergeW(hDatabase, hDatabaseMerge, table);
- msi_free(table);
+ free(table);
return r;
}
-typedef struct _tagMERGETABLE
+struct merge_table
{
struct list entry;
struct list rows;
DWORD numtypes;
LPWSTR *labels;
DWORD numlabels;
-} MERGETABLE;
+};
-typedef struct _tagMERGEROW
+struct merge_row
{
struct list entry;
MSIRECORD *data;
-} MERGEROW;
+};
-typedef struct _tagMERGEDATA
+struct merge_data
{
MSIDATABASE *db;
MSIDATABASE *merge;
- MERGETABLE *curtable;
+ struct merge_table *curtable;
MSIQUERY *curview;
struct list *tabledata;
-} MERGEDATA;
+};
static BOOL merge_type_match(LPCWSTR type1, LPCWSTR type2)
{
{
str = msi_dup_record_field(colnames, ++i);
cmp = wcscmp( key, str );
- msi_free(str);
+ free(str);
} while (cmp);
msiobj_release(&colnames->hdr);
{
/* quote string record fields */
sz += 2;
- val = msi_alloc(sz * sizeof(WCHAR));
+ val = malloc(sz * sizeof(WCHAR));
if (!val)
return NULL;
else
{
/* do not quote integer record fields */
- val = msi_alloc(sz * sizeof(WCHAR));
+ val = malloc(sz * sizeof(WCHAR));
if (!val)
return NULL;
if (r != ERROR_SUCCESS)
{
ERR("failed to get string!\n");
- msi_free(val);
+ free(val);
return NULL;
}
static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
LPWSTR table, MSIRECORD *rec)
{
- LPWSTR query = NULL, clause = NULL, val;
+ WCHAR *query = NULL, *clause = NULL, *new_clause, *val;
LPCWSTR setptr, key;
DWORD size, oldsize;
MSIRECORD *keys;
if (r != ERROR_SUCCESS)
return NULL;
- clause = msi_alloc_zero(sizeof(WCHAR));
- if (!clause)
- goto done;
-
size = 1;
count = MSI_RecordGetFieldCount(keys);
for (i = 1; i <= count; i++)
oldsize = size;
size += lstrlenW(setptr) + lstrlenW(key) + lstrlenW(val) - 4;
- clause = msi_realloc(clause, size * sizeof (WCHAR));
- if (!clause)
+ new_clause = realloc(clause, size * sizeof(WCHAR));
+ if (!new_clause)
{
- msi_free(val);
+ free(val);
goto done;
}
+ clause = new_clause;
swprintf(clause + oldsize - 1, size - (oldsize - 1), setptr, key, val);
- msi_free(val);
+ free(val);
}
size = lstrlenW(L"SELECT * FROM `%s` WHERE %s") + lstrlenW(table) + lstrlenW(clause) + 1;
- query = msi_alloc(size * sizeof(WCHAR));
+ query = malloc(size * sizeof(WCHAR));
if (!query)
goto done;
swprintf(query, size, L"SELECT * FROM `%s` WHERE %s", table, clause);
done:
- msi_free(clause);
+ free(clause);
msiobj_release(&keys->hdr);
return query;
}
static UINT merge_diff_row(MSIRECORD *rec, LPVOID param)
{
- MERGEDATA *data = param;
- MERGETABLE *table = data->curtable;
- MERGEROW *mergerow;
+ struct merge_data *data = param;
+ struct merge_table *table = data->curtable;
+ struct merge_row *mergerow;
MSIQUERY *dbview = NULL;
MSIRECORD *row = NULL;
LPWSTR query = NULL;
r = ERROR_SUCCESS;
}
- mergerow = msi_alloc(sizeof(MERGEROW));
+ mergerow = malloc(sizeof(*mergerow));
if (!mergerow)
{
r = ERROR_OUTOFMEMORY;
if (!mergerow->data)
{
r = ERROR_OUTOFMEMORY;
- msi_free(mergerow);
+ free(mergerow);
goto done;
}
list_add_tail(&table->rows, &mergerow->entry);
done:
- msi_free(query);
+ free(query);
msiobj_release(&row->hdr);
msiobj_release(&dbview->hdr);
return r;
}
-static UINT msi_get_table_labels(MSIDATABASE *db, LPCWSTR table, LPWSTR **labels, DWORD *numlabels)
+static UINT get_table_labels(MSIDATABASE *db, const WCHAR *table, WCHAR ***labels, DWORD *numlabels)
{
UINT r, i, count;
MSIRECORD *prec = NULL;
count = MSI_RecordGetFieldCount(prec);
*numlabels = count + 1;
- *labels = msi_alloc((*numlabels)*sizeof(LPWSTR));
+ *labels = malloc((*numlabels) * sizeof(WCHAR *));
if (!*labels)
{
r = ERROR_OUTOFMEMORY;
goto end;
}
- (*labels)[0] = strdupW(table);
+ (*labels)[0] = wcsdup(table);
for (i=1; i<=count; i++ )
{
- (*labels)[i] = strdupW(MSI_RecordGetString(prec, i));
+ (*labels)[i] = wcsdup(MSI_RecordGetString(prec, i));
}
end:
return r;
}
-static UINT msi_get_query_columns(MSIQUERY *query, LPWSTR **columns, DWORD *numcolumns)
+static UINT get_query_columns(MSIQUERY *query, WCHAR ***columns, DWORD *numcolumns)
{
UINT r, i, count;
MSIRECORD *prec = NULL;
return r;
count = MSI_RecordGetFieldCount(prec);
- *columns = msi_alloc(count*sizeof(LPWSTR));
+ *columns = malloc(count * sizeof(WCHAR *));
if (!*columns)
{
r = ERROR_OUTOFMEMORY;
for (i=1; i<=count; i++ )
{
- (*columns)[i-1] = strdupW(MSI_RecordGetString(prec, i));
+ (*columns)[i-1] = wcsdup(MSI_RecordGetString(prec, i));
}
*numcolumns = count;
return r;
}
-static UINT msi_get_query_types(MSIQUERY *query, LPWSTR **types, DWORD *numtypes)
+static UINT get_query_types(MSIQUERY *query, WCHAR ***types, DWORD *numtypes)
{
UINT r, i, count;
MSIRECORD *prec = NULL;
return r;
count = MSI_RecordGetFieldCount(prec);
- *types = msi_alloc(count*sizeof(LPWSTR));
+ *types = malloc(count * sizeof(WCHAR *));
if (!*types)
{
r = ERROR_OUTOFMEMORY;
*numtypes = count;
for (i=1; i<=count; i++ )
{
- (*types)[i-1] = strdupW(MSI_RecordGetString(prec, i));
+ (*types)[i-1] = wcsdup(MSI_RecordGetString(prec, i));
}
end:
return r;
}
-static void merge_free_rows(MERGETABLE *table)
+static void merge_free_rows(struct merge_table *table)
{
struct list *item, *cursor;
LIST_FOR_EACH_SAFE(item, cursor, &table->rows)
{
- MERGEROW *row = LIST_ENTRY(item, MERGEROW, entry);
+ struct merge_row *row = LIST_ENTRY(item, struct merge_row, entry);
list_remove(&row->entry);
msiobj_release(&row->data->hdr);
- msi_free(row);
+ free(row);
}
}
-static void free_merge_table(MERGETABLE *table)
+static void free_merge_table(struct merge_table *table)
{
UINT i;
if (table->labels != NULL)
{
for (i = 0; i < table->numlabels; i++)
- msi_free(table->labels[i]);
+ free(table->labels[i]);
- msi_free(table->labels);
+ free(table->labels);
}
if (table->columns != NULL)
{
for (i = 0; i < table->numcolumns; i++)
- msi_free(table->columns[i]);
+ free(table->columns[i]);
- msi_free(table->columns);
+ free(table->columns);
}
if (table->types != NULL)
{
for (i = 0; i < table->numtypes; i++)
- msi_free(table->types[i]);
+ free(table->types[i]);
- msi_free(table->types);
+ free(table->types);
}
- msi_free(table->name);
+ free(table->name);
merge_free_rows(table);
- msi_free(table);
+ free(table);
}
-static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **ptable)
+static UINT get_merge_table(MSIDATABASE *db, const WCHAR *name, struct merge_table **ptable)
{
UINT r;
- MERGETABLE *table;
+ struct merge_table *table;
MSIQUERY *mergeview = NULL;
- table = msi_alloc_zero(sizeof(MERGETABLE));
+ table = calloc(1, sizeof(*table));
if (!table)
{
*ptable = NULL;
return ERROR_OUTOFMEMORY;
}
- r = msi_get_table_labels(db, name, &table->labels, &table->numlabels);
+ r = get_table_labels(db, name, &table->labels, &table->numlabels);
if (r != ERROR_SUCCESS)
goto err;
if (r != ERROR_SUCCESS)
goto err;
- r = msi_get_query_columns(mergeview, &table->columns, &table->numcolumns);
+ r = get_query_columns(mergeview, &table->columns, &table->numcolumns);
if (r != ERROR_SUCCESS)
goto err;
- r = msi_get_query_types(mergeview, &table->types, &table->numtypes);
+ r = get_query_types(mergeview, &table->types, &table->numtypes);
if (r != ERROR_SUCCESS)
goto err;
list_init(&table->rows);
- table->name = strdupW(name);
+ table->name = wcsdup(name);
table->numconflicts = 0;
msiobj_release(&mergeview->hdr);
static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param)
{
- MERGEDATA *data = param;
- MERGETABLE *table;
+ struct merge_data *data = param;
+ struct merge_table *table;
MSIQUERY *dbview = NULL;
MSIQUERY *mergeview = NULL;
LPCWSTR name;
goto done;
}
- r = msi_get_merge_table(data->merge, name, &table);
+ r = get_merge_table(data->merge, name, &table);
if (r != ERROR_SUCCESS)
goto done;
struct list *tabledata)
{
MSIQUERY *view;
- MERGEDATA data;
+ struct merge_data data;
UINT r;
r = MSI_DatabaseOpenViewW(merge, L"SELECT * FROM `_Tables`", &view);
return r;
}
-static UINT merge_table(MSIDATABASE *db, MERGETABLE *table)
+static UINT merge_table(MSIDATABASE *db, struct merge_table *table)
{
UINT r;
- MERGEROW *row;
+ struct merge_row *row;
MSIVIEW *tv;
if (!TABLE_Exists(db, table->name))
{
- r = msi_add_table_to_db(db, table->columns, table->types,
- table->labels, table->numlabels, table->numcolumns);
+ r = add_table_to_db(db, table->columns, table->types, table->labels, table->numlabels, table->numcolumns);
if (r != ERROR_SUCCESS)
return ERROR_FUNCTION_FAILED;
}
- LIST_FOR_EACH_ENTRY(row, &table->rows, MERGEROW, entry)
+ LIST_FOR_EACH_ENTRY(row, &table->rows, struct merge_row, entry)
{
r = TABLE_CreateView(db, table->name, &tv);
if (r != ERROR_SUCCESS)
struct list tabledata = LIST_INIT(tabledata);
struct list *item, *cursor;
MSIDATABASE *db, *merge;
- MERGETABLE *table;
+ struct merge_table *table;
BOOL conflicts;
UINT r;
goto done;
conflicts = FALSE;
- LIST_FOR_EACH_ENTRY(table, &tabledata, MERGETABLE, entry)
+ LIST_FOR_EACH_ENTRY(table, &tabledata, struct merge_table, entry)
{
if (table->numconflicts)
{
LIST_FOR_EACH_SAFE(item, cursor, &tabledata)
{
- MERGETABLE *table = LIST_ENTRY(item, MERGETABLE, entry);
+ struct merge_table *table = LIST_ENTRY(item, struct merge_table, entry);
list_remove(&table->entry);
free_merge_table(table);
}
* that's a bug in the way I'm running the query, or a just a bug.
*/
-typedef struct tagMSIDELETEVIEW
+struct delete_view
{
MSIVIEW view;
MSIDATABASE *db;
MSIVIEW *table;
-} MSIDELETEVIEW;
+};
static UINT DELETE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, val );
static UINT DELETE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, stm );
static UINT DELETE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
UINT r, i, rows = 0, cols = 0;
TRACE("%p %p\n", dv, record);
static UINT DELETE_close( struct tagMSIVIEW *view )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv );
static UINT DELETE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %p %p\n", dv, rows, cols );
static UINT DELETE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
static UINT DELETE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec );
static UINT DELETE_delete( struct tagMSIVIEW *view )
{
- MSIDELETEVIEW *dv = (MSIDELETEVIEW*)view;
+ struct delete_view *dv = (struct delete_view *)view;
TRACE("%p\n", dv );
if( dv->table )
dv->table->ops->delete( dv->table );
- msi_free( dv );
+ free( dv );
return ERROR_SUCCESS;
}
UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
{
- MSIDELETEVIEW *dv = NULL;
+ struct delete_view *dv = NULL;
TRACE("%p\n", dv );
- dv = msi_alloc_zero( sizeof *dv );
+ dv = calloc( 1, sizeof *dv );
if( !dv )
return ERROR_FUNCTION_FAILED;
*/
#define COBJMACROS
-#define NONAMELESSUNION
#include <stdarg.h>
extern HINSTANCE msi_hInstance;
-struct msi_control_tag;
-typedef struct msi_control_tag msi_control;
-typedef UINT (*msi_handler)( msi_dialog *, msi_control *, WPARAM );
-typedef void (*msi_update)( msi_dialog *, msi_control * );
-typedef UINT (*control_event_handler)( msi_dialog *, const WCHAR *, const WCHAR * );
-typedef UINT (*event_handler)( msi_dialog *, const WCHAR * );
-
-struct msi_control_tag
+struct control
{
struct list entry;
HWND hwnd;
- msi_handler handler;
- msi_update update;
+ UINT (*handler)( msi_dialog *, struct control *, WPARAM );
+ void (*update)( msi_dialog *, struct control * );
LPWSTR property;
LPWSTR value;
HBITMAP hBitmap;
WCHAR name[1];
};
-typedef struct msi_font_tag
+struct font
{
struct list entry;
HFONT hfont;
COLORREF color;
WCHAR name[1];
-} msi_font;
+};
struct msi_dialog_tag
{
MSIPACKAGE *package;
msi_dialog *parent;
- control_event_handler event_handler;
+ UINT (*event_handler)( msi_dialog *, const WCHAR *, const WCHAR * );
BOOL finished;
INT scale;
DWORD attributes;
HWND hWndFocus;
LPWSTR control_default;
LPWSTR control_cancel;
- event_handler pending_event;
+ UINT (*pending_event)( msi_dialog *, const WCHAR * );
LPWSTR pending_argument;
INT retval;
WCHAR name[1];
WCHAR *attribute;
};
-typedef UINT (*msi_dialog_control_func)( msi_dialog *dialog, MSIRECORD *rec );
struct control_handler
{
LPCWSTR control_type;
- msi_dialog_control_func func;
+ UINT (*func)( msi_dialog *dialog, MSIRECORD *rec );
};
-typedef struct
+struct radio_button_group_descr
{
- msi_dialog* dialog;
- msi_control *parent;
- LPWSTR propval;
-} radio_button_group_descr;
+ msi_dialog *dialog;
+ struct control *parent;
+ WCHAR *propval;
+};
/* dialog sequencing */
static DWORD uiThreadId;
static HWND hMsiHiddenWindow;
-static LPWSTR msi_get_window_text( HWND hwnd )
+static WCHAR *get_window_text( HWND hwnd )
{
UINT sz, r;
- LPWSTR buf;
+ WCHAR *buf, *new_buf;
sz = 0x20;
- buf = msi_alloc( sz*sizeof(WCHAR) );
+ buf = malloc( sz * sizeof(WCHAR) );
while ( buf )
{
r = GetWindowTextW( hwnd, buf, sz );
if ( r < (sz - 1) )
break;
sz *= 2;
- buf = msi_realloc( buf, sz*sizeof(WCHAR) );
+ new_buf = realloc( buf, sz * sizeof(WCHAR) );
+ if ( !new_buf )
+ free( buf );
+ buf = new_buf;
}
return buf;
}
-static INT msi_dialog_scale_unit( msi_dialog *dialog, INT val )
+static INT dialog_scale_unit( msi_dialog *dialog, INT val )
{
return MulDiv( val, dialog->scale, 12 );
}
-static msi_control *msi_dialog_find_control( msi_dialog *dialog, LPCWSTR name )
+static struct control *dialog_find_control( msi_dialog *dialog, const WCHAR *name )
{
- msi_control *control;
+ struct control *control;
if( !name )
return NULL;
if( !dialog->hwnd )
return NULL;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
if( !wcscmp( control->name, name ) ) /* FIXME: case sensitive? */
return control;
return NULL;
}
-static msi_control *msi_dialog_find_control_by_type( msi_dialog *dialog, LPCWSTR type )
+static struct control *dialog_find_control_by_type( msi_dialog *dialog, const WCHAR *type )
{
- msi_control *control;
+ struct control *control;
if( !type )
return NULL;
if( !dialog->hwnd )
return NULL;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
if( !wcscmp( control->type, type ) ) /* FIXME: case sensitive? */
return control;
return NULL;
}
-static msi_control *msi_dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd )
+static struct control *dialog_find_control_by_hwnd( msi_dialog *dialog, HWND hwnd )
{
- msi_control *control;
+ struct control *control;
if( !dialog->hwnd )
return NULL;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
if( hwnd == control->hwnd )
return control;
return NULL;
}
-static LPWSTR msi_get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, int field )
+static WCHAR *get_deformatted_field( MSIPACKAGE *package, MSIRECORD *rec, int field )
{
LPCWSTR str = MSI_RecordGetString( rec, field );
LPWSTR ret = NULL;
return ret;
}
-static LPWSTR msi_dialog_dup_property( msi_dialog *dialog, LPCWSTR property, BOOL indirect )
+static WCHAR *dialog_dup_property( msi_dialog *dialog, const WCHAR *property, BOOL indirect )
{
LPWSTR prop = NULL;
prop = msi_dup_property( dialog->package->db, property );
if (!prop)
- prop = strdupW( property );
+ prop = wcsdup( property );
return prop;
}
/*
- * msi_dialog_get_style
+ * dialog_get_style
*
* Extract the {\style} string from the front of the text to display and
* update the pointer. Only the last style in a list is applied.
*/
-static LPWSTR msi_dialog_get_style( LPCWSTR p, LPCWSTR *rest )
+static WCHAR *dialog_get_style( const WCHAR *p, const WCHAR **rest )
{
LPWSTR ret;
LPCWSTR q, i, first;
*rest = ++q;
len = q - p;
- ret = msi_alloc( len*sizeof(WCHAR) );
+ ret = malloc( len * sizeof(WCHAR) );
if( !ret )
return ret;
memcpy( ret, p, len*sizeof(WCHAR) );
return ret;
}
-static UINT msi_dialog_add_font( MSIRECORD *rec, LPVOID param )
+static UINT dialog_add_font( MSIRECORD *rec, void *param )
{
msi_dialog *dialog = param;
- msi_font *font;
+ struct font *font;
LPCWSTR face, name;
LOGFONTW lf;
INT style;
/* create a font and add it to the list */
name = MSI_RecordGetString( rec, 1 );
- font = msi_alloc( FIELD_OFFSET( msi_font, name[lstrlenW( name ) + 1] ));
+ font = malloc( offsetof( struct font, name[wcslen( name ) + 1] ) );
lstrcpyW( font->name, name );
list_add_head( &dialog->fonts, &font->entry );
return ERROR_SUCCESS;
}
-static msi_font *msi_dialog_find_font( msi_dialog *dialog, LPCWSTR name )
+static struct font *dialog_find_font( msi_dialog *dialog, const WCHAR *name )
{
- msi_font *font = NULL;
+ struct font *font = NULL;
- LIST_FOR_EACH_ENTRY( font, &dialog->fonts, msi_font, entry )
+ LIST_FOR_EACH_ENTRY( font, &dialog->fonts, struct font, entry )
if( !wcscmp( font->name, name ) ) /* FIXME: case sensitive? */
break;
return font;
}
-static UINT msi_dialog_set_font( msi_dialog *dialog, HWND hwnd, LPCWSTR name )
+static UINT dialog_set_font( msi_dialog *dialog, HWND hwnd, const WCHAR *name )
{
- msi_font *font;
+ struct font *font;
- font = msi_dialog_find_font( dialog, name );
+ font = dialog_find_font( dialog, name );
if( font )
SendMessageW( hwnd, WM_SETFONT, (WPARAM) font->hfont, TRUE );
else
return ERROR_SUCCESS;
}
-static UINT msi_dialog_build_font_list( msi_dialog *dialog )
+static UINT dialog_build_font_list( msi_dialog *dialog )
{
MSIQUERY *view;
UINT r;
if( r != ERROR_SUCCESS )
return r;
- r = MSI_IterateRecords( view, NULL, msi_dialog_add_font, dialog );
+ r = MSI_IterateRecords( view, NULL, dialog_add_font, dialog );
msiobj_release( &view->hdr );
return r;
}
-static void msi_destroy_control( msi_control *t )
+static void destroy_control( struct control *t )
{
list_remove( &t->entry );
/* leave dialog->hwnd - destroying parent destroys child windows */
- msi_free( t->property );
- msi_free( t->value );
+ free( t->property );
+ free( t->value );
if( t->hBitmap )
DeleteObject( t->hBitmap );
if( t->hIcon )
DestroyIcon( t->hIcon );
if ( t->hImageList )
ImageList_Destroy( t->hImageList );
- msi_free( t->tabnext );
- msi_free( t->type );
+ free( t->tabnext );
+ free( t->type );
if (t->hDll)
FreeLibrary( t->hDll );
- msi_free( t );
+ free( t );
}
-static msi_control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle,
- const WCHAR *szCls, const WCHAR *name, const WCHAR *text,
- DWORD style, HWND parent )
+static struct control *dialog_create_window( msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle,
+ const WCHAR *szCls, const WCHAR *name, const WCHAR *text,
+ DWORD style, HWND parent )
{
DWORD x, y, width, height;
LPWSTR font = NULL, title_font = NULL;
LPCWSTR title = NULL;
- msi_control *control;
+ struct control *control;
style |= WS_CHILD;
- control = msi_alloc( FIELD_OFFSET( msi_control, name[lstrlenW( name ) + 1] ));
+ control = malloc( offsetof( struct control, name[wcslen( name ) + 1] ) );
if (!control)
return NULL;
control->hIcon = NULL;
control->hImageList = NULL;
control->hDll = NULL;
- control->tabnext = strdupW( MSI_RecordGetString( rec, 11) );
- control->type = strdupW( MSI_RecordGetString( rec, 3 ) );
+ control->tabnext = wcsdup( MSI_RecordGetString( rec, 11 ) );
+ control->type = wcsdup( MSI_RecordGetString( rec, 3 ) );
control->progress_current = 0;
control->progress_max = 100;
control->progress_backwards = FALSE;
width = MSI_RecordGetInteger( rec, 6 );
height = MSI_RecordGetInteger( rec, 7 );
- x = msi_dialog_scale_unit( dialog, x );
- y = msi_dialog_scale_unit( dialog, y );
- width = msi_dialog_scale_unit( dialog, width );
- height = msi_dialog_scale_unit( dialog, height );
+ x = dialog_scale_unit( dialog, x );
+ y = dialog_scale_unit( dialog, y );
+ width = dialog_scale_unit( dialog, width );
+ height = dialog_scale_unit( dialog, height );
if( text )
{
deformat_string( dialog->package, text, &title_font );
- font = msi_dialog_get_style( title_font, &title );
+ font = dialog_get_style( title_font, &title );
}
+ if (!wcsicmp( MSI_RecordGetString( rec, 3 ), L"Line" ))
+ height = 2; /* line is exactly 2 units in height */
+
control->hwnd = CreateWindowExW( exstyle, szCls, title, style,
x, y, width, height, parent, NULL, NULL, NULL );
TRACE("Dialog %s control %s hwnd %p\n",
debugstr_w(dialog->name), debugstr_w(text), control->hwnd );
- msi_dialog_set_font( dialog, control->hwnd,
- font ? font : dialog->default_font );
+ dialog_set_font( dialog, control->hwnd, font ? font : dialog->default_font );
- msi_free( title_font );
- msi_free( font );
+ free( title_font );
+ free( font );
return control;
}
-static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key )
+static WCHAR *dialog_get_uitext( msi_dialog *dialog, const WCHAR *key )
{
MSIRECORD *rec;
LPWSTR text;
rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key );
if (!rec) return NULL;
- text = strdupW( MSI_RecordGetString( rec, 2 ) );
+ text = wcsdup( MSI_RecordGetString( rec, 2 ) );
msiobj_release( &rec->hdr );
return text;
}
-static HANDLE msi_load_image( MSIDATABASE *db, LPCWSTR name, UINT type,
- UINT cx, UINT cy, UINT flags )
+static HANDLE load_image( MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags )
{
MSIRECORD *rec;
HANDLE himage = NULL;
}
DeleteFileW( tmp );
- msi_free( tmp );
+ free( tmp );
return himage;
}
-static HICON msi_load_icon( MSIDATABASE *db, LPCWSTR text, UINT attributes )
+static HICON load_icon( MSIDATABASE *db, const WCHAR *text, UINT attributes )
{
DWORD cx = 0, cy = 0, flags;
}
/* msidbControlAttributesIconSize48 handled by above logic */
}
- return msi_load_image( db, text, IMAGE_ICON, cx, cy, flags );
+ return load_image( db, text, IMAGE_ICON, cx, cy, flags );
}
-static void msi_dialog_update_controls( msi_dialog *dialog, LPCWSTR property )
+static void dialog_update_controls( msi_dialog *dialog, const WCHAR *property )
{
- msi_control *control;
+ struct control *control;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
{
if ( control->property && !wcscmp( control->property, property ) && control->update )
control->update( dialog, control );
}
}
-static void msi_dialog_update_all_controls( msi_dialog *dialog )
+static void dialog_update_all_controls( msi_dialog *dialog )
{
- msi_control *control;
+ struct control *control;
- LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
{
if ( control->property && control->update )
control->update( dialog, control );
}
}
-static void msi_dialog_set_property( MSIPACKAGE *package, LPCWSTR property, LPCWSTR value )
+static void dialog_set_property( MSIPACKAGE *package, const WCHAR *property, const WCHAR *value )
{
UINT r = msi_set_property( package->db, property, value, -1 );
if (r == ERROR_SUCCESS && !wcscmp( property, L"SourceDir" ))
msi_reset_source_folders( package );
}
-static MSIFEATURE *msi_seltree_feature_from_item( HWND hwnd, HTREEITEM hItem )
+static MSIFEATURE *seltree_feature_from_item( HWND hwnd, HTREEITEM hItem )
{
TVITEMW tvi;
HTREEITEM selected;
};
-static MSIFEATURE *msi_seltree_get_selected_feature( msi_control *control )
+static MSIFEATURE *seltree_get_selected_feature( struct control *control )
{
struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
- return msi_seltree_feature_from_item( control->hwnd, info->selected );
+ return seltree_feature_from_item( control->hwnd, info->selected );
}
-static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control,
- const WCHAR *attribute, MSIRECORD *rec )
+static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec )
{
- msi_control* ctrl;
+ struct control* ctrl;
- ctrl = msi_dialog_find_control( dialog, control );
+ ctrl = dialog_find_control( dialog, control );
if (!ctrl)
return;
if( !wcscmp( attribute, L"Text" ) )
WCHAR *font, *text_fmt = NULL;
font_text = MSI_RecordGetString( rec , 1 );
- font = msi_dialog_get_style( font_text, &text );
+ font = dialog_get_style( font_text, &text );
deformat_string( dialog->package, text, &text_fmt );
if (text_fmt) text = text_fmt;
else text = L"";
SetWindowTextW( ctrl->hwnd, text );
- msi_free( font );
- msi_free( text_fmt );
+ free( font );
+ free( text_fmt );
msi_dialog_check_messages( NULL );
}
else if( !wcscmp( attribute, L"Progress" ) )
}
else if ( !wcscmp( attribute, L"Property" ) )
{
- MSIFEATURE *feature = msi_seltree_get_selected_feature( ctrl );
- if (feature) msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory );
+ MSIFEATURE *feature = seltree_get_selected_feature( ctrl );
+ if (feature) dialog_set_property( dialog->package, ctrl->property, feature->Directory );
}
else if ( !wcscmp( attribute, L"SelectionPath" ) )
{
BOOL indirect = ctrl->attributes & msidbControlAttributesIndirect;
- LPWSTR path = msi_dialog_dup_property( dialog, ctrl->property, indirect );
+ WCHAR *path = dialog_dup_property( dialog, ctrl->property, indirect );
if (!path) return;
SetWindowTextW( ctrl->hwnd, path );
- msi_free(path);
+ free( path );
}
else
{
return;
};
}
- if (!(sub = msi_alloc( sizeof(*sub) ))) return;
+ if (!(sub = malloc( sizeof(*sub) ))) return;
sub->dialog = dialog;
- sub->event = strdupW( event );
- sub->control = strdupW( control );
- sub->attribute = strdupW( attribute );
+ sub->event = wcsdup( event );
+ sub->control = wcsdup( control );
+ sub->attribute = wcsdup( attribute );
list_add_tail( &dialog->package->subscriptions, &sub->entry );
}
}
/* everything except radio buttons */
-static msi_control *msi_dialog_add_control( msi_dialog *dialog,
- MSIRECORD *rec, LPCWSTR szCls, DWORD style )
+static struct control *dialog_add_control( msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style )
{
DWORD attributes;
const WCHAR *text = NULL, *name, *control_type;
struct msi_text_info
{
- msi_font *font;
+ struct font *font;
WNDPROC oldproc;
DWORD attributes;
};
* we don't erase our own background,
* so we have to make sure that the parent window redraws first
*/
-static void msi_text_on_settext( HWND hWnd )
+static void text_on_settext( HWND hWnd )
{
HWND hParent;
RECT rc;
InvalidateRect( hParent, &rc, TRUE );
}
-static LRESULT WINAPI
-MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT WINAPI MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct msi_text_info *info;
LRESULT r = 0;
switch( msg )
{
case WM_SETTEXT:
- msi_text_on_settext( hWnd );
+ text_on_settext( hWnd );
break;
case WM_NCDESTROY:
- msi_free( info );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
}
return r;
}
-static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
struct msi_text_info *info;
LPCWSTR text, ptr, prop, control_name;
LPWSTR font_name;
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP );
+ control = dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP );
if( !control )
return ERROR_FUNCTION_FAILED;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if( !info )
return ERROR_SUCCESS;
control_name = MSI_RecordGetString( rec, 2 );
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
text = MSI_RecordGetString( rec, 10 );
- font_name = msi_dialog_get_style( text, &ptr );
- info->font = ( font_name ) ? msi_dialog_find_font( dialog, font_name ) : NULL;
- msi_free( font_name );
+ font_name = dialog_get_style( text, &ptr );
+ info->font = ( font_name ) ? dialog_find_font( dialog, font_name ) : NULL;
+ free( font_name );
info->attributes = MSI_RecordGetInteger( rec, 8 );
if( info->attributes & msidbControlAttributesTransparent )
}
/* strip any leading text style label from text field */
-static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec )
+static WCHAR *get_binary_name( MSIPACKAGE *package, MSIRECORD *rec )
{
WCHAR *p, *text;
- text = msi_get_deformatted_field( package, rec, 10 );
+ text = get_deformatted_field( package, rec, 10 );
if (!text)
return NULL;
while (*p && *p != '}') p++;
if (!*p++) return text;
- p = strdupW( p );
- msi_free( text );
+ p = wcsdup( p );
+ free( text );
return p;
}
-static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR arg )
+static UINT dialog_set_property_event( msi_dialog *dialog, const WCHAR *event, const WCHAR *arg )
{
LPWSTR p, prop, arg_fmt = NULL;
UINT len;
len = lstrlenW( event );
- prop = msi_alloc( len * sizeof(WCHAR) );
+ prop = malloc( len * sizeof(WCHAR) );
lstrcpyW( prop, &event[1] );
p = wcschr( prop, ']' );
if (p && (p[1] == 0 || p[1] == ' '))
{
*p = 0;
if (wcscmp( L"{}", arg )) deformat_string( dialog->package, arg, &arg_fmt );
- msi_dialog_set_property( dialog->package, prop, arg_fmt );
- msi_dialog_update_controls( dialog, prop );
- msi_free( arg_fmt );
+ dialog_set_property( dialog->package, prop, arg_fmt );
+ dialog_update_controls( dialog, prop );
+ free( arg_fmt );
}
else ERR("Badly formatted property string - what happens?\n");
- msi_free( prop );
+ free( prop );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_send_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR arg )
+static UINT dialog_send_event( msi_dialog *dialog, const WCHAR *event, const WCHAR *arg )
{
LPWSTR event_fmt = NULL, arg_fmt = NULL;
dialog->event_handler( dialog, event_fmt, arg_fmt );
- msi_free( event_fmt );
- msi_free( arg_fmt );
+ free( event_fmt );
+ free( arg_fmt );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_control_event( MSIRECORD *rec, LPVOID param )
+static UINT dialog_control_event( MSIRECORD *rec, void *param )
{
msi_dialog *dialog = param;
LPCWSTR condition, event, arg;
event = MSI_RecordGetString( rec, 3 );
arg = MSI_RecordGetString( rec, 4 );
if (event[0] == '[')
- msi_dialog_set_property_event( dialog, event, arg );
+ dialog_set_property_event( dialog, event, arg );
else
- msi_dialog_send_event( dialog, event, arg );
+ dialog_send_event( dialog, event, arg );
}
return ERROR_SUCCESS;
}
-static UINT msi_dialog_button_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_button_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
MSIQUERY *view;
UINT r;
ERR("query failed\n");
return ERROR_SUCCESS;
}
- r = MSI_IterateRecords( view, 0, msi_dialog_control_event, dialog );
+ r = MSI_IterateRecords( view, 0, dialog_control_event, dialog );
msiobj_release( &view->hdr );
/* dialog control events must be processed last regardless of ordering */
{
r = dialog->pending_event( dialog, dialog->pending_argument );
- msi_free( dialog->pending_argument );
+ free( dialog->pending_argument );
dialog->pending_event = NULL;
dialog->pending_argument = NULL;
}
return r;
}
-static HBITMAP msi_load_picture( MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags )
+static HBITMAP load_picture( MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags )
{
HBITMAP hOleBitmap = 0, hBitmap = 0, hOldSrcBitmap, hOldDestBitmap;
MSIRECORD *rec = NULL;
return hBitmap;
}
-static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_button_control( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
UINT attributes, style, cx = 0, cy = 0, flags = 0;
WCHAR *name = NULL;
if (attributes & msidbControlAttributesFixedSize) flags |= LR_DEFAULTSIZE;
else
{
- cx = msi_dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 6) );
- cy = msi_dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 7) );
+ cx = dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 6) );
+ cy = dialog_scale_unit( dialog, MSI_RecordGetInteger(rec, 7) );
}
}
- control = msi_dialog_add_control( dialog, rec, L"BUTTON", style );
+ control = dialog_add_control( dialog, rec, L"BUTTON", style );
if (!control)
return ERROR_FUNCTION_FAILED;
- control->handler = msi_dialog_button_handler;
+ control->handler = dialog_button_handler;
if (attributes & msidbControlAttributesIcon)
{
- name = msi_get_binary_name( dialog->package, rec );
- control->hIcon = msi_load_icon( dialog->package->db, name, attributes );
+ name = get_binary_name( dialog->package, rec );
+ control->hIcon = load_icon( dialog->package->db, name, attributes );
if (control->hIcon)
{
SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon );
}
else if (attributes & msidbControlAttributesBitmap)
{
- name = msi_get_binary_name( dialog->package, rec );
- control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags );
+ name = get_binary_name( dialog->package, rec );
+ control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
if (control->hBitmap)
{
SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap );
else ERR("Failed to load bitmap %s\n", debugstr_w(name));
}
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
-static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop )
+static WCHAR *get_checkbox_value( msi_dialog *dialog, const WCHAR *prop )
{
MSIRECORD *rec = NULL;
LPWSTR ret = NULL;
if (!rec)
return ret;
- ret = msi_get_deformatted_field( dialog->package, rec, 2 );
+ ret = get_deformatted_field( dialog->package, rec, 2 );
if( ret && !ret[0] )
{
- msi_free( ret );
+ free( ret );
ret = NULL;
}
msiobj_release( &rec->hdr );
ret = msi_dup_property( dialog->package->db, prop );
if( ret && !ret[0] )
{
- msi_free( ret );
+ free( ret );
ret = NULL;
}
return ret;
}
-static UINT msi_dialog_get_checkbox_state( msi_dialog *dialog, msi_control *control )
+static UINT dialog_get_checkbox_state( msi_dialog *dialog, struct control *control )
{
WCHAR state[2] = {0};
DWORD sz = 2;
return state[0] ? 1 : 0;
}
-static void msi_dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, UINT state )
+static void dialog_set_checkbox_state( msi_dialog *dialog, struct control *control, UINT state )
{
LPCWSTR val;
/* if uncheck then the property is set to NULL */
if (!state)
{
- msi_dialog_set_property( dialog->package, control->property, NULL );
+ dialog_set_property( dialog->package, control->property, NULL );
return;
}
else
val = L"1";
- msi_dialog_set_property( dialog->package, control->property, val );
+ dialog_set_property( dialog->package, control->property, val );
}
-static void msi_dialog_checkbox_sync_state( msi_dialog *dialog, msi_control *control )
+static void dialog_checkbox_sync_state( msi_dialog *dialog, struct control *control )
{
- UINT state = msi_dialog_get_checkbox_state( dialog, control );
+ UINT state = dialog_get_checkbox_state( dialog, control );
SendMessageW( control->hwnd, BM_SETCHECK, state ? BST_CHECKED : BST_UNCHECKED, 0 );
}
-static UINT msi_dialog_checkbox_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_checkbox_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
UINT state;
TRACE("clicked checkbox %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- state = msi_dialog_get_checkbox_state( dialog, control );
+ state = dialog_get_checkbox_state( dialog, control );
state = state ? 0 : 1;
- msi_dialog_set_checkbox_state( dialog, control, state );
- msi_dialog_checkbox_sync_state( dialog, control );
+ dialog_set_checkbox_state( dialog, control, state );
+ dialog_checkbox_sync_state( dialog, control );
- return msi_dialog_button_handler( dialog, control, param );
+ return dialog_button_handler( dialog, control, param );
}
-static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, L"BUTTON", BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP );
- control->handler = msi_dialog_checkbox_handler;
- control->update = msi_dialog_checkbox_sync_state;
+ control = dialog_add_control( dialog, rec, L"BUTTON", BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP );
+ control->handler = dialog_checkbox_handler;
+ control->update = dialog_checkbox_sync_state;
prop = MSI_RecordGetString( rec, 9 );
if (prop)
{
- control->property = strdupW( prop );
- control->value = msi_get_checkbox_value( dialog, prop );
+ control->property = wcsdup( prop );
+ control->value = get_checkbox_value( dialog, prop );
TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value));
}
- msi_dialog_checkbox_sync_state( dialog, control );
+ dialog_checkbox_sync_state( dialog, control );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
{
- DWORD attributes;
- LPCWSTR name;
- DWORD style, exstyle = 0;
- DWORD x, y, width, height;
- msi_control *control;
-
- TRACE("%p %p\n", dialog, rec);
-
- style = WS_CHILD | SS_ETCHEDHORZ | SS_SUNKEN;
-
- name = MSI_RecordGetString( rec, 2 );
- attributes = MSI_RecordGetInteger( rec, 8 );
-
- if( attributes & msidbControlAttributesVisible )
- style |= WS_VISIBLE;
- if( ~attributes & msidbControlAttributesEnabled )
- style |= WS_DISABLED;
- if( attributes & msidbControlAttributesSunken )
- exstyle |= WS_EX_CLIENTEDGE;
-
- dialog_map_events( dialog, name );
-
- control = msi_alloc( FIELD_OFFSET(msi_control, name[lstrlenW( name ) + 1] ));
- if (!control)
- return ERROR_OUTOFMEMORY;
-
- lstrcpyW( control->name, name );
- list_add_head( &dialog->controls, &control->entry );
- control->handler = NULL;
- control->property = NULL;
- control->value = NULL;
- control->hBitmap = NULL;
- control->hIcon = NULL;
- control->hDll = NULL;
- control->tabnext = strdupW( MSI_RecordGetString( rec, 11) );
- control->type = strdupW( MSI_RecordGetString( rec, 3 ) );
- control->progress_current = 0;
- control->progress_max = 100;
- control->progress_backwards = FALSE;
-
- x = MSI_RecordGetInteger( rec, 4 );
- y = MSI_RecordGetInteger( rec, 5 );
- width = MSI_RecordGetInteger( rec, 6 );
-
- x = msi_dialog_scale_unit( dialog, x );
- y = msi_dialog_scale_unit( dialog, y );
- width = msi_dialog_scale_unit( dialog, width );
- height = 2; /* line is exactly 2 units in height */
-
- control->hwnd = CreateWindowExW( exstyle, L"Static", NULL, style,
- x, y, width, height, dialog->hwnd, NULL, NULL, NULL );
-
- TRACE("Dialog %s control %s hwnd %p\n",
- debugstr_w(dialog->name), debugstr_w(name), control->hwnd );
+ if (!dialog_add_control( dialog, rec, L"Static", SS_ETCHEDHORZ | SS_SUNKEN))
+ return ERROR_FUNCTION_FAILED;
return ERROR_SUCCESS;
}
struct msi_scrolltext_info
{
msi_dialog *dialog;
- msi_control *control;
+ struct control *control;
WNDPROC oldproc;
};
-static LRESULT WINAPI
-MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT WINAPI MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct msi_scrolltext_info *info;
HRESULT r;
case WM_GETDLGCODE:
return DLGC_WANTARROWS;
case WM_NCDESTROY:
- msi_free( info );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
case WM_PAINT:
/* native MSI sets a wait cursor here */
- msi_dialog_button_handler( info->dialog, info->control, BN_CLICKED );
+ dialog_button_handler( info->dialog, info->control, BN_CLICKED );
break;
}
return r;
DWORD length;
};
-static DWORD CALLBACK
-msi_richedit_stream_in( DWORD_PTR arg, LPBYTE buffer, LONG count, LONG *pcb )
+static DWORD CALLBACK richedit_stream_in( DWORD_PTR arg, BYTE *buffer, LONG count, LONG *pcb )
{
struct msi_streamin_info *info = (struct msi_streamin_info*) arg;
return 0;
}
-static void msi_scrolltext_add_text( msi_control *control, LPCWSTR text )
+static void scrolltext_add_text( struct control *control, const WCHAR *text )
{
struct msi_streamin_info info;
EDITSTREAM es;
es.dwCookie = (DWORD_PTR) &info;
es.dwError = 0;
- es.pfnCallback = msi_richedit_stream_in;
+ es.pfnCallback = richedit_stream_in;
SendMessageW( control->hwnd, EM_STREAMIN, SF_RTF, (LPARAM) &es );
- msi_free( info.string );
+ free( info.string );
}
-static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
{
struct msi_scrolltext_info *info;
- msi_control *control;
+ struct control *control;
HMODULE hRichedit;
LPCWSTR text;
DWORD style;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return ERROR_FUNCTION_FAILED;
style = WS_BORDER | ES_MULTILINE | WS_VSCROLL |
ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP;
- control = msi_dialog_add_control( dialog, rec, L"RichEdit20W", style );
+ control = dialog_add_control( dialog, rec, L"RichEdit20W", style );
if (!control)
{
FreeLibrary( hRichedit );
- msi_free( info );
+ free( info );
return ERROR_FUNCTION_FAILED;
}
/* add the text into the richedit */
text = MSI_RecordGetString( rec, 10 );
if (text)
- msi_scrolltext_add_text( control, text );
+ scrolltext_add_text( control, text );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec )
{
UINT cx, cy, flags, style, attributes;
- msi_control *control;
+ struct control *control;
LPWSTR name;
flags = LR_LOADFROMFILE;
style |= SS_CENTERIMAGE;
}
- control = msi_dialog_add_control( dialog, rec, L"Static", style );
+ control = dialog_add_control( dialog, rec, L"Static", style );
cx = MSI_RecordGetInteger( rec, 6 );
cy = MSI_RecordGetInteger( rec, 7 );
- cx = msi_dialog_scale_unit( dialog, cx );
- cy = msi_dialog_scale_unit( dialog, cy );
+ cx = dialog_scale_unit( dialog, cx );
+ cy = dialog_scale_unit( dialog, cy );
- name = msi_get_binary_name( dialog->package, rec );
- control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags );
+ name = get_binary_name( dialog->package, rec );
+ control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
if( control->hBitmap )
SendMessageW( control->hwnd, STM_SETIMAGE,
IMAGE_BITMAP, (LPARAM) control->hBitmap );
else
ERR("Failed to load bitmap %s\n", debugstr_w(name));
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
DWORD attributes;
LPWSTR name;
TRACE("\n");
- control = msi_dialog_add_control( dialog, rec, L"Static",
- SS_ICON | SS_CENTERIMAGE | WS_GROUP );
+ control = dialog_add_control( dialog, rec, L"Static", SS_ICON | SS_CENTERIMAGE | WS_GROUP );
attributes = MSI_RecordGetInteger( rec, 8 );
- name = msi_get_binary_name( dialog->package, rec );
- control->hIcon = msi_load_icon( dialog->package->db, name, attributes );
+ name = get_binary_name( dialog->package, rec );
+ control->hIcon = load_icon( dialog->package->db, name, attributes );
if( control->hIcon )
SendMessageW( control->hwnd, STM_SETICON, (WPARAM) control->hIcon, 0 );
else
ERR("Failed to load bitmap %s\n", debugstr_w(name));
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
{
case WM_NCDESTROY:
for (j = 0; j < info->num_items; j++)
- msi_free( info->items[j] );
- msi_free( info->items );
- msi_free( info );
+ free( info->items[j] );
+ free( info->items );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
}
return r;
}
-static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param )
+static UINT combobox_add_item( MSIRECORD *rec, void *param )
{
struct msi_combobox_info *info = param;
LPCWSTR value, text;
value = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 4 );
- info->items[info->addpos_items] = strdupW( value );
+ info->items[info->addpos_items] = wcsdup( value );
pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
return ERROR_SUCCESS;
}
-static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR property )
+static UINT combobox_add_items( struct msi_combobox_info *info, const WCHAR *property )
{
MSIQUERY *view;
DWORD count;
return r;
}
info->num_items = count;
- info->items = msi_alloc( sizeof(*info->items) * count );
+ info->items = malloc( sizeof(*info->items) * count );
- r = MSI_IterateRecords( view, NULL, msi_combobox_add_item, info );
+ r = MSI_IterateRecords( view, NULL, combobox_add_item, info );
msiobj_release( &view->hdr );
return r;
}
-static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param )
+static UINT dialog_set_control_condition( MSIRECORD *rec, void *param )
{
msi_dialog *dialog = param;
- msi_control *control;
+ struct control *control;
LPCWSTR name, action, condition;
UINT r;
action = MSI_RecordGetString( rec, 3 );
condition = MSI_RecordGetString( rec, 4 );
r = MSI_EvaluateConditionW( dialog->package, condition );
- control = msi_dialog_find_control( dialog, name );
+ control = dialog_find_control( dialog, name );
if (r == MSICONDITION_TRUE && control)
{
TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
return ERROR_SUCCESS;
}
-static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog )
+static UINT dialog_evaluate_control_conditions( msi_dialog *dialog )
{
UINT r;
MSIQUERY *view;
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
- r = MSI_IterateRecords( view, 0, msi_dialog_set_control_condition, dialog );
+ r = MSI_IterateRecords( view, 0, dialog_set_control_condition, dialog );
msiobj_release( &view->hdr );
return r;
}
-static UINT msi_dialog_combobox_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_combobox_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
struct msi_combobox_info *info;
int index;
info = GetPropW( control->hwnd, L"MSIDATA" );
index = SendMessageW( control->hwnd, CB_GETCURSEL, 0, 0 );
if (index == CB_ERR)
- value = msi_get_window_text( control->hwnd );
+ value = get_window_text( control->hwnd );
else
value = (LPWSTR) SendMessageW( control->hwnd, CB_GETITEMDATA, index, 0 );
- msi_dialog_set_property( info->dialog->package, control->property, value );
- msi_dialog_evaluate_control_conditions( info->dialog );
+ dialog_set_property( info->dialog->package, control->property, value );
+ dialog_evaluate_control_conditions( info->dialog );
if (index == CB_ERR)
- msi_free( value );
+ free( value );
return ERROR_SUCCESS;
}
-static void msi_dialog_combobox_update( msi_dialog *dialog, msi_control *control )
+static void dialog_combobox_update( msi_dialog *dialog, struct control *control )
{
struct msi_combobox_info *info;
LPWSTR value, tmp;
SetWindowTextW( control->hwnd, value );
}
- msi_free(value);
+ free( value );
}
-static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec )
{
struct msi_combobox_info *info;
- msi_control *control;
+ struct control *control;
DWORD attributes, style;
LPCWSTR prop;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return ERROR_FUNCTION_FAILED;
else
style |= CBS_DROPDOWN;
- control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
+ control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
if (!control)
{
- msi_free( info );
+ free( info );
return ERROR_FUNCTION_FAILED;
}
- control->handler = msi_dialog_combobox_handler;
- control->update = msi_dialog_combobox_update;
+ control->handler = dialog_combobox_handler;
+ control->update = dialog_combobox_update;
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */
info->dialog = dialog;
SetPropW( control->hwnd, L"MSIDATA", info );
if (control->property)
- msi_combobox_add_items( info, control->property );
+ combobox_add_items( info, control->property );
- msi_dialog_combobox_update( dialog, control );
+ dialog_combobox_update( dialog, control );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_edit_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_edit_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
LPWSTR buf;
TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- buf = msi_get_window_text( control->hwnd );
- msi_dialog_set_property( dialog->package, control->property, buf );
- msi_free( buf );
+ buf = get_window_text( control->hwnd );
+ dialog_set_property( dialog->package, control->property, buf );
+ free( buf );
return ERROR_SUCCESS;
}
/* length of 2^32 + 1 */
#define MAX_NUM_DIGITS 11
-static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop, text;
LPWSTR val, begin, end;
WCHAR num[MAX_NUM_DIGITS];
DWORD limit;
- control = msi_dialog_add_control( dialog, rec, L"Edit",
- WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL );
- control->handler = msi_dialog_edit_handler;
+ control = dialog_add_control( dialog, rec, L"Edit", WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL );
+ control->handler = dialog_edit_handler;
text = MSI_RecordGetString( rec, 10 );
if ( text )
prop = MSI_RecordGetString( rec, 9 );
if( prop )
- control->property = strdupW( prop );
+ control->property = wcsdup( prop );
val = msi_dup_property( dialog->package->db, control->property );
SetWindowTextW( control->hwnd, val );
- msi_free( val );
+ free( val );
return ERROR_SUCCESS;
}
struct msi_mask_group group[MASK_MAX_GROUPS];
};
-static BOOL msi_mask_editable( WCHAR type )
+static BOOL mask_editable( WCHAR type )
{
switch (type)
{
return FALSE;
}
-static void msi_mask_control_change( struct msi_maskedit_info *info )
+static void mask_control_change( struct msi_maskedit_info *info )
{
LPWSTR val;
UINT i, n, r;
- val = msi_alloc( (info->num_chars+1)*sizeof(WCHAR) );
+ val = malloc( (info->num_chars + 1) * sizeof(WCHAR) );
for( i=0, n=0; i<info->num_groups; i++ )
{
if (info->group[i].len == ~0u)
{
UINT len = SendMessageW( info->group[i].hwnd, WM_GETTEXTLENGTH, 0, 0 );
- val = msi_realloc( val, (len + 1) * sizeof(WCHAR) );
+ val = realloc( val, (len + 1) * sizeof(WCHAR) );
GetWindowTextW( info->group[i].hwnd, val, len + 1 );
}
else
ERR("can't fit control %d text into template\n",i);
break;
}
- if (!msi_mask_editable(info->group[i].type))
+ if (!mask_editable(info->group[i].type))
{
for(r=0; r<info->group[i].len; r++)
val[n+r] = info->group[i].type;
if( i == info->num_groups )
{
TRACE("Set property %s to %s\n", debugstr_w(info->prop), debugstr_w(val));
- msi_dialog_set_property( info->dialog->package, info->prop, val );
- msi_dialog_evaluate_control_conditions( info->dialog );
+ dialog_set_property( info->dialog->package, info->prop, val );
+ dialog_evaluate_control_conditions( info->dialog );
}
- msi_free( val );
+ free( val );
}
/* now move to the next control if necessary */
-static VOID msi_mask_next_control( struct msi_maskedit_info *info, HWND hWnd )
+static void mask_next_control( struct msi_maskedit_info *info, HWND hWnd )
{
HWND hWndNext;
UINT len, i;
SetFocus( hWndNext );
}
-static LRESULT WINAPI
-MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT WINAPI MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct msi_maskedit_info *info;
HRESULT r;
case WM_COMMAND:
if (HIWORD(wParam) == EN_CHANGE)
{
- msi_mask_control_change( info );
- msi_mask_next_control( info, (HWND) lParam );
+ mask_control_change( info );
+ mask_next_control( info, (HWND) lParam );
}
break;
case WM_NCDESTROY:
- msi_free( info->prop );
- msi_free( info );
+ free( info->prop );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
}
}
/* fish the various bits of the property out and put them in the control */
-static void
-msi_maskedit_set_text( struct msi_maskedit_info *info, LPCWSTR text )
+static void maskedit_set_text( struct msi_maskedit_info *info, const WCHAR *text )
{
LPCWSTR p;
UINT i;
{
if( info->group[i].len < lstrlenW( p ) )
{
- LPWSTR chunk = strdupW( p );
+ WCHAR *chunk = wcsdup( p );
chunk[ info->group[i].len ] = 0;
SetWindowTextW( info->group[i].hwnd, chunk );
- msi_free( chunk );
+ free( chunk );
}
else
{
}
}
-static struct msi_maskedit_info * msi_dialog_parse_groups( LPCWSTR mask )
+static struct msi_maskedit_info *dialog_parse_groups( const WCHAR *mask )
{
struct msi_maskedit_info *info;
int i = 0, n = 0, total = 0;
if( !mask )
return NULL;
- info = msi_alloc_zero( sizeof *info );
+ info = calloc( 1, sizeof *info );
if( !info )
return info;
return info;
}
-static void
-msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
+static void maskedit_create_children( struct msi_maskedit_info *info, const WCHAR *font )
{
DWORD width, height, style, wx, ww;
RECT rect;
for( i = 0; i < info->num_groups; i++ )
{
- if (!msi_mask_editable( info->group[i].type ))
+ if (!mask_editable( info->group[i].type ))
continue;
if (info->num_chars)
{
SendMessageW( hwnd, EM_LIMITTEXT, info->group[i].len, 0 );
- msi_dialog_set_font( info->dialog, hwnd,
- font?font:info->dialog->default_font );
+ dialog_set_font( info->dialog, hwnd, font?font:info->dialog->default_font );
info->group[i].hwnd = hwnd;
}
}
* delphi 7 uses "<????-??????-??????-????>" and "<???-???>"
* filemaker pro 7 uses "<^^^^=^^^^=^^^^=^^^^=^^^^=^^^^=^^^^^>"
*/
-static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
{
LPWSTR font_mask, val = NULL, font;
struct msi_maskedit_info *info = NULL;
UINT ret = ERROR_SUCCESS;
- msi_control *control;
+ struct control *control;
LPCWSTR prop, mask;
TRACE("\n");
- font_mask = msi_get_deformatted_field( dialog->package, rec, 10 );
- font = msi_dialog_get_style( font_mask, &mask );
+ font_mask = get_deformatted_field( dialog->package, rec, 10 );
+ font = dialog_get_style( font_mask, &mask );
if( !mask )
{
WARN("mask template is empty\n");
goto end;
}
- info = msi_dialog_parse_groups( mask );
+ info = dialog_parse_groups( mask );
if( !info )
{
ERR("template %s is invalid\n", debugstr_w(mask));
info->dialog = dialog;
- control = msi_dialog_add_control( dialog, rec, L"Static",
- SS_OWNERDRAW | WS_GROUP | WS_VISIBLE );
+ control = dialog_add_control( dialog, rec, L"Static", SS_OWNERDRAW | WS_GROUP | WS_VISIBLE );
if( !control )
{
ERR("Failed to create maskedit container\n");
prop = MSI_RecordGetString( rec, 9 );
if( prop )
- info->prop = strdupW( prop );
+ info->prop = wcsdup( prop );
- msi_maskedit_create_children( info, font );
+ maskedit_create_children( info, font );
if( prop )
{
val = msi_dup_property( dialog->package->db, prop );
if( val )
{
- msi_maskedit_set_text( info, val );
- msi_free( val );
+ maskedit_set_text( info, val );
+ free( val );
}
}
end:
if( ret != ERROR_SUCCESS )
- msi_free( info );
- msi_free( font_mask );
- msi_free( font );
+ free( info );
+ free( font_mask );
+ free( font );
return ret;
}
/******************** Progress Bar *****************************************/
-static UINT msi_dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
DWORD attributes, style;
style = WS_VISIBLE;
if( !(attributes & msidbControlAttributesProgress95) )
style |= PBS_SMOOTH;
- control = msi_dialog_add_control( dialog, rec, PROGRESS_CLASSW, style );
+ control = dialog_add_control( dialog, rec, PROGRESS_CLASSW, style );
if( !control )
return ERROR_FUNCTION_FAILED;
struct msi_pathedit_info
{
msi_dialog *dialog;
- msi_control *control;
+ struct control *control;
WNDPROC oldproc;
};
-static WCHAR *get_path_property( msi_dialog *dialog, msi_control *control )
+static WCHAR *get_path_property( msi_dialog *dialog, struct control *control )
{
WCHAR *prop, *path;
BOOL indirect = control->attributes & msidbControlAttributesIndirect;
- if (!(prop = msi_dialog_dup_property( dialog, control->property, indirect ))) return NULL;
- path = msi_dialog_dup_property( dialog, prop, TRUE );
- msi_free( prop );
+ if (!(prop = dialog_dup_property( dialog, control->property, indirect ))) return NULL;
+ path = dialog_dup_property( dialog, prop, TRUE );
+ free( prop );
return path;
}
-static void msi_dialog_update_pathedit( msi_dialog *dialog, msi_control *control )
+static void dialog_update_pathedit( msi_dialog *dialog, struct control *control )
{
WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"PathEdit" )))
+ if (!control && !(control = dialog_find_control_by_type( dialog, L"PathEdit" )))
return;
if (!(path = get_path_property( dialog, control ))) return;
SetWindowTextW( control->hwnd, path );
SendMessageW( control->hwnd, EM_SETSEL, 0, -1 );
- msi_free( path );
+ free( path );
}
/* FIXME: test when this should fail */
-static BOOL msi_dialog_verify_path( LPWSTR path )
+static BOOL dialog_verify_path( const WCHAR *path )
{
if ( !path[0] )
return FALSE;
}
/* returns TRUE if the path is valid, FALSE otherwise */
-static BOOL msi_dialog_onkillfocus( msi_dialog *dialog, msi_control *control )
+static BOOL dialog_onkillfocus( msi_dialog *dialog, struct control *control )
{
LPWSTR buf, prop;
BOOL indirect;
BOOL valid;
indirect = control->attributes & msidbControlAttributesIndirect;
- prop = msi_dialog_dup_property( dialog, control->property, indirect );
+ prop = dialog_dup_property( dialog, control->property, indirect );
- buf = msi_get_window_text( control->hwnd );
+ buf = get_window_text( control->hwnd );
- if ( !msi_dialog_verify_path( buf ) )
+ if ( !dialog_verify_path( buf ) )
{
/* FIXME: display an error message box */
ERR("Invalid path %s\n", debugstr_w( buf ));
else
{
valid = TRUE;
- msi_dialog_set_property( dialog->package, prop, buf );
+ dialog_set_property( dialog->package, prop, buf );
}
- msi_dialog_update_pathedit( dialog, control );
+ dialog_update_pathedit( dialog, control );
TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name),
debugstr_w(prop));
- msi_free( buf );
- msi_free( prop );
+ free( buf );
+ free( prop );
return valid;
}
if ( msg == WM_KILLFOCUS )
{
/* if the path is invalid, don't handle this message */
- if ( !msi_dialog_onkillfocus( info->dialog, info->control ) )
+ if ( !dialog_onkillfocus( info->dialog, info->control ) )
return 0;
}
if ( msg == WM_NCDESTROY )
{
- msi_free( info );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
}
return r;
}
-static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec )
{
struct msi_pathedit_info *info;
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return ERROR_FUNCTION_FAILED;
- control = msi_dialog_add_control( dialog, rec, L"Edit",
- WS_BORDER | WS_TABSTOP );
+ control = dialog_add_control( dialog, rec, L"Edit", WS_BORDER | WS_TABSTOP );
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
- control->update = msi_dialog_update_pathedit;
+ control->property = dialog_dup_property( dialog, prop, FALSE );
+ control->update = dialog_update_pathedit;
info->dialog = dialog;
info->control = control;
(LONG_PTR)MSIPathEdit_WndProc );
SetPropW( control->hwnd, L"MSIDATA", info );
- msi_dialog_update_pathedit( dialog, control );
+ dialog_update_pathedit( dialog, control );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_radiogroup_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_radiogroup_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
if (HIWORD(param) != BN_CLICKED)
return ERROR_SUCCESS;
TRACE("clicked radio button %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
- msi_dialog_set_property( dialog->package, control->property, control->name );
+ dialog_set_property( dialog->package, control->property, control->name );
- return msi_dialog_button_handler( dialog, control, param );
+ return dialog_button_handler( dialog, control, param );
}
/* radio buttons are a bit different from normal controls */
-static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param )
+static UINT dialog_create_radiobutton( MSIRECORD *rec, void *param )
{
- radio_button_group_descr *group = param;
+ struct radio_button_group_descr *group = param;
msi_dialog *dialog = group->dialog;
- msi_control *control;
+ struct control *control;
LPCWSTR prop, text, name;
DWORD style = WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON | BS_MULTILINE;
group->parent->hwnd );
if (!control)
return ERROR_FUNCTION_FAILED;
- control->handler = msi_dialog_radiogroup_handler;
+ control->handler = dialog_radiogroup_handler;
if (group->propval && !wcscmp( control->name, group->propval ))
SendMessageW(control->hwnd, BM_SETCHECK, BST_CHECKED, 0);
prop = MSI_RecordGetString( rec, 1 );
if( prop )
- control->property = strdupW( prop );
+ control->property = wcsdup( prop );
return ERROR_SUCCESS;
}
-static BOOL CALLBACK msi_radioground_child_enum( HWND hWnd, LPARAM lParam )
+static BOOL CALLBACK radioground_child_enum( HWND hWnd, LPARAM lParam )
{
EnableWindow( hWnd, lParam );
return TRUE;
/* make sure the radio buttons show as disabled if the parent is disabled */
if (msg == WM_ENABLE)
- EnumChildWindows( hWnd, msi_radioground_child_enum, wParam );
+ EnumChildWindows( hWnd, radioground_child_enum, wParam );
return r;
}
-static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
{
UINT r;
LPCWSTR prop;
- msi_control *control;
+ struct control *control;
MSIQUERY *view;
- radio_button_group_descr group;
+ struct radio_button_group_descr group;
MSIPACKAGE *package = dialog->package;
WNDPROC oldproc;
DWORD attr, style = WS_GROUP;
style |= BS_OWNERDRAW;
/* Create parent group box to hold radio buttons */
- control = msi_dialog_add_control( dialog, rec, L"BUTTON", style );
+ control = dialog_add_control( dialog, rec, L"BUTTON", style );
if( !control )
return ERROR_FUNCTION_FAILED;
SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT );
if( prop )
- control->property = strdupW( prop );
+ control->property = wcsdup( prop );
/* query the Radio Button table for all control in this group */
r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
group.parent = control;
group.propval = msi_dup_property( dialog->package->db, control->property );
- r = MSI_IterateRecords( view, 0, msi_dialog_create_radiobutton, &group );
+ r = MSI_IterateRecords( view, 0, dialog_create_radiobutton, &group );
msiobj_release( &view->hdr );
- msi_free( group.propval );
+ free( group.propval );
return r;
}
-static void
-msi_seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem )
+static void seltree_sync_item_state( HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem )
{
TVITEMW tvi;
DWORD index = feature->ActionRequest;
SendMessageW( hwnd, TVM_SETITEMW, 0, (LPARAM) &tvi );
}
-static UINT
-msi_seltree_popup_menu( HWND hwnd, INT x, INT y )
+static UINT seltree_popup_menu( HWND hwnd, INT x, INT y )
{
HMENU hMenu;
INT r;
return r;
}
-static void
-msi_seltree_update_feature_installstate( HWND hwnd, HTREEITEM hItem,
- MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state )
+static void seltree_update_feature_installstate( HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package,
+ MSIFEATURE *feature, INSTALLSTATE state )
{
feature->ActionRequest = state;
- msi_seltree_sync_item_state( hwnd, feature, hItem );
+ seltree_sync_item_state( hwnd, feature, hItem );
ACTION_UpdateComponentStates( package, feature );
}
-static void
-msi_seltree_update_siblings_and_children_installstate( HWND hwnd, HTREEITEM curr,
- MSIPACKAGE *package, INSTALLSTATE state)
+static void seltree_update_siblings_and_children_installstate( HWND hwnd, HTREEITEM curr, MSIPACKAGE *package,
+ INSTALLSTATE state )
{
/* update all siblings */
do
MSIFEATURE *feature;
HTREEITEM child;
- feature = msi_seltree_feature_from_item( hwnd, curr );
- msi_seltree_update_feature_installstate( hwnd, curr, package, feature, state );
+ feature = seltree_feature_from_item( hwnd, curr );
+ seltree_update_feature_installstate( hwnd, curr, package, feature, state );
/* update this sibling's children */
child = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_CHILD, (LPARAM)curr );
if (child)
- msi_seltree_update_siblings_and_children_installstate( hwnd, child,
- package, state );
+ seltree_update_siblings_and_children_installstate( hwnd, child, package, state );
}
while ((curr = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)curr )));
}
-static LRESULT
-msi_seltree_menu( HWND hwnd, HTREEITEM hItem )
+static LRESULT seltree_menu( HWND hwnd, HTREEITEM hItem )
{
struct msi_selection_tree_info *info;
MSIFEATURE *feature;
info = GetPropW(hwnd, L"MSIDATA");
package = info->dialog->package;
- feature = msi_seltree_feature_from_item( hwnd, hItem );
+ feature = seltree_feature_from_item( hwnd, hItem );
if (!feature)
{
ERR("item %p feature was NULL\n", hItem);
SendMessageW( hwnd, TVM_GETITEMRECT, 0, (LPARAM) &u.rc );
MapWindowPoints( hwnd, NULL, u.pt, 2 );
- r = msi_seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
+ r = seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
switch (r)
{
HTREEITEM child;
child = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_CHILD, (LPARAM)hItem );
if (child)
- msi_seltree_update_siblings_and_children_installstate( hwnd, child, package, r );
+ seltree_update_siblings_and_children_installstate( hwnd, child, package, r );
}
/* fall-through */
case INSTALLSTATE_LOCAL:
- msi_seltree_update_feature_installstate( hwnd, hItem, package, feature, r );
+ seltree_update_feature_installstate( hwnd, hItem, package, feature, r );
break;
}
return 0;
}
-static LRESULT WINAPI
-MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct msi_selection_tree_info *info;
TVHITTESTINFO tvhti;
tvhti.hItem = 0;
CallWindowProcW(info->oldproc, hWnd, TVM_HITTEST, 0, (LPARAM) &tvhti );
if (tvhti.flags & TVHT_ONITEMSTATEICON)
- return msi_seltree_menu( hWnd, tvhti.hItem );
+ return seltree_menu( hWnd, tvhti.hItem );
break;
}
r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
switch( msg )
{
case WM_NCDESTROY:
- msi_free( info );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
}
return r;
}
-static void
-msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd,
- LPCWSTR parent, HTREEITEM hParent )
+static void seltree_add_child_features( MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent )
{
struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" );
MSIFEATURE *feature;
memset( &tvis, 0, sizeof tvis );
tvis.hParent = hParent;
tvis.hInsertAfter = TVI_LAST;
- tvis.u.item.mask = TVIF_TEXT | TVIF_PARAM;
- tvis.u.item.pszText = feature->Title;
- tvis.u.item.lParam = (LPARAM) feature;
+ tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
+ tvis.item.pszText = feature->Title;
+ tvis.item.lParam = (LPARAM) feature;
hitem = (HTREEITEM) SendMessageW( hwnd, TVM_INSERTITEMW, 0, (LPARAM) &tvis );
if (!hitem)
if (!hfirst)
hfirst = hitem;
- msi_seltree_sync_item_state( hwnd, feature, hitem );
- msi_seltree_add_child_features( package, hwnd,
+ seltree_sync_item_state( hwnd, feature, hitem );
+ seltree_add_child_features( package, hwnd,
feature->Feature, hitem );
/* the node is expanded if Display is odd */
info->selected = hfirst;
}
-static void msi_seltree_create_imagelist( HWND hwnd )
+static void seltree_create_imagelist( HWND hwnd )
{
const int bm_width = 32, bm_height = 16, bm_count = 3;
const int bm_resource = 0x1001;
SendMessageW( hwnd, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)himl );
}
-static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
- msi_control *control, WPARAM param )
+static UINT dialog_seltree_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param;
if (!(tv->itemNew.mask & TVIF_TEXT))
{
- feature = msi_seltree_feature_from_item( control->hwnd, tv->itemNew.hItem );
+ feature = seltree_feature_from_item( control->hwnd, tv->itemNew.hItem );
if (feature)
title = feature->Title;
}
return r;
}
-static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop, control_name;
MSIPACKAGE *package = dialog->package;
DWORD style;
struct msi_selection_tree_info *info;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return ERROR_FUNCTION_FAILED;
/* create the treeview control */
style = TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT;
style |= WS_GROUP | WS_VSCROLL | WS_TABSTOP;
- control = msi_dialog_add_control( dialog, rec, WC_TREEVIEWW, style );
+ control = dialog_add_control( dialog, rec, WC_TREEVIEWW, style );
if (!control)
{
- msi_free(info);
+ free(info);
return ERROR_FUNCTION_FAILED;
}
- control->handler = msi_dialog_seltree_handler;
+ control->handler = dialog_seltree_handler;
control_name = MSI_RecordGetString( rec, 2 );
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */
info->dialog = dialog;
event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
/* initialize it */
- msi_seltree_create_imagelist( control->hwnd );
- msi_seltree_add_child_features( package, control->hwnd, NULL, NULL );
+ seltree_create_imagelist( control->hwnd );
+ seltree_add_child_features( package, control->hwnd, NULL, NULL );
return ERROR_SUCCESS;
}
/******************** Group Box ***************************************/
-static UINT msi_dialog_group_box( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_group_box( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
DWORD style;
style = BS_GROUPBOX | WS_CHILD | WS_GROUP;
- control = msi_dialog_add_control( dialog, rec, WC_BUTTONW, style );
+ control = dialog_add_control( dialog, rec, WC_BUTTONW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
{
case WM_NCDESTROY:
for (j = 0; j < info->num_items; j++)
- msi_free( info->items[j] );
- msi_free( info->items );
- msi_free( info );
+ free( info->items[j] );
+ free( info->items );
+ free( info );
RemovePropW( hWnd, L"MSIDATA" );
break;
}
return r;
}
-static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param )
+static UINT listbox_add_item( MSIRECORD *rec, void *param )
{
struct msi_listbox_info *info = param;
LPCWSTR value, text;
value = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 4 );
- info->items[info->addpos_items] = strdupW( value );
+ info->items[info->addpos_items] = wcsdup( value );
pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
return ERROR_SUCCESS;
}
-static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR property )
+static UINT listbox_add_items( struct msi_listbox_info *info, const WCHAR *property )
{
MSIQUERY *view;
DWORD count;
return r;
}
info->num_items = count;
- info->items = msi_alloc( sizeof(*info->items) * count );
+ info->items = malloc( sizeof(*info->items) * count );
- r = MSI_IterateRecords( view, NULL, msi_listbox_add_item, info );
+ r = MSI_IterateRecords( view, NULL, listbox_add_item, info );
msiobj_release( &view->hdr );
return r;
}
-static UINT msi_dialog_listbox_handler( msi_dialog *dialog,
- msi_control *control, WPARAM param )
+static UINT dialog_listbox_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
struct msi_listbox_info *info;
int index;
index = SendMessageW( control->hwnd, LB_GETCURSEL, 0, 0 );
value = (LPCWSTR) SendMessageW( control->hwnd, LB_GETITEMDATA, index, 0 );
- msi_dialog_set_property( info->dialog->package, control->property, value );
- msi_dialog_evaluate_control_conditions( info->dialog );
+ dialog_set_property( info->dialog->package, control->property, value );
+ dialog_evaluate_control_conditions( info->dialog );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
{
struct msi_listbox_info *info;
- msi_control *control;
+ struct control *control;
DWORD attributes, style;
LPCWSTR prop;
- info = msi_alloc( sizeof *info );
+ info = malloc( sizeof *info );
if (!info)
return ERROR_FUNCTION_FAILED;
if (~attributes & msidbControlAttributesSorted)
style |= LBS_SORT;
- control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style );
+ control = dialog_add_control( dialog, rec, WC_LISTBOXW, style );
if (!control)
{
- msi_free(info);
+ free(info);
return ERROR_FUNCTION_FAILED;
}
- control->handler = msi_dialog_listbox_handler;
+ control->handler = dialog_listbox_handler;
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
/* subclass */
info->dialog = dialog;
SetPropW( control->hwnd, L"MSIDATA", info );
if ( control->property )
- msi_listbox_add_items( info, control->property );
+ listbox_add_items( info, control->property );
return ERROR_SUCCESS;
}
/******************** Directory Combo ***************************************/
-static void msi_dialog_update_directory_combo( msi_dialog *dialog, msi_control *control )
+static void dialog_update_directory_combo( msi_dialog *dialog, struct control *control )
{
WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
+ if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
return;
if (!(path = get_path_property( dialog, control ))) return;
SendMessageW( control->hwnd, CB_INSERTSTRING, 0, (LPARAM)path );
SendMessageW( control->hwnd, CB_SETCURSEL, 0, 0 );
- msi_free( path );
+ free( path );
}
-static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
DWORD style;
/* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
style = CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD |
WS_GROUP | WS_TABSTOP | WS_VSCROLL;
- control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
+ control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
- msi_dialog_update_directory_combo( dialog, control );
+ dialog_update_directory_combo( dialog, control );
return ERROR_SUCCESS;
}
/******************** Directory List ***************************************/
-static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *control )
+static void dialog_update_directory_list( msi_dialog *dialog, struct control *control )
{
WCHAR dir_spec[MAX_PATH], *path;
WIN32_FIND_DATAW wfd;
LVITEMW item;
HANDLE file;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" )))
+ if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryList" )))
return;
/* clear the list-view */
file = FindFirstFileW( dir_spec, &wfd );
if (file == INVALID_HANDLE_VALUE)
{
- msi_free( path );
+ free( path );
return;
}
SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&item );
} while ( FindNextFileW( file, &wfd ) );
- msi_free( path );
+ free( path );
FindClose( file );
}
-static UINT msi_dialog_directorylist_up( msi_dialog *dialog )
+static UINT dialog_directorylist_up( msi_dialog *dialog )
{
- msi_control *control;
+ struct control *control;
LPWSTR prop, path, ptr;
BOOL indirect;
- control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" );
+ control = dialog_find_control_by_type( dialog, L"DirectoryList" );
indirect = control->attributes & msidbControlAttributesIndirect;
- prop = msi_dialog_dup_property( dialog, control->property, indirect );
- path = msi_dialog_dup_property( dialog, prop, TRUE );
+ prop = dialog_dup_property( dialog, control->property, indirect );
+ path = dialog_dup_property( dialog, prop, TRUE );
/* strip off the last directory */
ptr = PathFindFileNameW( path );
PathAddBackslashW( path );
}
- msi_dialog_set_property( dialog->package, prop, path );
+ dialog_set_property( dialog->package, prop, path );
- msi_dialog_update_directory_list( dialog, NULL );
- msi_dialog_update_directory_combo( dialog, NULL );
- msi_dialog_update_pathedit( dialog, NULL );
+ dialog_update_directory_list( dialog, NULL );
+ dialog_update_directory_combo( dialog, NULL );
+ dialog_update_pathedit( dialog, NULL );
- msi_free( path );
- msi_free( prop );
+ free( path );
+ free( prop );
return ERROR_SUCCESS;
}
len = LoadStringW( msi_hInstance, IDS_NEWFOLDER, newfolder, ARRAY_SIZE(newfolder) );
len += lstrlenW(root) + 1;
- if (!(path = msi_alloc( (len + 4) * sizeof(WCHAR) ))) return NULL;
+ if (!(path = malloc( (len + 4) * sizeof(WCHAR) ))) return NULL;
lstrcpyW( path, root );
lstrcatW( path, newfolder );
if (GetFileAttributesW( path ) == INVALID_FILE_ATTRIBUTES) break;
if (count > 99)
{
- msi_free( path );
+ free( path );
return NULL;
}
swprintf( path, len + 4, L"%s%s %u", root, newfolder, count++ );
return path;
}
-static UINT msi_dialog_directorylist_new( msi_dialog *dialog )
+static UINT dialog_directorylist_new( msi_dialog *dialog )
{
- msi_control *control;
+ struct control *control;
WCHAR *path;
LVITEMW item;
int index;
- control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" );
+ control = dialog_find_control_by_type( dialog, L"DirectoryList" );
if (!(path = get_path_property( dialog, control ))) return ERROR_OUTOFMEMORY;
SendMessageW( control->hwnd, LVM_ENSUREVISIBLE, index, 0 );
SendMessageW( control->hwnd, LVM_EDITLABELW, index, -1 );
- msi_free( path );
- msi_free( item.pszText );
+ free( path );
+ free( item.pszText );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_dirlist_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
NMHDR *nmhdr = (NMHDR *)param;
WCHAR text[MAX_PATH], *new_path, *path, *prop;
}
indirect = control->attributes & msidbControlAttributesIndirect;
- prop = msi_dialog_dup_property( dialog, control->property, indirect );
- path = msi_dialog_dup_property( dialog, prop, TRUE );
+ prop = dialog_dup_property( dialog, control->property, indirect );
+ path = dialog_dup_property( dialog, prop, TRUE );
- if (!(new_path = msi_alloc( (lstrlenW(path) + lstrlenW(text) + 2) * sizeof(WCHAR) )))
+ if (!(new_path = malloc( (wcslen(path) + wcslen(text) + 2) * sizeof(WCHAR) )))
{
- msi_free( prop );
- msi_free( path );
+ free( prop );
+ free( path );
return ERROR_OUTOFMEMORY;
}
lstrcpyW( new_path, path );
if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
lstrcatW( new_path, L"\\" );
- msi_dialog_set_property( dialog->package, prop, new_path );
+ dialog_set_property( dialog->package, prop, new_path );
- msi_dialog_update_directory_list( dialog, NULL );
- msi_dialog_update_directory_combo( dialog, NULL );
- msi_dialog_update_pathedit( dialog, NULL );
+ dialog_update_directory_list( dialog, NULL );
+ dialog_update_directory_combo( dialog, NULL );
+ dialog_update_pathedit( dialog, NULL );
- msi_free( prop );
- msi_free( path );
- msi_free( new_path );
+ free( prop );
+ free( path );
+ free( new_path );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
DWORD style;
style = LVS_LIST | WS_VSCROLL | LVS_SHAREIMAGELISTS | LVS_EDITLABELS |
LVS_AUTOARRANGE | LVS_SINGLESEL | WS_BORDER |
LVS_SORTASCENDING | WS_CHILD | WS_GROUP | WS_TABSTOP;
- control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
+ control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 );
- control->handler = msi_dialog_dirlist_handler;
+ control->handler = dialog_dirlist_handler;
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
/* double click to activate an item in the list */
SendMessageW( control->hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE,
0, LVS_EX_TWOCLICKACTIVATE );
- msi_dialog_update_directory_list( dialog, control );
+ dialog_update_directory_list( dialog, control );
return ERROR_SUCCESS;
}
L"VolumeCostDifference",
};
-static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control, MSIRECORD *rec )
+static void dialog_vcl_add_columns( msi_dialog *dialog, struct control *control, MSIRECORD *rec )
{
LPCWSTR text = MSI_RecordGetString( rec, 10 );
LPCWSTR begin = text, end;
if (!(end = wcschr( begin, '}' )))
return;
- num = msi_alloc( (end-begin+1)*sizeof(WCHAR) );
+ num = malloc( (end - begin + 1) * sizeof(WCHAR) );
if (!num)
return;
if ( !num[0] || !wcscmp( num, L"0" ) )
{
count++;
- msi_free( num );
+ free( num );
continue;
}
if (count == 0 && (!wcsncmp(num, L"\\", 1) || !wcsncmp(num, L"&", 1)))
{
FIXME("Style prefix not supported\n");
- msi_free(num);
+ free(num);
continue;
}
#endif
- msi_free( num );
+ free( num );
return;
}
ZeroMemory( &lvc, sizeof(lvc) );
lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
lvc.cx = wcstol( num, NULL, 10 );
- lvc.pszText = msi_dialog_get_uitext( dialog, column_keys[count] );
+ lvc.pszText = dialog_get_uitext( dialog, column_keys[count] );
SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, count++, (LPARAM)&lvc );
- msi_free( lvc.pszText );
- msi_free( num );
+ free( lvc.pszText );
+ free( num );
}
}
-static LONGLONG msi_vcl_get_cost( msi_dialog *dialog )
+static LONGLONG vcl_get_cost( msi_dialog *dialog )
{
MSIFEATURE *feature;
INT each_cost;
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost)))
{
- /* each_cost is in 512-byte units */
- total_cost += ((LONGLONG)each_cost) * 512;
+ total_cost += each_cost;
}
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost)))
{
- /* each_cost is in 512-byte units */
- total_cost -= ((LONGLONG)each_cost) * 512;
+ total_cost -= each_cost;
}
}
return total_cost;
}
-static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control )
+static void dialog_vcl_add_drives( msi_dialog *dialog, struct control *control )
{
- ULARGE_INTEGER total, free;
+ ULARGE_INTEGER total, unused;
LONGLONG difference, cost;
WCHAR size_text[MAX_PATH];
WCHAR cost_text[MAX_PATH];
#endif
int i = 0;
- cost = msi_vcl_get_cost(dialog);
+ cost = vcl_get_cost(dialog) * 512;
StrFormatByteSizeW(cost, cost_text, MAX_PATH);
size = GetLogicalDriveStringsW( 0, NULL );
if ( !size ) return;
- drives = msi_alloc( (size + 1) * sizeof(WCHAR) );
+ drives = malloc( (size + 1) * sizeof(WCHAR) );
if ( !drives ) return;
GetLogicalDriveStringsW( size, drives );
lvitem.cchTextMax = lstrlenW(ptr) + 1;
SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvitem );
- GetDiskFreeSpaceExW(ptr, &free, &total, NULL);
- difference = free.QuadPart - cost;
+ GetDiskFreeSpaceExW(ptr, &unused, &total, NULL);
+ difference = unused.QuadPart - cost;
StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH);
lvitem.iSubItem = 1;
lvitem.cchTextMax = lstrlenW(size_text) + 1;
SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
- StrFormatByteSizeW(free.QuadPart, size_text, MAX_PATH);
+ StrFormatByteSizeW(unused.QuadPart, size_text, MAX_PATH);
lvitem.iSubItem = 2;
lvitem.pszText = size_text;
lvitem.cchTextMax = lstrlenW(size_text) + 1;
i++;
}
- msi_free( drives );
+ free( drives );
}
-static UINT msi_dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_volumecost_list( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
DWORD style;
style = LVS_REPORT | WS_VSCROLL | WS_HSCROLL | LVS_SHAREIMAGELISTS |
LVS_AUTOARRANGE | LVS_SINGLESEL | WS_BORDER |
WS_CHILD | WS_TABSTOP | WS_GROUP;
- control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
+ control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
- msi_dialog_vcl_add_columns( dialog, control, rec );
- msi_dialog_vcl_add_drives( dialog, control );
+ dialog_vcl_add_columns( dialog, control, rec );
+ dialog_vcl_add_drives( dialog, control );
return ERROR_SUCCESS;
}
/******************** VolumeSelect Combo ***************************************/
-static UINT msi_dialog_volsel_handler( msi_dialog *dialog,
- msi_control *control, WPARAM param )
+static UINT dialog_volsel_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
WCHAR text[MAX_PATH];
LPWSTR prop;
SendMessageW( control->hwnd, CB_GETLBTEXT, index, (LPARAM)text );
indirect = control->attributes & msidbControlAttributesIndirect;
- prop = msi_dialog_dup_property( dialog, control->property, indirect );
+ prop = dialog_dup_property( dialog, control->property, indirect );
- msi_dialog_set_property( dialog->package, prop, text );
+ dialog_set_property( dialog->package, prop, text );
- msi_free( prop );
+ free( prop );
return ERROR_SUCCESS;
}
-static void msi_dialog_vsc_add_drives( msi_dialog *dialog, msi_control *control )
+static void dialog_vsc_add_drives( msi_dialog *dialog, struct control *control )
{
LPWSTR drives, ptr;
DWORD size;
size = GetLogicalDriveStringsW( 0, NULL );
if ( !size ) return;
- drives = msi_alloc( (size + 1) * sizeof(WCHAR) );
+ drives = malloc( (size + 1) * sizeof(WCHAR) );
if ( !drives ) return;
GetLogicalDriveStringsW( size, drives );
ptr += lstrlenW(ptr) + 1;
}
- msi_free( drives );
+ free( drives );
}
-static UINT msi_dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
DWORD style;
style = WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP |
CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS |
WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR;
- control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
+ control = dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 );
- control->handler = msi_dialog_volsel_handler;
+ control->handler = dialog_volsel_handler;
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
- msi_dialog_vsc_add_drives( dialog, control );
+ dialog_vsc_add_drives( dialog, control );
return ERROR_SUCCESS;
}
-static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_hyperlink_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
int len, len_href = ARRAY_SIZE( L"href" ) - 1;
const WCHAR *p, *q;
return ERROR_SUCCESS;
}
-static UINT msi_dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_hyperlink( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
DWORD style = WS_CHILD | WS_TABSTOP | WS_GROUP;
const WCHAR *text = MSI_RecordGetString( rec, 10 );
int len = lstrlenW( text );
LITEM item;
- control = msi_dialog_add_control( dialog, rec, WC_LINK, style );
+ control = dialog_add_control( dialog, rec, WC_LINK, style );
if (!control)
return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 );
- control->handler = msi_dialog_hyperlink_handler;
+ control->handler = dialog_hyperlink_handler;
item.mask = LIF_ITEMINDEX | LIF_STATE | LIF_URL;
item.iLink = 0;
struct listview_param
{
msi_dialog *dialog;
- msi_control *control;
+ struct control *control;
};
-static UINT msi_dialog_listview_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
+static UINT dialog_listview_handler( msi_dialog *dialog, struct control *control, WPARAM param )
{
NMHDR *nmhdr = (NMHDR *)param;
return ERROR_SUCCESS;
}
-static UINT msi_listview_add_item( MSIRECORD *rec, LPVOID param )
+static UINT listview_add_item( MSIRECORD *rec, void *param )
{
struct listview_param *lv_param = (struct listview_param *)param;
LPCWSTR text, binary;
text = MSI_RecordGetString( rec, 4 );
binary = MSI_RecordGetString( rec, 5 );
- hIcon = msi_load_icon( lv_param->dialog->package->db, binary, 0 );
+ hIcon = load_icon( lv_param->dialog->package->db, binary, 0 );
TRACE("Adding: text %s, binary %s, icon %p\n", debugstr_w(text), debugstr_w(binary), hIcon);
return ERROR_SUCCESS;
}
-static UINT msi_listview_add_items( msi_dialog *dialog, msi_control *control )
+static UINT listview_add_items( msi_dialog *dialog, struct control *control )
{
MSIQUERY *view;
struct listview_param lv_param = { dialog, control };
if (MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `ListView` WHERE `Property` = '%s' ORDER BY `Order`",
control->property ) == ERROR_SUCCESS)
{
- MSI_IterateRecords( view, NULL, msi_listview_add_item, &lv_param );
+ MSI_IterateRecords( view, NULL, listview_add_item, &lv_param );
msiobj_release( &view->hdr );
}
return ERROR_SUCCESS;
}
-static UINT msi_dialog_listview( msi_dialog *dialog, MSIRECORD *rec )
+static UINT dialog_listview( msi_dialog *dialog, MSIRECORD *rec )
{
- msi_control *control;
+ struct control *control;
LPCWSTR prop;
DWORD style, attributes;
LVCOLUMNW col;
attributes = MSI_RecordGetInteger( rec, 8 );
if ( ~attributes & msidbControlAttributesSorted )
style |= LVS_SORTASCENDING;
- control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
+ control = dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
if (!control)
return ERROR_FUNCTION_FAILED;
prop = MSI_RecordGetString( rec, 9 );
- control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+ control->property = dialog_dup_property( dialog, prop, FALSE );
control->hImageList = ImageList_Create( 16, 16, ILC_COLOR32, 0, 1);
SendMessageW( control->hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)control->hImageList );
SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, 0, (LPARAM)&col );
if (control->property)
- msi_listview_add_items( dialog, control );
+ listview_add_items( dialog, control );
- control->handler = msi_dialog_listview_handler;
+ control->handler = dialog_listview_handler;
return ERROR_SUCCESS;
}
static const struct control_handler msi_dialog_handler[] =
{
- { L"Text", msi_dialog_text_control },
- { L"PushButton", msi_dialog_button_control },
- { L"Line", msi_dialog_line_control },
- { L"Bitmap", msi_dialog_bitmap_control },
- { L"CheckBox", msi_dialog_checkbox_control },
- { L"ScrollableText", msi_dialog_scrolltext_control },
- { L"ComboBox", msi_dialog_combo_control },
- { L"Edit", msi_dialog_edit_control },
- { L"MaskedEdit", msi_dialog_maskedit_control },
- { L"PathEdit", msi_dialog_pathedit_control },
- { L"ProgressBar", msi_dialog_progress_bar },
- { L"RadioButtonGroup", msi_dialog_radiogroup_control },
- { L"Icon", msi_dialog_icon_control },
- { L"SelectionTree", msi_dialog_selection_tree },
- { L"GroupBox", msi_dialog_group_box },
- { L"ListBox", msi_dialog_list_box },
- { L"DirectoryCombo", msi_dialog_directory_combo },
- { L"DirectoryList", msi_dialog_directory_list },
- { L"VolumeCostList", msi_dialog_volumecost_list },
- { L"VolumeSelectCombo", msi_dialog_volumeselect_combo },
- { L"HyperLink", msi_dialog_hyperlink },
- { L"ListView", msi_dialog_listview }
+ { L"Text", dialog_text_control },
+ { L"PushButton", dialog_button_control },
+ { L"Line", dialog_line_control },
+ { L"Bitmap", dialog_bitmap_control },
+ { L"CheckBox", dialog_checkbox_control },
+ { L"ScrollableText", dialog_scrolltext_control },
+ { L"ComboBox", dialog_combo_control },
+ { L"Edit", dialog_edit_control },
+ { L"MaskedEdit", dialog_maskedit_control },
+ { L"PathEdit", dialog_pathedit_control },
+ { L"ProgressBar", dialog_progress_bar },
+ { L"RadioButtonGroup", dialog_radiogroup_control },
+ { L"Icon", dialog_icon_control },
+ { L"SelectionTree", dialog_selection_tree },
+ { L"GroupBox", dialog_group_box },
+ { L"ListBox", dialog_list_box },
+ { L"DirectoryCombo", dialog_directory_combo },
+ { L"DirectoryList", dialog_directory_list },
+ { L"VolumeCostList", dialog_volumecost_list },
+ { L"VolumeSelectCombo", dialog_volumeselect_combo },
+ { L"HyperLink", dialog_hyperlink },
+ { L"ListView", dialog_listview }
};
-static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
+static UINT dialog_create_controls( MSIRECORD *rec, void *param )
{
msi_dialog *dialog = param;
LPCWSTR control_type;
return ERROR_SUCCESS;
}
-static UINT msi_dialog_fill_controls( msi_dialog *dialog )
+static UINT dialog_fill_controls( msi_dialog *dialog )
{
UINT r;
MSIQUERY *view;
return ERROR_INVALID_PARAMETER;
}
- r = MSI_IterateRecords( view, 0, msi_dialog_create_controls, dialog );
+ r = MSI_IterateRecords( view, 0, dialog_create_controls, dialog );
msiobj_release( &view->hdr );
return r;
}
-static UINT msi_dialog_reset( msi_dialog *dialog )
+static UINT dialog_reset( msi_dialog *dialog )
{
/* FIXME: should restore the original values of any properties we changed */
- return msi_dialog_evaluate_control_conditions( dialog );
+ return dialog_evaluate_control_conditions( dialog );
}
/* figure out the height of 10 point MS Sans Serif */
-static INT msi_dialog_get_sans_serif_height( HWND hwnd )
+static INT dialog_get_sans_serif_height( HWND hwnd )
{
LOGFONTW lf;
TEXTMETRICW tm;
}
/* fetch the associated record from the Dialog table */
-static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog )
+static MSIRECORD *get_dialog_record( msi_dialog *dialog )
{
MSIPACKAGE *package = dialog->package;
MSIRECORD *rec = NULL;
return rec;
}
-static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LPRECT pos )
+static void dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, RECT *pos )
{
UINT xres, yres;
POINT center;
sz.cx = MSI_RecordGetInteger( rec, 4 );
sz.cy = MSI_RecordGetInteger( rec, 5 );
- sz.cx = msi_dialog_scale_unit( dialog, sz.cx );
- sz.cy = msi_dialog_scale_unit( dialog, sz.cy );
+ sz.cx = dialog_scale_unit( dialog, sz.cx );
+ sz.cy = dialog_scale_unit( dialog, sz.cy );
xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
AdjustWindowRect( pos, style, FALSE );
}
-static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first )
+static void dialog_set_tab_order( msi_dialog *dialog, const WCHAR *first )
{
struct list tab_chain;
- msi_control *control;
+ struct control *control;
HWND prev = HWND_TOP;
list_init( &tab_chain );
- if (!(control = msi_dialog_find_control( dialog, first ))) return;
+ if (!(control = dialog_find_control( dialog, first ))) return;
dialog->hWndFocus = control->hwnd;
while (control)
list_remove( &control->entry );
list_add_tail( &tab_chain, &control->entry );
if (!control->tabnext) break;
- control = msi_dialog_find_control( dialog, control->tabnext );
+ control = dialog_find_control( dialog, control->tabnext );
}
- LIST_FOR_EACH_ENTRY( control, &tab_chain, msi_control, entry )
+ LIST_FOR_EACH_ENTRY( control, &tab_chain, struct control, entry )
{
SetWindowPos( control->hwnd, prev, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW |
list_move_head( &dialog->controls, &tab_chain );
}
-static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
+static LRESULT dialog_oncreate( HWND hwnd, CREATESTRUCTW *cs )
{
msi_dialog *dialog = cs->lpCreateParams;
MSIRECORD *rec = NULL;
dialog->hwnd = hwnd;
SetWindowLongPtrW( hwnd, GWLP_USERDATA, (LONG_PTR) dialog );
- rec = msi_get_dialog_record( dialog );
+ rec = get_dialog_record( dialog );
if( !rec )
{
TRACE("No record found for dialog %s\n", debugstr_w(dialog->name));
return -1;
}
- dialog->scale = msi_dialog_get_sans_serif_height(dialog->hwnd);
+ dialog->scale = dialog_get_sans_serif_height(dialog->hwnd);
- msi_dialog_adjust_dialog_pos( dialog, rec, &pos );
+ dialog_adjust_dialog_pos( dialog, rec, &pos );
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
if (!dialog->default_font)
{
- dialog->default_font = strdupW( L"MS Shell Dlg" );
+ dialog->default_font = wcsdup( L"MS Shell Dlg" );
if (!dialog->default_font)
{
msiobj_release( &rec->hdr );
}
}
- title = msi_get_deformatted_field( dialog->package, rec, 7 );
+ title = get_deformatted_field( dialog->package, rec, 7 );
SetWindowTextW( hwnd, title );
- msi_free( title );
+ free( title );
SetWindowPos( hwnd, 0, pos.left, pos.top,
pos.right - pos.left, pos.bottom - pos.top,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW );
- msi_dialog_build_font_list( dialog );
- msi_dialog_fill_controls( dialog );
- msi_dialog_evaluate_control_conditions( dialog );
- msi_dialog_set_tab_order( dialog, MSI_RecordGetString( rec, 8 ) );
+ dialog_build_font_list( dialog );
+ dialog_fill_controls( dialog );
+ dialog_evaluate_control_conditions( dialog );
+ dialog_set_tab_order( dialog, MSI_RecordGetString( rec, 8 ) );
msiobj_release( &rec->hdr );
return 0;
}
-static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd )
+static LRESULT dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd )
{
- msi_control *control = NULL;
+ struct control *control = NULL;
TRACE( "%p, %#Ix, %p\n", dialog, param, hwnd );
switch (param)
{
case 1: /* enter */
- control = msi_dialog_find_control( dialog, dialog->control_default );
+ control = dialog_find_control( dialog, dialog->control_default );
break;
case 2: /* escape */
- control = msi_dialog_find_control( dialog, dialog->control_cancel );
+ control = dialog_find_control( dialog, dialog->control_cancel );
break;
default:
- control = msi_dialog_find_control_by_hwnd( dialog, hwnd );
+ control = dialog_find_control_by_hwnd( dialog, hwnd );
}
if( control )
if( control->handler )
{
control->handler( dialog, control, param );
- msi_dialog_evaluate_control_conditions( dialog );
+ dialog_evaluate_control_conditions( dialog );
}
}
return 0;
}
-static LRESULT msi_dialog_onnotify( msi_dialog *dialog, LPARAM param )
+static LRESULT dialog_onnotify( msi_dialog *dialog, LPARAM param )
{
LPNMHDR nmhdr = (LPNMHDR) param;
- msi_control *control = msi_dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom );
+ struct control *control = dialog_find_control_by_hwnd( dialog, nmhdr->hwndFrom );
TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
break;
case WM_CREATE:
- return msi_dialog_oncreate( hwnd, (LPCREATESTRUCTW)lParam );
+ return dialog_oncreate( hwnd, (LPCREATESTRUCTW)lParam );
case WM_COMMAND:
- return msi_dialog_oncommand( dialog, wParam, (HWND)lParam );
+ return dialog_oncommand( dialog, wParam, (HWND)lParam );
case WM_CLOSE:
/* Simulate escape press */
- return msi_dialog_oncommand(dialog, 2, NULL);
+ return dialog_oncommand(dialog, 2, NULL);
case WM_ACTIVATE:
if( LOWORD(wParam) == WA_INACTIVE )
dialog->hwnd = NULL;
return 0;
case WM_NOTIFY:
- return msi_dialog_onnotify( dialog, lParam );
+ return dialog_onnotify( dialog, lParam );
}
return DefWindowProcW(hwnd, msg, wParam, lParam);
}
return ERROR_SUCCESS;
}
-static LRESULT WINAPI MSIHiddenWindowProc( HWND hwnd, UINT msg,
- WPARAM wParam, LPARAM lParam )
+static LRESULT WINAPI MSIHiddenWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
msi_dialog *dialog = (msi_dialog*) lParam;
}
static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent,
- control_event_handler event_handler )
+ UINT (*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *) )
{
MSIRECORD *rec = NULL;
msi_dialog *dialog;
if (!hMsiHiddenWindow) dialog_register_class();
/* allocate the structure for the dialog to use */
- dialog = msi_alloc_zero( FIELD_OFFSET( msi_dialog, name[lstrlenW( name ) + 1] ));
+ dialog = calloc( 1, offsetof( msi_dialog, name[wcslen( name ) + 1] ) );
if( !dialog )
return NULL;
lstrcpyW( dialog->name, name );
list_init( &dialog->fonts );
/* verify that the dialog exists */
- rec = msi_get_dialog_record( dialog );
+ rec = get_dialog_record( dialog );
if( !rec )
{
- msi_free( dialog );
+ free( dialog );
return NULL;
}
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
- dialog->control_default = strdupW( MSI_RecordGetString( rec, 9 ) );
- dialog->control_cancel = strdupW( MSI_RecordGetString( rec, 10 ) );
+ dialog->control_default = wcsdup( MSI_RecordGetString( rec, 9 ) );
+ dialog->control_cancel = wcsdup( MSI_RecordGetString( rec, 10 ) );
msiobj_release( &rec->hdr );
rec = MSI_CreateRecord(2);
return dialog;
}
-static void msi_dialog_end_dialog( msi_dialog *dialog )
+static void dialog_end_dialog( msi_dialog *dialog )
{
TRACE("%p\n", dialog);
dialog->finished = 1;
static void free_subscriber( struct subscriber *sub )
{
- msi_free( sub->event );
- msi_free( sub->control );
- msi_free( sub->attribute );
- msi_free( sub );
+ free( sub->event );
+ free( sub->control );
+ free( sub->attribute );
+ free( sub );
}
static void event_cleanup_subscriptions( MSIPACKAGE *package, const WCHAR *dialog )
void msi_dialog_destroy( msi_dialog *dialog )
{
- msi_font *font, *next;
+ struct font *font, *next;
if( uiThreadId != GetCurrentThreadId() )
{
/* destroy the list of controls */
while( !list_empty( &dialog->controls ) )
{
- msi_control *t;
+ struct control *t;
- t = LIST_ENTRY( list_head( &dialog->controls ),
- msi_control, entry );
- msi_destroy_control( t );
+ t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
+ destroy_control( t );
}
/* destroy the list of fonts */
- LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, msi_font, entry )
+ LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
{
list_remove( &font->entry );
DeleteObject( font->hfont );
- msi_free( font );
+ free( font );
}
- msi_free( dialog->default_font );
+ free( dialog->default_font );
- msi_free( dialog->control_default );
- msi_free( dialog->control_cancel );
+ free( dialog->control_default );
+ free( dialog->control_cancel );
dialog->package = NULL;
- msi_free( dialog );
+ free( dialog );
}
void msi_dialog_unregister_class( void )
return ERROR_OUTOFMEMORY;
}
r = MsiPreviewDialogW( hPreview, strW );
- msi_free( strW );
+ free( strW );
return r;
}
struct control_event
{
const WCHAR *event;
- event_handler handler;
+ UINT (*handler)( msi_dialog *, const WCHAR * );
};
static UINT dialog_event_handler( msi_dialog *, const WCHAR *, const WCHAR * );
dialog->retval = IDABORT;
}
event_cleanup_subscriptions( dialog->package, dialog->name );
- msi_dialog_end_dialog( dialog );
+ dialog_end_dialog( dialog );
return ERROR_SUCCESS;
}
static UINT pending_event_end_dialog( msi_dialog *dialog, const WCHAR *argument )
{
dialog->pending_event = event_end_dialog;
- msi_free( dialog->pending_argument );
- dialog->pending_argument = strdupW( argument );
+ free( dialog->pending_argument );
+ dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS;
}
static UINT event_new_dialog( msi_dialog *dialog, const WCHAR *argument )
{
/* store the name of the next dialog, and signal this one to end */
- dialog->package->next_dialog = strdupW( argument );
+ dialog->package->next_dialog = wcsdup( argument );
msi_event_cleanup_all_subscriptions( dialog->package );
- msi_dialog_end_dialog( dialog );
+ dialog_end_dialog( dialog );
return ERROR_SUCCESS;
}
static UINT pending_event_new_dialog( msi_dialog *dialog, const WCHAR *argument )
{
dialog->pending_event = event_new_dialog;
- msi_free( dialog->pending_argument );
- dialog->pending_argument = strdupW( argument );
+ free( dialog->pending_argument );
+ dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS;
}
if (r != 0)
{
dialog->retval = r;
- msi_dialog_end_dialog( dialog );
+ dialog_end_dialog( dialog );
}
else
- msi_dialog_update_all_controls(dialog);
+ dialog_update_all_controls(dialog);
return ERROR_SUCCESS;
}
static UINT pending_event_spawn_dialog( msi_dialog *dialog, const WCHAR *argument )
{
dialog->pending_event = event_spawn_dialog;
- msi_free( dialog->pending_argument );
- dialog->pending_argument = strdupW( argument );
+ free( dialog->pending_argument );
+ dialog->pending_argument = wcsdup( argument );
return ERROR_SUCCESS;
}
{
/* failure to set the path halts the executing of control events */
r = MSI_SetTargetPathW( dialog->package, argument, path );
- msi_free( path );
+ free( path );
}
- msi_free( &rec->hdr );
+ msiobj_release( &rec->hdr );
return r;
}
static UINT event_reset( msi_dialog *dialog, const WCHAR *argument )
{
- msi_dialog_reset( dialog );
+ dialog_reset( dialog );
return ERROR_SUCCESS;
}
package->next_dialog = NULL;
r = event_do_dialog( package, name, NULL, TRUE );
- msi_free( name );
+ free( name );
}
return r;
}
static UINT event_directory_list_up( msi_dialog *dialog, const WCHAR *argument )
{
- return msi_dialog_directorylist_up( dialog );
+ return dialog_directorylist_up( dialog );
}
static UINT event_directory_list_new( msi_dialog *dialog, const WCHAR *argument )
{
- return msi_dialog_directorylist_new( dialog );
+ return dialog_directorylist_new( dialog );
}
static UINT event_reinstall_mode( msi_dialog *dialog, const WCHAR *argument )
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagDISTINCTSET
+struct distinct_set
{
UINT val;
UINT count;
UINT row;
- struct tagDISTINCTSET *nextrow;
- struct tagDISTINCTSET *nextcol;
-} DISTINCTSET;
+ struct distinct_set *nextrow;
+ struct distinct_set *nextcol;
+};
-typedef struct tagMSIDISTINCTVIEW
+struct distinct_view
{
MSIVIEW view;
MSIDATABASE *db;
MSIVIEW *table;
UINT row_count;
UINT *translation;
-} MSIDISTINCTVIEW;
+};
-static DISTINCTSET ** distinct_insert( DISTINCTSET **x, UINT val, UINT row )
+static struct distinct_set **distinct_insert( struct distinct_set **x, UINT val, UINT row )
{
/* horrible O(n) find */
while( *x )
}
/* nothing found, so add one */
- *x = msi_alloc( sizeof (DISTINCTSET) );
+ *x = malloc( sizeof(**x) );
if( *x )
{
(*x)->val = val;
return x;
}
-static void distinct_free( DISTINCTSET *x )
+static void distinct_free( struct distinct_set *x )
{
while( x )
{
- DISTINCTSET *next = x->nextrow;
+ struct distinct_set *next = x->nextrow;
distinct_free( x->nextcol );
- msi_free( x );
+ free( x );
x = next;
}
}
static UINT DISTINCT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %d %p\n", dv, row, col, val );
static UINT DISTINCT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
UINT r, i, j, r_count, c_count;
- DISTINCTSET *rowset = NULL;
+ struct distinct_set *rowset = NULL;
TRACE("%p %p\n", dv, record);
if( r != ERROR_SUCCESS )
return r;
- dv->translation = msi_alloc( r_count*sizeof(UINT) );
+ dv->translation = malloc( r_count * sizeof(UINT) );
if( !dv->translation )
return ERROR_FUNCTION_FAILED;
/* build it */
for( i=0; i<r_count; i++ )
{
- DISTINCTSET **x = &rowset;
+ struct distinct_set **x = &rowset;
for( j=1; j<=c_count; j++ )
{
static UINT DISTINCT_close( struct tagMSIVIEW *view )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv );
if( !dv->table )
return ERROR_FUNCTION_FAILED;
- msi_free( dv->translation );
+ free( dv->translation );
dv->translation = NULL;
dv->row_count = 0;
static UINT DISTINCT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %p %p\n", dv, rows, cols );
static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %p %p %p %p\n", dv, n, name, type, temporary, table_name );
static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p %d %p\n", dv, eModifyMode, rec );
static UINT DISTINCT_delete( struct tagMSIVIEW *view )
{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
+ struct distinct_view *dv = (struct distinct_view *)view;
TRACE("%p\n", dv );
if( dv->table )
dv->table->ops->delete( dv->table );
- msi_free( dv->translation );
+ free( dv->translation );
msiobj_release( &dv->db->hdr );
- msi_free( dv );
+ free( dv );
return ERROR_SUCCESS;
}
UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
{
- MSIDISTINCTVIEW *dv = NULL;
+ struct distinct_view *dv = NULL;
UINT count = 0, r;
TRACE("%p\n", dv );
return r;
}
- dv = msi_alloc_zero( sizeof *dv );
+ dv = calloc( 1, sizeof *dv );
if( !dv )
return ERROR_FUNCTION_FAILED;
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
-typedef struct tagMSIDROPVIEW
+struct drop_view
{
MSIVIEW view;
MSIDATABASE *db;
MSIVIEW *table;
column_info *colinfo;
INT hold;
-} MSIDROPVIEW;
+};
static UINT DROP_execute(struct tagMSIVIEW *view, MSIRECORD *record)
{
- MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
+ struct drop_view *dv = (struct drop_view *)view;
UINT r;
TRACE("%p %p\n", dv, record);
static UINT DROP_close(struct tagMSIVIEW *view)
{
- MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
+ struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv);
static UINT DROP_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{
- MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
+ struct drop_view *dv = (struct drop_view *)view;
TRACE("%p %p %p\n", dv, rows, cols);
static UINT DROP_delete( struct tagMSIVIEW *view )
{
- MSIDROPVIEW *dv = (MSIDROPVIEW*)view;
+ struct drop_view *dv = (struct drop_view *)view;
TRACE("%p\n", dv );
if( dv->table )
dv->table->ops->delete( dv->table );
- msi_free( dv );
+ free( dv );
return ERROR_SUCCESS;
}
UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
{
- MSIDROPVIEW *dv;
+ struct drop_view *dv;
UINT r;
TRACE("%p %s\n", view, debugstr_w(name));
- dv = msi_alloc_zero(sizeof *dv);
+ dv = calloc(1, sizeof *dv);
if(!dv)
return ERROR_FUNCTION_FAILED;
r = TABLE_CreateView(db, name, &dv->table);
if (r != ERROR_SUCCESS)
{
- msi_free( dv );
+ free( dv );
return r;
}
WINE_DEFAULT_DEBUG_CHANNEL(msi);
+BOOL msi_get_temp_file_name( MSIPACKAGE *package, const WCHAR *tmp_path, const WCHAR *prefix, WCHAR *tmp_filename )
+{
+ BOOL ret;
+ msi_disable_fs_redirection( package );
+ ret = GetTempFileNameW( tmp_path, prefix, 0, tmp_filename );
+ msi_revert_fs_redirection( package );
+ return ret;
+}
+
HANDLE msi_create_file( MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation,
DWORD flags )
{
return handle;
}
-static BOOL msi_copy_file( MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists )
+static BOOL copy_file( MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists )
{
BOOL ret;
msi_disable_fs_redirection( package );
return ret;
}
-static BOOL msi_create_directory( MSIPACKAGE *package, const WCHAR *path )
+static BOOL create_directory( MSIPACKAGE *package, const WCHAR *path )
{
BOOL ret;
msi_disable_fs_redirection( package );
return ret;
}
-static BOOL msi_apply_filepatch( MSIPACKAGE *package, const WCHAR *patch, const WCHAR *old, const WCHAR *new )
+static BOOL apply_filepatch( MSIPACKAGE *package, const WCHAR *patch, const WCHAR *old, const WCHAR *new )
{
BOOL ret;
msi_disable_fs_redirection( package );
void *version;
if (!(version_size = msi_get_file_version_info( package, filename, 0, NULL ))) return NULL;
- if (!(version = msi_alloc( version_size ))) return NULL;
+ if (!(version = malloc( version_size ))) return NULL;
msi_get_file_version_info( package, filename, version_size, version );
if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
{
- msi_free( version );
+ free( version );
return NULL;
}
- if (!(ret = msi_alloc( size )))
+ if (!(ret = malloc( size )))
{
- msi_free( version );
+ free( version );
return NULL;
}
memcpy( ret, ptr, size );
- msi_free( version );
+ free( version );
return ret;
}
WCHAR *new_path;
int len;
- if (!(new_path = msi_alloc( (lstrlenW( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
+ if (!(new_path = malloc( (wcslen( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
lstrcpyW( new_path, path );
while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\\')
new_path[len - 1] = 0;
- while (!msi_create_directory( package, new_path ))
+ while (!create_directory( package, new_path ))
{
WCHAR *slash;
DWORD last_error = GetLastError();
}
new_path[len] = '\\';
}
- msi_free( new_path );
+ free( new_path );
return ret;
}
-static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action )
+static void file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action )
{
MSIRECORD *uirow;
DWORD size;
comp->Action = msi_get_component_action( package, comp );
- if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL || (comp->assembly && comp->assembly->installed))
+ if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL)
{
TRACE("skipping %s (not scheduled for install)\n", debugstr_w(file->File));
return msifs_skipped;
TRACE("skipping %s (obsoleted by patch)\n", debugstr_w(file->File));
return msifs_skipped;
}
- if ((msi_is_global_assembly( comp ) && !comp->assembly->installed) ||
- msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
+ if (msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
{
TRACE("installing %s (missing)\n", debugstr_w(file->File));
return msifs_missing;
HIWORD(file_version->dwFileVersionLS), LOWORD(file_version->dwFileVersionLS));
state = msifs_present;
}
- msi_free( file_version );
+ free( file_version );
return state;
}
else if ((font_version = msi_get_font_file_version( package, file->TargetPath )))
debugstr_w(file->File), debugstr_w(file->Version), debugstr_w(font_version));
state = msifs_present;
}
- msi_free( font_version );
+ free( font_version );
return state;
}
}
}
}
-static UINT copy_file( MSIPACKAGE *package, MSIFILE *file, WCHAR *source )
+static UINT copy_file_attributes( MSIPACKAGE *package, MSIFILE *file, WCHAR *source )
{
BOOL ret;
- ret = msi_copy_file( package, source, file->TargetPath, FALSE );
+ ret = copy_file( package, source, file->TargetPath, FALSE );
if (!ret)
return GetLastError();
TRACE("Copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
- gle = copy_file( package, file, source );
+ gle = copy_file_attributes( package, file, source );
if (gle == ERROR_SUCCESS)
return gle;
{
msi_set_file_attributes( package, file->TargetPath, FILE_ATTRIBUTE_NORMAL );
- gle = copy_file( package, file, source );
+ gle = copy_file_attributes( package, file, source );
TRACE("Overwriting existing file: %d\n", gle);
}
if (gle == ERROR_SHARING_VIOLATION || gle == ERROR_USER_MAPPED_FILE)
TRACE("file in use, scheduling rename operation\n");
- if (!(pathW = strdupW( file->TargetPath ))) return ERROR_OUTOFMEMORY;
+ if (!(pathW = wcsdup( file->TargetPath ))) return ERROR_OUTOFMEMORY;
if ((p = wcsrchr(pathW, '\\'))) *p = 0;
len = lstrlenW( pathW ) + 16;
- if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
+ if (!(tmpfileW = malloc(len * sizeof(WCHAR))))
{
- msi_free( pathW );
+ free( pathW );
return ERROR_OUTOFMEMORY;
}
if (!GetTempFileNameW( pathW, L"msi", 0, tmpfileW )) tmpfileW[0] = 0;
- msi_free( pathW );
+ free( pathW );
- if (msi_copy_file( package, source, tmpfileW, FALSE ) &&
+ if (copy_file( package, source, tmpfileW, FALSE ) &&
msi_move_file( package, file->TargetPath, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ) &&
msi_move_file( package, tmpfileW, file->TargetPath, MOVEFILE_DELAY_UNTIL_REBOOT ))
{
WARN("failed to schedule rename operation: %d)\n", gle);
DeleteFileW( tmpfileW );
}
- msi_free(tmpfileW);
+ free(tmpfileW);
}
return gle;
}
-static UINT create_directory( MSIPACKAGE *package, const WCHAR *dir )
+static UINT create_folder( MSIPACKAGE *package, const WCHAR *dir )
{
MSIFOLDER *folder;
const WCHAR *install_path;
if (!msi_is_global_assembly( file->Component ))
{
- create_directory( package, file->Component->Directory );
+ create_folder( package, file->Component->Directory );
}
- *path = strdupW( file->TargetPath );
+ *path = wcsdup( file->TargetPath );
*attrs = file->Attributes;
*(MSIFILE **)user = file;
}
if (file->LongName && msi_get_file_attributes( package, path ) == INVALID_FILE_ATTRIBUTES)
{
- msi_free( path );
+ free( path );
path = msi_build_directory_name( 2, p, file->LongName );
}
- msi_free( p );
+ free( p );
TRACE("file %s source resolves to %s\n", debugstr_w(file->File), debugstr_w(path));
return path;
}
return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
schedule_install_files(package);
- mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
+ mi = calloc(1, sizeof(MSIMEDIAINFO));
LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
{
BOOL is_global_assembly = msi_is_global_assembly( file->Component );
- msi_file_update_ui( package, file, L"InstallFiles" );
+ file_update_ui( package, file, L"InstallFiles" );
rc = msi_load_media_info( package, file->Sequence, mi );
if (rc != ERROR_SUCCESS)
if (!is_global_assembly)
{
- create_directory(package, file->Component->Directory);
+ create_folder(package, file->Component->Directory);
}
rc = copy_install_file(package, file, source);
if (rc != ERROR_SUCCESS)
{
ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
rc = ERROR_INSTALL_FAILURE;
- msi_free(source);
+ free(source);
goto done;
}
if (!is_global_assembly) file->state = msifs_installed;
- msi_free(source);
+ free(source);
}
else if (!is_global_assembly && file->state != msifs_installed &&
!(file->Attributes & msidbFileAttributesPatchAdded))
goto done;
}
}
- LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
- {
- MSICOMPONENT *comp = file->Component;
-
- if (!msi_is_global_assembly( comp ) || comp->assembly->installed ||
- (file->state != msifs_missing && file->state != msifs_overwrite)) continue;
-
- rc = msi_install_assembly( package, comp );
- if (rc != ERROR_SUCCESS)
- {
- ERR("Failed to install assembly\n");
- rc = ERROR_INSTALL_FAILURE;
- break;
- }
- file->state = msifs_installed;
- }
done:
msi_free_media_info(mi);
}
patch->path = msi_create_temp_file( package->db );
- *path = strdupW( patch->path );
+ *path = wcsdup( patch->path );
*attrs = patch->File->Attributes;
*(MSIFILEPATCH **)user = patch;
}
WCHAR *tmpfile = msi_create_temp_file( package->db );
if (!tmpfile) return ERROR_INSTALL_FAILURE;
- if (msi_apply_filepatch( package, patch->path, patch->File->TargetPath, tmpfile ))
+ if (apply_filepatch( package, patch->path, patch->File->TargetPath, tmpfile ))
{
msi_delete_file( package, patch->File->TargetPath );
msi_move_file( package, tmpfile, patch->File->TargetPath, 0 );
}
DeleteFileW( patch->path );
DeleteFileW( tmpfile );
- msi_free( tmpfile );
+ free( tmpfile );
return r;
}
-static UINT patch_assembly( MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch )
+UINT msi_patch_assembly( MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch )
{
UINT r = ERROR_FUNCTION_FAILED;
IAssemblyName *name;
HRESULT hr;
hr = IAssemblyName_GetDisplayName( name, NULL, &len, 0 );
- if (hr != E_NOT_SUFFICIENT_BUFFER || !(displayname = msi_alloc( len * sizeof(WCHAR) )))
+ if (hr != E_NOT_SUFFICIENT_BUFFER || !(displayname = malloc( len * sizeof(WCHAR) )))
break;
hr = IAssemblyName_GetDisplayName( name, displayname, &len, 0 );
if (FAILED( hr ))
{
- msi_free( displayname );
+ free( displayname );
break;
}
if ((path = msi_get_assembly_path( package, displayname )))
{
- if (!msi_copy_file( package, path, patch->File->TargetPath, FALSE ))
+ if (!copy_file( package, path, patch->File->TargetPath, FALSE ))
{
ERR( "failed to copy file %s -> %s (%lu)\n", debugstr_w(path),
debugstr_w(patch->File->TargetPath), GetLastError() );
- msi_free( path );
- msi_free( displayname );
+ free( path );
+ free( displayname );
IAssemblyName_Release( name );
break;
}
r = patch_file( package, patch );
- msi_free( path );
+ free( path );
}
- msi_free( displayname );
+ free( displayname );
IAssemblyName_Release( name );
if (r == ERROR_SUCCESS) break;
}
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
- mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
+ mi = calloc( 1, sizeof(MSIMEDIAINFO) );
TRACE("extracting files\n");
{
MSICOMPONENT *comp = patch->File->Component;
- if (!patch->path) continue;
-
- if (msi_is_global_assembly( comp ))
- rc = patch_assembly( package, comp->assembly, patch );
- else
- rc = patch_file( package, patch );
+ if (msi_is_global_assembly( comp ) || !patch->path) continue;
+ rc = patch_file( package, patch );
if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
{
ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
break;
}
-
- if (msi_is_global_assembly( comp ))
- {
- if ((rc = msi_install_assembly( package, comp )))
- {
- ERR("Failed to install patched assembly\n");
- break;
- }
- }
}
done:
#define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0))))
-typedef struct
+struct file_list
{
struct list entry;
LPWSTR sourcename;
LPWSTR destname;
LPWSTR source;
LPWSTR dest;
-} FILE_LIST;
+};
static BOOL move_file( MSIPACKAGE *package, const WCHAR *source, const WCHAR *dest, int options )
{
else
{
TRACE("copying %s -> %s\n", debugstr_w(source), debugstr_w(dest));
- ret = msi_copy_file( package, source, dest, FALSE );
+ ret = copy_file( package, source, dest, FALSE );
if (!ret)
{
- WARN( "msi_copy_file failed: %lu\n", GetLastError() );
+ WARN( "copy_file failed: %lu\n", GetLastError() );
return FALSE;
}
}
dirlen = ptr - wildcard + 1;
pathlen = dirlen + lstrlenW(filename) + 1;
- if (!(path = msi_alloc(pathlen * sizeof(WCHAR)))) return NULL;
+ if (!(path = malloc(pathlen * sizeof(WCHAR)))) return NULL;
lstrcpynW(path, wildcard, dirlen + 1);
lstrcatW(path, filename);
return path;
}
-static void free_file_entry(FILE_LIST *file)
+static void free_file_entry(struct file_list *file)
{
- msi_free(file->source);
- msi_free(file->dest);
- msi_free(file);
+ free(file->source);
+ free(file->dest);
+ free(file);
}
-static void free_list(FILE_LIST *list)
+static void free_list(struct file_list *list)
{
while (!list_empty(&list->entry))
{
- FILE_LIST *file = LIST_ENTRY(list_head(&list->entry), FILE_LIST, entry);
+ struct file_list *file = LIST_ENTRY(list_head(&list->entry), struct file_list, entry);
list_remove(&file->entry);
free_file_entry(file);
}
}
-static BOOL add_wildcard( FILE_LIST *files, const WCHAR *source, WCHAR *dest )
+static BOOL add_wildcard( struct file_list *files, const WCHAR *source, WCHAR *dest )
{
- FILE_LIST *new, *file;
+ struct file_list *new, *file;
WCHAR *ptr, *filename;
DWORD size;
- new = msi_alloc_zero(sizeof(FILE_LIST));
+ new = calloc(1, sizeof(*new));
if (!new)
return FALSE;
- new->source = strdupW(source);
+ new->source = wcsdup(source);
ptr = wcsrchr(dest, '\\') + 1;
filename = wcsrchr(new->source, '\\') + 1;
new->destname = new->sourcename;
size = (ptr - dest) + lstrlenW(filename) + 1;
- new->dest = msi_alloc(size * sizeof(WCHAR));
+ new->dest = malloc(size * sizeof(WCHAR));
if (!new->dest)
{
free_file_entry(new);
return TRUE;
}
- LIST_FOR_EACH_ENTRY(file, &files->entry, FILE_LIST, entry)
+ LIST_FOR_EACH_ENTRY(file, &files->entry, struct file_list, entry)
{
if (wcscmp( source, file->source ) < 0)
{
HANDLE hfile;
LPWSTR path;
BOOL res;
- FILE_LIST files, *file;
+ struct file_list files, *file;
DWORD size;
hfile = msi_find_first_file( package, source, &wfd );
}
add_wildcard(&files, path, dest);
- msi_free(path);
+ free(path);
}
/* no files match the wildcard */
goto done;
/* only the first wildcard match gets renamed to dest */
- file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry);
+ file = LIST_ENTRY(list_head(&files.entry), struct file_list, entry);
size = (wcsrchr(file->dest, '\\') - file->dest) + lstrlenW(file->destname) + 2;
- file->dest = msi_realloc(file->dest, size * sizeof(WCHAR));
+ file->dest = realloc(file->dest, size * sizeof(WCHAR));
if (!file->dest)
{
res = FALSE;
while (!list_empty(&files.entry))
{
- file = LIST_ENTRY(list_head(&files.entry), FILE_LIST, entry);
+ file = LIST_ENTRY(list_head(&files.entry), struct file_list, entry);
move_file( package, file->source, file->dest, options );
if (msi_get_file_attributes( package, sourcedir ) == INVALID_FILE_ATTRIBUTES)
goto done;
- source = strdupW(sourcedir);
+ source = wcsdup(sourcedir);
if (!source)
goto done;
}
else
{
size = lstrlenW(sourcedir) + lstrlenW(sourcename) + 2;
- source = msi_alloc(size * sizeof(WCHAR));
+ source = malloc(size * sizeof(WCHAR));
if (!source)
goto done;
{
WCHAR *p;
if (sourcename)
- destname = strdupW(sourcename);
+ destname = wcsdup(sourcename);
else if ((p = wcsrchr(sourcedir, '\\')))
- destname = strdupW(p + 1);
+ destname = wcsdup(p + 1);
else
- destname = strdupW(sourcedir);
+ destname = wcsdup(sourcedir);
if (!destname)
goto done;
}
}
else
{
- destname = strdupW(MSI_RecordGetString(rec, 4));
+ destname = wcsdup(MSI_RecordGetString(rec, 4));
if (destname) msi_reduce_to_long_filename(destname);
}
size = lstrlenW(destname);
size += lstrlenW(destdir) + 2;
- dest = msi_alloc(size * sizeof(WCHAR));
+ dest = malloc(size * sizeof(WCHAR));
if (!dest)
goto done;
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(sourcedir);
- msi_free(destdir);
- msi_free(destname);
- msi_free(source);
- msi_free(dest);
+ free(sourcedir);
+ free(destdir);
+ free(destname);
+ free(source);
+ free(dest);
return ERROR_SUCCESS;
}
if (MSI_RecordIsNull( row, 4 ))
{
len = lstrlenW( src ) + 1;
- if (!(dst_name = msi_alloc( len * sizeof(WCHAR)))) return NULL;
+ if (!(dst_name = malloc( len * sizeof(WCHAR)))) return NULL;
lstrcpyW( dst_name, wcsrchr( src, '\\' ) + 1 );
}
else
{
MSI_RecordGetStringW( row, 4, NULL, &len );
- if (!(dst_name = msi_alloc( ++len * sizeof(WCHAR) ))) return NULL;
+ if (!(dst_name = malloc( ++len * sizeof(WCHAR) ))) return NULL;
MSI_RecordGetStringW( row, 4, dst_name, &len );
msi_reduce_to_long_filename( dst_name );
}
if (MSI_RecordIsNull( row, 5 ))
{
WCHAR *p;
- dst_path = strdupW( src );
+ dst_path = wcsdup( src );
p = wcsrchr( dst_path, '\\' );
if (p) *p = 0;
}
{
const WCHAR *dst_key = MSI_RecordGetString( row, 5 );
- dst_path = strdupW( msi_get_target_folder( package, dst_key ) );
+ dst_path = wcsdup( msi_get_target_folder( package, dst_key ) );
if (!dst_path)
{
/* try a property */
if (!dst_path)
{
FIXME("Unable to get destination folder, try AppSearch properties\n");
- msi_free( dst_name );
+ free( dst_name );
return NULL;
}
}
dst = msi_build_directory_name( 2, dst_path, dst_name );
msi_create_full_path( package, dst_path );
- msi_free( dst_name );
- msi_free( dst_path );
+ free( dst_name );
+ free( dst_path );
return dst;
}
}
TRACE("Duplicating file %s to %s\n", debugstr_w(file->TargetPath), debugstr_w(dest));
- if (!msi_copy_file( package, file->TargetPath, dest, TRUE ))
+ if (!copy_file( package, file->TargetPath, dest, TRUE ))
{
WARN( "failed to copy file %s -> %s (%lu)\n",
debugstr_w(file->TargetPath), debugstr_w(dest), GetLastError() );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(dest);
+ free(dest);
return ERROR_SUCCESS;
}
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(dest);
+ free(dest);
return ERROR_SUCCESS;
}
return ERROR_SUCCESS;
}
size = 0;
- if ((filename = strdupW( MSI_RecordGetString(row, 3) )))
+ if ((filename = wcsdup( MSI_RecordGetString(row, 3) )))
{
msi_reduce_to_long_filename( filename );
size = lstrlenW( filename );
}
size += lstrlenW(dir) + 2;
- path = msi_alloc(size * sizeof(WCHAR));
+ path = malloc(size * sizeof(WCHAR));
if (!path)
{
ret = ERROR_OUTOFMEMORY;
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free(filename);
- msi_free(path);
- msi_free(dir);
+ free(filename);
+ free(path);
+ free(dir);
return ret;
}
VS_FIXEDFILEINFO *ver;
comp = file->Component;
- msi_file_update_ui( package, file, L"RemoveFiles" );
+ file_update_ui( package, file, L"RemoveFiles" );
comp->Action = msi_get_component_action( package, comp );
if (comp->Action != INSTALLSTATE_ABSENT || comp->Installed == INSTALLSTATE_SOURCE)
if (ver && msi_compare_file_versions( ver, file->Version ) > 0)
{
TRACE("newer version detected, not removing file\n");
- msi_free( ver );
+ free( ver );
continue;
}
- msi_free( ver );
+ free( ver );
}
if (file->state == msifs_installed)
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-typedef struct _tagTT_OFFSET_TABLE {
+struct offset_table
+{
USHORT uMajorVersion;
USHORT uMinorVersion;
USHORT uNumOfTables;
USHORT uSearchRange;
USHORT uEntrySelector;
USHORT uRangeShift;
-} TT_OFFSET_TABLE;
+};
-typedef struct _tagTT_TABLE_DIRECTORY {
+struct table_directory
+{
char szTag[4]; /* table name */
ULONG uCheckSum; /* Check sum */
ULONG uOffset; /* Offset from beginning of file */
ULONG uLength; /* length of the table in bytes */
-} TT_TABLE_DIRECTORY;
+};
-typedef struct _tagTT_NAME_TABLE_HEADER {
+struct name_table_header
+{
USHORT uFSelector; /* format selector. Always 0 */
USHORT uNRCount; /* Name Records count */
- USHORT uStorageOffset; /* Offset for strings storage,
- * from start of the table */
-} TT_NAME_TABLE_HEADER;
+ USHORT uStorageOffset; /* Offset for strings storage from start of the table */
+};
#define NAME_ID_FULL_FONT_NAME 4
#define NAME_ID_VERSION 5
-typedef struct _tagTT_NAME_RECORD {
+struct name_record
+{
USHORT uPlatformID;
USHORT uEncodingID;
USHORT uLanguageID;
USHORT uNameID;
USHORT uStringLength;
USHORT uStringOffset; /* from start of storage area */
-} TT_NAME_RECORD;
+};
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
*/
static WCHAR *load_ttf_name_id( MSIPACKAGE *package, const WCHAR *filename, DWORD id )
{
- TT_TABLE_DIRECTORY tblDir;
+ struct table_directory tblDir;
BOOL bFound = FALSE;
- TT_OFFSET_TABLE ttOffsetTable;
- TT_NAME_TABLE_HEADER ttNTHeader;
- TT_NAME_RECORD ttRecord;
+ struct offset_table ttOffsetTable;
+ struct name_table_header ttNTHeader;
+ struct name_record ttRecord;
DWORD dwRead;
HANDLE handle;
LPWSTR ret = NULL;
return NULL;
}
- if (!ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),&dwRead,NULL))
+ if (!ReadFile(handle,&ttOffsetTable, sizeof(struct offset_table),&dwRead,NULL))
goto end;
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
for (i=0; i< ttOffsetTable.uNumOfTables; i++)
{
- if (!ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),&dwRead,NULL))
+ if (!ReadFile(handle, &tblDir, sizeof(tblDir), &dwRead, NULL))
break;
if (memcmp(tblDir.szTag,"name",4)==0)
{
goto end;
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
- if (!ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER), &dwRead,NULL))
+ if (!ReadFile(handle, &ttNTHeader, sizeof(ttNTHeader), &dwRead, NULL))
goto end;
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
for(i=0; i<ttNTHeader.uNRCount; i++)
{
- if (!ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),&dwRead,NULL))
+ if (!ReadFile(handle, &ttRecord, sizeof(ttRecord), &dwRead, NULL))
break;
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
ttRecord.uStringOffset = SWAPWORD(ttRecord.uStringOffset);
SetFilePointer(handle, tblDir.uOffset + ttRecord.uStringOffset + ttNTHeader.uStorageOffset,
NULL, FILE_BEGIN);
- if (!(buf = msi_alloc_zero( ttRecord.uStringLength + sizeof(WCHAR) ))) goto end;
+ if (!(buf = calloc(ttRecord.uStringLength, sizeof(WCHAR)))) goto end;
dwRead = 0;
ReadFile(handle, buf, ttRecord.uStringLength, &dwRead, NULL);
if (dwRead % sizeof(WCHAR))
{
- msi_free(buf);
+ free(buf);
goto end;
}
for (i = 0; i < dwRead / sizeof(WCHAR); i++) buf[i] = SWAPWORD(buf[i]);
- ret = strdupW(buf);
- msi_free(buf);
+ ret = wcsdup(buf);
+ free(buf);
break;
}
}
if (!name[0])
{
WARN("empty font name\n");
- msi_free( name );
+ free( name );
return NULL;
}
- ret = msi_alloc( (lstrlenW( name ) + lstrlenW( L" (TrueType)" ) + 1 ) * sizeof(WCHAR) );
+ ret = malloc( wcslen( name ) * sizeof(WCHAR) + sizeof( L" (TrueType)" ) );
lstrcpyW( ret, name );
lstrcatW( ret, L" (TrueType)" );
- msi_free( name );
+ free( name );
}
return ret;
}
else major = 0;
}
len = lstrlenW( L"%u.%u.0.0" ) + 20;
- ret = msi_alloc( len * sizeof(WCHAR) );
+ ret = malloc( len * sizeof(WCHAR) );
swprintf( ret, len, L"%u.%u.0.0", major, minor );
- msi_free( version );
+ free( version );
}
return ret;
}
msi_reg_set_val_str( hkey2, name, file->TargetPath);
}
- msi_free(name);
+ free(name);
RegCloseKey(hkey1);
RegCloseKey(hkey2);
/* the UI chunk */
uirow = MSI_CreateRecord( 1 );
- uipath = strdupW( file->TargetPath );
+ uipath = wcsdup( file->TargetPath );
p = wcsrchr(uipath,'\\');
if (p) p++;
else p = uipath;
MSI_RecordSetStringW( uirow, 1, p );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( uipath );
+ free( uipath );
/* FIXME: call msi_ui_progress? */
return ERROR_SUCCESS;
RegDeleteValueW( hkey2, name );
}
- msi_free( name );
+ free( name );
RegCloseKey( hkey1 );
RegCloseKey( hkey2 );
/* the UI chunk */
uirow = MSI_CreateRecord( 1 );
- uipath = strdupW( file->TargetPath );
+ uipath = wcsdup( file->TargetPath );
p = wcsrchr( uipath,'\\' );
if (p) p++;
else p = uipath;
MSI_RecordSetStringW( uirow, 1, p );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
msiobj_release( &uirow->hdr );
- msi_free( uipath );
+ free( uipath );
/* FIXME: call msi_ui_progress? */
return ERROR_SUCCESS;
#define left_type(x) (x & 0xF0)
-typedef struct _tagFORMAT
+struct format
{
MSIPACKAGE *package;
MSIRECORD *record;
BOOL propfailed;
BOOL groupfailed;
int groups;
-} FORMAT;
+};
-typedef struct _tagFORMSTR
+struct form_str
{
struct list entry;
int n;
int type;
BOOL propfound;
BOOL nonprop;
-} FORMSTR;
+};
-typedef struct _tagSTACK
+struct stack
{
struct list items;
-} STACK;
+};
-static STACK *create_stack(void)
+static struct stack *create_stack(void)
{
- STACK *stack = msi_alloc(sizeof(STACK));
+ struct stack *stack = malloc(sizeof(*stack));
list_init(&stack->items);
return stack;
}
-static void free_stack(STACK *stack)
+static void free_stack(struct stack *stack)
{
while (!list_empty(&stack->items))
{
- FORMSTR *str = LIST_ENTRY(list_head(&stack->items), FORMSTR, entry);
+ struct form_str *str = LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
list_remove(&str->entry);
- msi_free(str);
+ free(str);
}
- msi_free(stack);
+ free(stack);
}
-static void stack_push(STACK *stack, FORMSTR *str)
+static void stack_push(struct stack *stack, struct form_str *str)
{
list_add_head(&stack->items, &str->entry);
}
-static FORMSTR *stack_pop(STACK *stack)
+static struct form_str *stack_pop(struct stack *stack)
{
- FORMSTR *ret;
+ struct form_str *ret;
if (list_empty(&stack->items))
return NULL;
- ret = LIST_ENTRY(list_head(&stack->items), FORMSTR, entry);
+ ret = LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
list_remove(&ret->entry);
return ret;
}
-static FORMSTR *stack_find(STACK *stack, int type)
+static struct form_str *stack_find(struct stack *stack, int type)
{
- FORMSTR *str;
+ struct form_str *str;
- LIST_FOR_EACH_ENTRY(str, &stack->items, FORMSTR, entry)
+ LIST_FOR_EACH_ENTRY(str, &stack->items, struct form_str, entry)
{
if (str->type == type)
return str;
return NULL;
}
-static FORMSTR *stack_peek(STACK *stack)
+static struct form_str *stack_peek(struct stack *stack)
{
- return LIST_ENTRY(list_head(&stack->items), FORMSTR, entry);
+ return LIST_ENTRY(list_head(&stack->items), struct form_str, entry);
}
-static LPCWSTR get_formstr_data(FORMAT *format, FORMSTR *str)
+static const WCHAR *get_formstr_data(struct format *format, struct form_str *str)
{
return &format->deformatted[str->n];
}
-static WCHAR *dup_formstr( FORMAT *format, FORMSTR *str, int *ret_len )
+static WCHAR *dup_formstr( struct format *format, struct form_str *str, int *ret_len )
{
WCHAR *val;
if (!str->len) return NULL;
- if ((val = msi_alloc( (str->len + 1) * sizeof(WCHAR) )))
+ if ((val = malloc( (str->len + 1) * sizeof(WCHAR) )))
{
memcpy( val, get_formstr_data(format, str), str->len * sizeof(WCHAR) );
val[str->len] = 0;
return val;
}
-static WCHAR *deformat_index( FORMAT *format, FORMSTR *str, int *ret_len )
+static WCHAR *deformat_index( struct format *format, struct form_str *str, int *ret_len )
{
WCHAR *val, *ret;
DWORD len;
int field;
- if (!(val = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
+ if (!(val = malloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
lstrcpynW(val, get_formstr_data(format, str), str->len + 1);
field = wcstol( val, NULL, 10 );
- msi_free( val );
+ free( val );
if (MSI_RecordIsNull( format->record, field ) ||
MSI_RecordGetStringW( format->record, field, NULL, &len )) return NULL;
len++;
- if (!(ret = msi_alloc( len * sizeof(WCHAR) ))) return NULL;
+ if (!(ret = malloc( len * sizeof(WCHAR) ))) return NULL;
ret[0] = 0;
if (MSI_RecordGetStringW( format->record, field, ret, &len ))
{
- msi_free( ret );
+ free( ret );
return NULL;
}
*ret_len = len;
return ret;
}
-static WCHAR *deformat_property( FORMAT *format, FORMSTR *str, int *ret_len )
+static WCHAR *deformat_property( struct format *format, struct form_str *str, int *ret_len )
{
WCHAR *prop, *ret;
DWORD len = 0;
UINT r;
- if (!(prop = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
+ if (!(prop = malloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
lstrcpynW( prop, get_formstr_data(format, str), str->len + 1 );
r = msi_get_property( format->package->db, prop, NULL, &len );
if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
{
- msi_free( prop );
+ free( prop );
return NULL;
}
len++;
- if ((ret = msi_alloc( len * sizeof(WCHAR) )))
+ if ((ret = malloc( len * sizeof(WCHAR) )))
msi_get_property( format->package->db, prop, ret, &len );
- msi_free( prop );
+ free( prop );
*ret_len = len;
return ret;
}
-static WCHAR *deformat_component( FORMAT *format, FORMSTR *str, int *ret_len )
+static WCHAR *deformat_component( struct format *format, struct form_str *str, int *ret_len )
{
WCHAR *key, *ret;
MSICOMPONENT *comp;
- if (!(key = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
+ if (!(key = malloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
lstrcpynW(key, get_formstr_data(format, str), str->len + 1);
if (!(comp = msi_get_loaded_component( format->package, key )))
{
- msi_free( key );
+ free( key );
return NULL;
}
if (comp->Action == INSTALLSTATE_SOURCE)
ret = msi_resolve_source_folder( format->package, comp->Directory, NULL );
else
- ret = strdupW( msi_get_target_folder( format->package, comp->Directory ) );
+ ret = wcsdup( msi_get_target_folder( format->package, comp->Directory ) );
if (ret) *ret_len = lstrlenW( ret );
else *ret_len = 0;
- msi_free( key );
+ free( key );
return ret;
}
-static WCHAR *deformat_file( FORMAT *format, FORMSTR *str, BOOL shortname, int *ret_len )
+static WCHAR *deformat_file( struct format *format, struct form_str *str, BOOL shortname, int *ret_len )
{
WCHAR *key, *ret = NULL;
const MSIFILE *file;
DWORD len = 0;
- if (!(key = msi_alloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
+ if (!(key = malloc( (str->len + 1) * sizeof(WCHAR) ))) return NULL;
lstrcpynW(key, get_formstr_data(format, str), str->len + 1);
if (!(file = msi_get_loaded_file( format->package, key ))) goto done;
if (!shortname)
{
- if ((ret = strdupW( file->TargetPath ))) len = lstrlenW( ret );
+ if ((ret = wcsdup( file->TargetPath ))) len = lstrlenW( ret );
goto done;
}
if (!(len = GetShortPathNameW(file->TargetPath, NULL, 0)))
{
- if ((ret = strdupW( file->TargetPath ))) len = lstrlenW( ret );
+ if ((ret = wcsdup( file->TargetPath ))) len = lstrlenW( ret );
goto done;
}
len++;
- if ((ret = msi_alloc( len * sizeof(WCHAR) )))
+ if ((ret = malloc( len * sizeof(WCHAR) )))
len = GetShortPathNameW( file->TargetPath, ret, len );
done:
- msi_free( key );
+ free( key );
*ret_len = len;
return ret;
}
-static WCHAR *deformat_environment( FORMAT *format, FORMSTR *str, int *ret_len )
+static WCHAR *deformat_environment( struct format *format, struct form_str *str, int *ret_len )
{
WCHAR *key, *ret = NULL;
DWORD len;
- if (!(key = msi_alloc((str->len + 1) * sizeof(WCHAR)))) return NULL;
+ if (!(key = malloc((str->len + 1) * sizeof(WCHAR)))) return NULL;
lstrcpynW(key, get_formstr_data(format, str), str->len + 1);
if ((len = GetEnvironmentVariableW( key, NULL, 0 )))
{
len++;
- if ((ret = msi_alloc( len * sizeof(WCHAR) )))
+ if ((ret = malloc( len * sizeof(WCHAR) )))
*ret_len = GetEnvironmentVariableW( key, ret, len );
}
- msi_free( key );
+ free( key );
return ret;
}
-static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound,
+static WCHAR *deformat_literal( struct format *format, struct form_str *str, BOOL *propfound,
int *type, int *len )
{
LPCWSTR data = get_formstr_data(format, str);
{
if (str->len != 1)
replaced = NULL;
- else if ((replaced = msi_alloc( sizeof(WCHAR) )))
+ else if ((replaced = malloc( sizeof(WCHAR) )))
{
*replaced = 0;
*len = 0;
WCHAR *ret, *tmp, buf[26];
DWORD size = 1;
- if (!(ret = msi_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret[0] = 0;
for (i = 1; i <= count; i++)
{
size += swprintf( buf, ARRAY_SIZE(buf), L"%d: [%d] ", i, i );
- if (!(tmp = msi_realloc( ret, size * sizeof(*ret) )))
+ if (!(tmp = realloc( ret, size * sizeof(*ret) )))
{
- msi_free( ret );
+ free( ret );
return NULL;
}
ret = tmp;
return (format_is_alpha(x) || format_is_number(x));
}
-static int format_lex(FORMAT *format, FORMSTR **out)
+static int format_lex(struct format *format, struct form_str **out)
{
int type, len = 1;
- FORMSTR *str;
+ struct form_str *str;
LPCWSTR data;
WCHAR ch;
if (!format->deformatted)
return FORMAT_NULL;
- *out = msi_alloc_zero(sizeof(FORMSTR));
+ *out = calloc(1, sizeof(**out));
if (!*out)
return FORMAT_FAIL;
return type;
}
-static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop,
- int oldsize, int type, WCHAR *replace, int len )
+static struct form_str *format_replace( struct format *format, BOOL propfound, BOOL nonprop,
+ int oldsize, int type, WCHAR *replace, int len )
{
- FORMSTR *ret;
+ struct form_str *ret;
LPWSTR str, ptr;
DWORD size = 0;
int n;
if (size <= 1)
{
- msi_free(format->deformatted);
+ free(format->deformatted);
format->deformatted = NULL;
format->len = 0;
return NULL;
}
- str = msi_alloc(size * sizeof(WCHAR));
+ str = malloc(size * sizeof(WCHAR));
if (!str)
return NULL;
ptr = &format->deformatted[format->n + oldsize];
memcpy(&str[n], ptr, (lstrlenW(ptr) + 1) * sizeof(WCHAR));
- msi_free(format->deformatted);
+ free(format->deformatted);
format->deformatted = str;
format->len = size - 1;
if (!replace)
return NULL;
- ret = msi_alloc_zero(sizeof(FORMSTR));
+ ret = calloc(1, sizeof(*ret));
if (!ret)
return NULL;
return ret;
}
-static WCHAR *replace_stack_group( FORMAT *format, STACK *values,
+static WCHAR *replace_stack_group( struct format *format, struct stack *values,
BOOL *propfound, BOOL *nonprop,
int *oldsize, int *type, int *len )
{
WCHAR *replaced;
- FORMSTR *content, *node;
+ struct form_str *content, *node;
int n;
*nonprop = FALSE;
node = stack_pop(values);
n = node->n;
*oldsize = node->len;
- msi_free(node);
+ free(node);
while ((node = stack_pop(values)))
{
if (node->propfound)
*propfound = TRUE;
- msi_free(node);
+ free(node);
}
- content = msi_alloc_zero(sizeof(FORMSTR));
+ content = calloc(1, sizeof(*content));
content->n = n;
content->len = *oldsize;
content->type = FORMAT_LITERAL;
if (!format->groupfailed && (*oldsize == 2 ||
(format->propfailed && !*nonprop)))
{
- msi_free(content);
+ free(content);
return NULL;
}
else if (format->deformatted[content->n + 1] == '{' &&
replaced = dup_formstr( format, content, len );
*type = content->type;
- msi_free(content);
+ free(content);
if (format->groups == 0)
format->propfailed = FALSE;
return replaced;
}
-static WCHAR *replace_stack_prop( FORMAT *format, STACK *values,
+static WCHAR *replace_stack_prop( struct format *format, struct stack *values,
BOOL *propfound, BOOL *nonprop,
int *oldsize, int *type, int *len )
{
WCHAR *replaced;
- FORMSTR *content, *node;
+ struct form_str *content, *node;
int n;
*propfound = FALSE;
n = node->n;
*oldsize = node->len;
*type = stack_peek(values)->type;
- msi_free(node);
+ free(node);
while ((node = stack_pop(values)))
{
stack_peek(values) && node->type != *type)
*type = FORMAT_LITERAL;
- msi_free(node);
+ free(node);
}
- content = msi_alloc_zero(sizeof(FORMSTR));
+ content = calloc(1, sizeof(*content));
content->n = n + 1;
content->len = *oldsize - 2;
content->type = *type;
content->len += 2;
replaced = dup_formstr( format, content, len );
}
- msi_free(content);
+ free(content);
return replaced;
}
-static UINT replace_stack(FORMAT *format, STACK *stack, STACK *values)
+static UINT replace_stack(struct format *format, struct stack *stack, struct stack *values)
{
WCHAR *replaced = NULL;
- FORMSTR *beg, *top, *node;
+ struct form_str *beg, *top, *node;
BOOL propfound = FALSE, nonprop = FALSE, group = FALSE;
int type, n, len = 0, oldsize = 0;
format->n = n;
beg = format_replace( format, propfound, nonprop, oldsize, type, replaced, len );
- msi_free(replaced);
+ free(replaced);
if (!beg)
return ERROR_SUCCESS;
if (beg->propfound)
top->propfound = TRUE;
- msi_free(beg);
+ free(beg);
return ERROR_SUCCESS;
}
}
WCHAR** data, DWORD *len,
MSIRECORD* record)
{
- FORMAT format;
- FORMSTR *str = NULL;
- STACK *stack, *temp;
- FORMSTR *node;
+ struct format format;
+ struct form_str *str = NULL;
+ struct stack *stack, *temp;
+ struct form_str *node;
int type;
if (!ptr)
return ERROR_SUCCESS;
}
- *data = strdupW(ptr);
+ *data = wcsdup(ptr);
*len = lstrlenW(ptr);
- ZeroMemory(&format, sizeof(FORMAT));
+ ZeroMemory(&format, sizeof(format));
format.package = package;
format.record = record;
format.deformatted = *data;
*data = format.deformatted;
*len = format.len;
- msi_free(str);
+ free(str);
free_stack(stack);
free_stack(temp);
{
deformat_string_internal(package, MSI_RecordGetString(record, i), &deformated, &len, NULL);
MSI_RecordSetStringW(record_deformated, i, deformated);
- msi_free(deformated);
+ free(deformated);
}
}
*size = len;
msiobj_release(&record_deformated->hdr);
end:
- msi_free( format );
- msi_free( deformated );
+ free( format );
+ free( deformated );
return rc;
}
if (r != ERROR_SUCCESS)
return r;
- value = msi_alloc(++len * sizeof(WCHAR));
+ value = malloc(++len * sizeof(WCHAR));
if (!value)
goto done;
if (!r)
r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
- msi_free(value);
+ free(value);
done:
msiobj_release(&rec->hdr);
if (package) msiobj_release(&package->hdr);
MSI_RecordSetStringW( rec, 0, fmt );
MSI_FormatRecordW( package, rec, NULL, &len );
- if (!(*data = msi_alloc( ++len * sizeof(WCHAR) )))
+ if (!(*data = malloc( ++len * sizeof(WCHAR) )))
{
msiobj_release( &rec->hdr );
return 0;
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-static CRITICAL_SECTION MSI_handle_cs;
-static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug =
+static CRITICAL_SECTION handle_cs;
+static CRITICAL_SECTION_DEBUG handle_cs_debug =
{
- 0, 0, &MSI_handle_cs,
- { &MSI_handle_cs_debug.ProcessLocksList,
- &MSI_handle_cs_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_handle_cs") }
+ 0, 0, &handle_cs,
+ { &handle_cs_debug.ProcessLocksList,
+ &handle_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": handle_cs") }
};
-static CRITICAL_SECTION MSI_handle_cs = { &MSI_handle_cs_debug, -1, 0, 0, 0, 0 };
+static CRITICAL_SECTION handle_cs = { &handle_cs_debug, -1, 0, 0, 0, 0 };
-static CRITICAL_SECTION MSI_object_cs;
-static CRITICAL_SECTION_DEBUG MSI_object_cs_debug =
+static CRITICAL_SECTION object_cs;
+static CRITICAL_SECTION_DEBUG object_cs_debug =
{
- 0, 0, &MSI_object_cs,
- { &MSI_object_cs_debug.ProcessLocksList,
- &MSI_object_cs_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_object_cs") }
+ 0, 0, &object_cs,
+ { &object_cs_debug.ProcessLocksList,
+ &object_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": object_cs") }
};
-static CRITICAL_SECTION MSI_object_cs = { &MSI_object_cs_debug, -1, 0, 0, 0, 0 };
+static CRITICAL_SECTION object_cs = { &object_cs_debug, -1, 0, 0, 0, 0 };
-typedef struct msi_handle_info_t
+struct handle_info
{
BOOL remote;
union {
MSIHANDLE rem;
} u;
DWORD dwThreadId;
-} msi_handle_info;
+};
-static msi_handle_info *msihandletable = NULL;
-static unsigned int msihandletable_size = 0;
+static struct handle_info *handle_table = NULL;
+static unsigned int handle_table_size = 0;
void msi_free_handle_table(void)
{
- msi_free( msihandletable );
- msihandletable = NULL;
- msihandletable_size = 0;
- DeleteCriticalSection(&MSI_handle_cs);
- DeleteCriticalSection(&MSI_object_cs);
+ free( handle_table );
+ handle_table = NULL;
+ handle_table_size = 0;
+ DeleteCriticalSection(&handle_cs);
+ DeleteCriticalSection(&object_cs);
}
static MSIHANDLE alloc_handle_table_entry(void)
UINT i;
/* find a slot */
- for(i=0; i<msihandletable_size; i++)
- if( !msihandletable[i].u.obj && !msihandletable[i].u.rem )
+ for(i = 0; i < handle_table_size; i++)
+ if (!handle_table[i].u.obj && !handle_table[i].u.rem)
break;
- if( i==msihandletable_size )
+ if (i == handle_table_size)
{
- msi_handle_info *p;
+ struct handle_info *p;
int newsize;
- if (msihandletable_size == 0)
+ if (!handle_table_size)
{
newsize = 256;
- p = msi_alloc_zero(newsize * sizeof(*p));
+ p = calloc(newsize, sizeof(*p));
}
else
{
- newsize = msihandletable_size * 2;
- p = msi_realloc(msihandletable, newsize * sizeof(*p));
- if (p) memset(p + msihandletable_size, 0, (newsize - msihandletable_size) * sizeof(*p));
+ newsize = handle_table_size * 2;
+ p = realloc(handle_table, newsize * sizeof(*p));
+ if (p) memset(p + handle_table_size, 0, (newsize - handle_table_size) * sizeof(*p));
}
if (!p)
return 0;
- msihandletable = p;
- msihandletable_size = newsize;
+ handle_table = p;
+ handle_table_size = newsize;
}
return i + 1;
}
MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
{
- msi_handle_info *entry;
+ struct handle_info *entry;
MSIHANDLE ret;
- EnterCriticalSection( &MSI_handle_cs );
+ EnterCriticalSection( &handle_cs );
ret = alloc_handle_table_entry();
if (ret)
{
- entry = &msihandletable[ ret - 1 ];
+ entry = &handle_table[ ret - 1 ];
msiobj_addref( obj );
entry->u.obj = obj;
entry->dwThreadId = GetCurrentThreadId();
entry->remote = FALSE;
}
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
TRACE( "%p -> %lu\n", obj, ret );
MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote)
{
- msi_handle_info *entry;
+ struct handle_info *entry;
MSIHANDLE ret;
- EnterCriticalSection( &MSI_handle_cs );
+ EnterCriticalSection( &handle_cs );
ret = alloc_handle_table_entry();
if (ret)
{
- entry = &msihandletable[ ret - 1 ];
+ entry = &handle_table[ ret - 1 ];
entry->u.rem = remote;
entry->dwThreadId = GetCurrentThreadId();
entry->remote = TRUE;
}
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
TRACE( "%lu -> %lu\n", remote, ret );
{
MSIOBJECTHDR *ret = NULL;
- EnterCriticalSection( &MSI_handle_cs );
+ EnterCriticalSection( &handle_cs );
handle--;
- if( handle >= msihandletable_size )
+ if (handle >= handle_table_size)
goto out;
- if( msihandletable[handle].remote)
+ if (handle_table[handle].remote)
goto out;
- if( !msihandletable[handle].u.obj )
+ if (!handle_table[handle].u.obj)
goto out;
- if( msihandletable[handle].u.obj->magic != MSIHANDLE_MAGIC )
+ if (handle_table[handle].u.obj->magic != MSIHANDLE_MAGIC)
goto out;
- if( type && (msihandletable[handle].u.obj->type != type) )
+ if (type && (handle_table[handle].u.obj->type != type))
goto out;
- ret = msihandletable[handle].u.obj;
+ ret = handle_table[handle].u.obj;
msiobj_addref( ret );
out:
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
return ret;
}
{
MSIHANDLE ret = 0;
- EnterCriticalSection( &MSI_handle_cs );
+ EnterCriticalSection( &handle_cs );
handle--;
- if( handle>=msihandletable_size )
+ if (handle >= handle_table_size)
goto out;
- if( !msihandletable[handle].remote)
+ if (!handle_table[handle].remote)
goto out;
- ret = msihandletable[handle].u.rem;
+ ret = handle_table[handle].u.rem;
out:
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
return ret;
}
{
MSIOBJECTHDR *info;
- info = msi_alloc_zero( size );
+ info = calloc( 1, size );
if( info )
{
info->magic = MSIHANDLE_MAGIC;
void msiobj_lock( MSIOBJECTHDR *info )
{
- EnterCriticalSection( &MSI_object_cs );
+ EnterCriticalSection( &object_cs );
}
void msiobj_unlock( MSIOBJECTHDR *info )
{
- LeaveCriticalSection( &MSI_object_cs );
+ LeaveCriticalSection( &object_cs );
}
int msiobj_release( MSIOBJECTHDR *info )
{
if( info->destructor )
info->destructor( info );
- msi_free( info );
TRACE("object %p destroyed\n", info);
+ free( info );
}
return ret;
if (!handle)
return ERROR_SUCCESS;
- EnterCriticalSection( &MSI_handle_cs );
+ EnterCriticalSection( &handle_cs );
handle--;
- if (handle >= msihandletable_size)
+ if (handle >= handle_table_size)
goto out;
- if (msihandletable[handle].remote)
+ if (handle_table[handle].remote)
{
- remote_CloseHandle( msihandletable[handle].u.rem );
+ remote_CloseHandle( handle_table[handle].u.rem );
}
else
{
- info = msihandletable[handle].u.obj;
+ info = handle_table[handle].u.obj;
if( !info )
goto out;
}
}
- msihandletable[handle].u.obj = NULL;
- msihandletable[handle].remote = 0;
- msihandletable[handle].dwThreadId = 0;
+ handle_table[handle].u.obj = NULL;
+ handle_table[handle].remote = 0;
+ handle_table[handle].dwThreadId = 0;
ret = ERROR_SUCCESS;
TRACE( "handle %lu destroyed\n", handle + 1 );
out:
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
if( info )
msiobj_release( info );
TRACE("\n");
- EnterCriticalSection( &MSI_handle_cs );
- for(i=0; i<msihandletable_size; i++)
+ EnterCriticalSection( &handle_cs );
+ for (i = 0; i < handle_table_size; i++)
{
- if(msihandletable[i].dwThreadId == GetCurrentThreadId())
+ if (handle_table[i].dwThreadId == GetCurrentThreadId())
{
- LeaveCriticalSection( &MSI_handle_cs );
- MsiCloseHandle( i+1 );
- EnterCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
+ MsiCloseHandle( i + 1 );
+ EnterCriticalSection( &handle_cs );
n++;
}
}
- LeaveCriticalSection( &MSI_handle_cs );
+ LeaveCriticalSection( &handle_cs );
return n;
}
/* below is the query interface to a table */
-typedef struct tagMSIINSERTVIEW
+struct insert_view
{
MSIVIEW view;
MSIVIEW *table;
BOOL bIsTemp;
MSIVIEW *sv;
column_info *vals;
-} MSIINSERTVIEW;
+};
static UINT INSERT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
TRACE("%p %d %d %p\n", iv, row, col, val );
/* checks to see if the column order specified in the INSERT query
* matches the column order of the table
*/
-static BOOL msi_columns_in_order(MSIINSERTVIEW *iv, UINT col_count)
+static BOOL columns_in_order(struct insert_view *iv, UINT col_count)
{
LPCWSTR a, b;
UINT i;
/* rearranges the data in the record to be inserted based on column order,
* and pads the record for any missing columns in the INSERT query
*/
-static UINT msi_arrange_record(MSIINSERTVIEW *iv, MSIRECORD **values)
+static UINT arrange_record(struct insert_view *iv, MSIRECORD **values)
{
MSIRECORD *padded;
UINT col_count, val_count;
/* check to see if the columns are arranged already
* to avoid unnecessary copying
*/
- if (col_count == val_count && msi_columns_in_order(iv, col_count))
+ if (col_count == val_count && columns_in_order(iv, col_count))
return ERROR_SUCCESS;
padded = MSI_CreateRecord(col_count);
return r;
}
-static BOOL row_has_null_primary_keys(MSIINSERTVIEW *iv, MSIRECORD *row)
+static BOOL row_has_null_primary_keys(struct insert_view *iv, MSIRECORD *row)
{
UINT r, i, col_count, type;
static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
UINT r, row = -1, col_count = 0;
MSIVIEW *sv;
MSIRECORD *values = NULL;
if( !values )
goto err;
- r = msi_arrange_record( iv, &values );
+ r = arrange_record( iv, &values );
if( r != ERROR_SUCCESS )
goto err;
static UINT INSERT_close( struct tagMSIVIEW *view )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv;
TRACE("%p\n", iv);
static UINT INSERT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv;
TRACE("%p %p %p\n", iv, rows, cols );
static UINT INSERT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv;
TRACE("%p %d %p %p %p %p\n", iv, n, name, type, temporary, table_name );
static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec, UINT row)
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
TRACE("%p %d %p\n", iv, eModifyMode, rec );
static UINT INSERT_delete( struct tagMSIVIEW *view )
{
- MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
+ struct insert_view *iv = (struct insert_view *)view;
MSIVIEW *sv;
TRACE("%p\n", iv );
if( sv )
sv->ops->delete( sv );
msiobj_release( &iv->db->hdr );
- msi_free( iv );
+ free( iv );
return ERROR_SUCCESS;
}
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
column_info *columns, column_info *values, BOOL temp )
{
- MSIINSERTVIEW *iv = NULL;
+ struct insert_view *iv = NULL;
UINT r;
MSIVIEW *tv = NULL, *sv = NULL;
return r;
}
- iv = msi_alloc_zero( sizeof *iv );
+ iv = calloc( 1, sizeof *iv );
if( !iv )
return ERROR_FUNCTION_FAILED;
return ERROR_FUNCTION_FAILED;
ret = MsiDoActionW( hInstall, szwAction );
- msi_free( szwAction );
+ free( szwAction );
return ret;
}
return ERROR_FUNCTION_FAILED;
ret = MsiSequenceW( hInstall, szwTable, iSequenceMode );
- msi_free( szwTable );
+ free( szwTable );
return ret;
}
if (folder) *folder = f;
if (f->ResolvedSource)
{
- path = strdupW( f->ResolvedSource );
+ path = wcsdup( f->ResolvedSource );
TRACE(" already resolved to %s\n", debugstr_w(path));
return path;
}
path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
TRACE("-> %s\n", debugstr_w(path));
- f->ResolvedSource = strdupW( path );
- msi_free( p );
+ f->ResolvedSource = wcsdup( path );
+ free( p );
return path;
}
rc = MsiSetTargetPathW( hInstall, szwFolder, szwFolderPath );
end:
- msi_free(szwFolder);
- msi_free(szwFolderPath);
+ free(szwFolder);
+ free(szwFolderPath);
return rc;
}
if (!(target_path = msi_normalize_path( path ))) return;
if (wcscmp( target_path, folder->ResolvedTarget ))
{
- msi_free( folder->ResolvedTarget );
+ free( folder->ResolvedTarget );
folder->ResolvedTarget = target_path;
msi_set_property( package->db, folder->Directory, folder->ResolvedTarget, -1 );
msi_resolve_target_folder( package, child->Directory, FALSE );
}
}
- else msi_free( target_path );
+ else free( target_path );
}
UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath )
if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
dir = msi_get_target_folder( package, comp->Directory );
- msi_free( file->TargetPath );
+ free( file->TargetPath );
file->TargetPath = msi_build_directory_name( 2, dir, file->FileName );
}
return ERROR_SUCCESS;
rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
- msi_free(szwFeature);
+ free(szwFeature);
return rc;
}
if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
r = MsiSetFeatureAttributesW( handle, featureW, attrs );
- msi_free( featureW );
+ free( featureW );
return r;
}
costing = msi_dup_property( package->db, L"CostingComplete" );
if (!costing || !wcscmp( costing, L"1" ))
{
- msi_free( costing );
+ free( costing );
msiobj_release( &package->hdr );
return ERROR_FUNCTION_FAILED;
}
- msi_free( costing );
+ free( costing );
if (!(feature = msi_get_loaded_feature( package, name )))
{
msiobj_release( &package->hdr );
if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY;
rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction);
- msi_free( szwFeature);
+ free(szwFeature);
return rc;
}
rc = MsiGetFeatureCostW(hInstall, szwFeature, iCostTree, iState, piCost);
- msi_free(szwFeature);
+ free(szwFeature);
return rc;
}
LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
{
- cost += cl->component->Cost;
+ cost += cl->component->cost;
}
return cost;
}
break;
}
- *cost /= 512;
return ERROR_SUCCESS;
}
if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
- if (title && title_len && !(titleW = msi_alloc( *title_len * sizeof(WCHAR) )))
+ if (title && title_len && !(titleW = malloc( *title_len * sizeof(WCHAR) )))
{
- msi_free( featureW );
+ free( featureW );
return ERROR_OUTOFMEMORY;
}
- if (help && help_len && !(helpW = msi_alloc( *help_len * sizeof(WCHAR) )))
+ if (help && help_len && !(helpW = malloc( *help_len * sizeof(WCHAR) )))
{
- msi_free( featureW );
- msi_free( titleW );
+ free( featureW );
+ free( titleW );
return ERROR_OUTOFMEMORY;
}
r = MsiGetFeatureInfoW( handle, featureW, attrs, titleW, title_len, helpW, help_len );
if (titleW) WideCharToMultiByte( CP_ACP, 0, titleW, -1, title, *title_len + 1, NULL, NULL );
if (helpW) WideCharToMultiByte( CP_ACP, 0, helpW, -1, help, *help_len + 1, NULL, NULL );
}
- msi_free( titleW );
- msi_free( helpW );
- msi_free( featureW );
+ free( titleW );
+ free( helpW );
+ free( featureW );
return r;
}
rc = MsiSetComponentStateW(hInstall, szwComponent, iState);
- msi_free(szwComponent);
+ free(szwComponent);
return rc;
}
rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction);
- msi_free( szwComponent);
+ free(szwComponent);
return rc;
}
UINT ret;
WCHAR *szwFeature = strdupAtoW(szFeature);
ret = MsiGetFeatureValidStatesW(hInstall, szwFeature, pInstallState);
- msi_free(szwFeature);
+ free(szwFeature);
return ret;
}
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <fcntl.h>
#include <stdarg.h>
#define COBJMACROS
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-/* from msvcrt/fcntl.h */
-#define _O_RDONLY 0
-#define _O_WRONLY 1
-#define _O_RDWR 2
-#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
-#define _O_APPEND 0x0008
-#define _O_RANDOM 0x0010
-#define _O_SEQUENTIAL 0x0020
-#define _O_TEMPORARY 0x0040
-#define _O_NOINHERIT 0x0080
-#define _O_CREAT 0x0100
-#define _O_TRUNC 0x0200
-#define _O_EXCL 0x0400
-#define _O_SHORT_LIVED 0x1000
-#define _O_TEXT 0x4000
-#define _O_BINARY 0x8000
-
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
{
WCHAR volume_name[MAX_PATH + 1], root[MAX_PATH + 1];
return !wcsicmp( mi->volume_label, p );
}
-static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
+static UINT change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
MSIRECORD *record;
LPWSTR source_dir;
}
msiobj_release(&record->hdr);
- msi_free(source_dir);
+ free(source_dir);
return r == IDRETRY ? ERROR_SUCCESS : ERROR_INSTALL_SOURCE_ABSENT;
}
-static MSICABINETSTREAM *msi_get_cabinet_stream( MSIPACKAGE *package, UINT disk_id )
+static MSICABINETSTREAM *get_cabinet_stream( MSIPACKAGE *package, UINT disk_id )
{
MSICABINETSTREAM *cab;
static void * CDECL cabinet_alloc(ULONG cb)
{
- return msi_alloc(cb);
+ return malloc(cb);
}
static void CDECL cabinet_free(void *pv)
{
- msi_free(pv);
+ free(pv);
}
static INT_PTR CDECL cabinet_open(char *pszFile, int oflag, int pmode)
DWORD dwAccess = 0;
DWORD dwShareMode = 0;
DWORD dwCreateDisposition = OPEN_EXISTING;
+ HANDLE handle;
+ WCHAR *path;
switch (oflag & _O_ACCMODE)
{
else if (oflag & _O_CREAT)
dwCreateDisposition = CREATE_ALWAYS;
- return (INT_PTR)CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
- dwCreateDisposition, 0, NULL);
+ path = strdupUtoW(pszFile);
+ handle = CreateFileW(path, dwAccess, dwShareMode, NULL, dwCreateDisposition, 0, NULL);
+ free(path);
+ return (INT_PTR)handle;
}
static UINT CDECL cabinet_read(INT_PTR hf, void *pv, UINT cb)
MSICABINETSTREAM *cab;
IStream *stream;
- if (!(cab = msi_get_cabinet_stream( package_disk.package, package_disk.id )))
+ if (!(cab = get_cabinet_stream( package_disk.package, package_disk.id )))
{
WARN("failed to get cabinet stream\n");
return -1;
return -1;
}
hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream );
- msi_free( encoded );
+ free( encoded );
if (FAILED(hr))
{
WARN( "failed to open stream %#lx\n", hr );
return -1;
}
-static UINT msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
+static UINT media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
MSIRECORD *row;
return ERROR_FUNCTION_FAILED;
}
- mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3));
- mi->cabinet = strdupW(MSI_RecordGetString(row, 4));
- mi->volume_label = strdupW(MSI_RecordGetString(row, 5));
+ mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
+ mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
+ mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
msiobj_release(&row->hdr);
return ERROR_SUCCESS;
WCHAR *ret;
len = lstrlenW(mi->sourcedir) + lstrlenW(mi->cabinet) + 1;
- if (!(ret = msi_alloc(len * sizeof(WCHAR)))) return NULL;
+ if (!(ret = malloc(len * sizeof(WCHAR)))) return NULL;
lstrcpyW(ret, mi->sourcedir);
lstrcatW(ret, mi->cabinet);
return ret;
INT_PTR res = -1;
UINT rc;
- msi_free(mi->disk_prompt);
- msi_free(mi->cabinet);
- msi_free(mi->volume_label);
+ free(mi->disk_prompt);
+ free(mi->cabinet);
+ free(mi->volume_label);
mi->disk_prompt = NULL;
mi->cabinet = NULL;
mi->volume_label = NULL;
mi->disk_id++;
mi->is_continuous = TRUE;
- rc = msi_media_get_disk_info(data->package, mi);
+ rc = media_get_disk_info(data->package, mi);
if (rc != ERROR_SUCCESS)
{
ERR("Failed to get next cabinet information: %d\n", rc);
if (length > 256)
{
WARN( "cannot update next cabinet filename with a string size %lu > 256\n", length );
- msi_free(next_cab);
+ free(next_cab);
goto done;
}
else
}
/* Path psz3 and cabinet psz1 are concatenated by FDI so just reset psz1 */
*pfdin->psz1 = 0;
- msi_free(next_cab);
+ free(next_cab);
}
if (!(cabinet_file = get_cabinet_filename(mi)))
res = 0;
if (GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES)
{
- if (msi_change_media(data->package, mi) != ERROR_SUCCESS)
+ if (change_media(data->package, mi) != ERROR_SUCCESS)
res = -1;
}
done:
- msi_free(cab);
- msi_free(cabinet_file);
+ free(cab);
+ free(cabinet_file);
return res;
}
MSIMEDIAINFO *mi = data->mi;
UINT rc;
- msi_free( mi->disk_prompt );
- msi_free( mi->cabinet );
- msi_free( mi->volume_label );
+ free( mi->disk_prompt );
+ free( mi->cabinet );
+ free( mi->volume_label );
mi->disk_prompt = NULL;
mi->cabinet = NULL;
mi->volume_label = NULL;
mi->disk_id++;
mi->is_continuous = TRUE;
- rc = msi_media_get_disk_info( data->package, mi );
+ rc = media_get_disk_info( data->package, mi );
if (rc != ERROR_SUCCESS)
{
ERR("Failed to get next cabinet information: %u\n", rc);
&attrs, data->user))
{
/* We're not extracting this file, so free the filename. */
- msi_free(data->curfile);
+ free(data->curfile);
data->curfile = NULL;
goto done;
}
TRACE("file in use, scheduling rename operation\n");
- if (!(tmppathW = strdupW( path ))) return ERROR_OUTOFMEMORY;
+ if (!(tmppathW = wcsdup(path))) return ERROR_OUTOFMEMORY;
if ((p = wcsrchr(tmppathW, '\\'))) *p = 0;
len = lstrlenW( tmppathW ) + 16;
- if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
+ if (!(tmpfileW = malloc(len * sizeof(WCHAR))))
{
- msi_free( tmppathW );
+ free( tmppathW );
return ERROR_OUTOFMEMORY;
}
- if (!GetTempFileNameW(tmppathW, L"msi", 0, tmpfileW)) tmpfileW[0] = 0;
- msi_free( tmppathW );
+ if (!msi_get_temp_file_name( data->package, tmppathW, L"msi", tmpfileW )) tmpfileW[0] = 0;
+ free( tmppathW );
- handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL);
+ handle = msi_create_file( data->package, tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, CREATE_ALWAYS, attrs );
if (handle != INVALID_HANDLE_VALUE &&
msi_move_file( data->package, path, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ) &&
else
{
WARN( "failed to schedule rename operation %s (error %lu)\n", debugstr_w(path), GetLastError() );
- DeleteFileW( tmpfileW );
+ msi_delete_file( data->package, tmpfileW );
}
- msi_free(tmpfileW);
+ free(tmpfileW);
}
else WARN( "failed to create %s (error %lu)\n", debugstr_w(path), err );
}
done:
- msi_free(path);
+ free(path);
return (INT_PTR)handle;
}
CloseHandle(handle);
data->cb(data->package, data->curfile, MSICABEXTRACT_FILEEXTRACTED, NULL, NULL, data->user);
- msi_free(data->curfile);
+ free(data->curfile);
data->curfile = NULL;
return 1;
return FALSE;
}
- cabinet = strdupWtoA( mi->cabinet );
+ cabinet = strdupWtoU( mi->cabinet );
if (!cabinet)
goto done;
- cab_path = strdupWtoA( mi->sourcedir );
+ cab_path = strdupWtoU( mi->sourcedir );
if (!cab_path)
goto done;
done:
FDIDestroy( hfdi );
- msi_free(cabinet );
- msi_free( cab_path );
+ free( cabinet );
+ free( cab_path );
if (ret)
mi->is_extracted = TRUE;
void msi_free_media_info(MSIMEDIAINFO *mi)
{
- msi_free(mi->disk_prompt);
- msi_free(mi->cabinet);
- msi_free(mi->volume_label);
- msi_free(mi->last_volume);
- msi_free(mi);
+ free(mi->disk_prompt);
+ free(mi->cabinet);
+ free(mi->volume_label);
+ free(mi->last_volume);
+ free(mi);
}
static UINT get_drive_type(const WCHAR *path)
static WCHAR *get_base_url( MSIDATABASE *db )
{
WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, L"OriginalDatabase" );
- if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0;
- msi_free( orig_db );
+ if (UrlIsW( orig_db, URLIS_URL ) && (ret = wcsdup( orig_db )) && (p = wcsrchr( ret, '/' ))) p[1] = 0;
+ free( orig_db );
return ret;
}
mi->is_extracted = FALSE;
mi->disk_id = MSI_RecordGetInteger(row, 1);
mi->last_sequence = MSI_RecordGetInteger(row, 2);
- msi_free(mi->disk_prompt);
- mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3));
- msi_free(mi->cabinet);
- mi->cabinet = strdupW(MSI_RecordGetString(row, 4));
- msi_free(mi->volume_label);
- mi->volume_label = strdupW(MSI_RecordGetString(row, 5));
+ free(mi->disk_prompt);
+ mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
+ free(mi->cabinet);
+ mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
+ free(mi->volume_label);
+ mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
msiobj_release(&row->hdr);
msi_set_sourcedir_props(package, FALSE);
TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
- msi_free(base_url);
- msi_free(source_dir);
+ free(base_url);
+ free(source_dir);
return ERROR_SUCCESS;
}
volume, &volumesz, prompt, &promptsz) == ERROR_SUCCESS)
{
mi->disk_id = id;
- msi_free( mi->volume_label );
- if (!(mi->volume_label = msi_alloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ free( mi->volume_label );
+ if (!(mi->volume_label = malloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
lstrcpyW( mi->volume_label, volume );
- msi_free( mi->disk_prompt );
- if (!(mi->disk_prompt = msi_alloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ free( mi->disk_prompt );
+ if (!(mi->disk_prompt = malloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
lstrcpyW( mi->disk_prompt, prompt );
if (source_matches_volume(mi, source))
{
WCHAR temppath[MAX_PATH], *p, *url;
- msi_free( cabinet_file );
- if (!(url = msi_alloc( (lstrlenW( base_url ) + lstrlenW( mi->cabinet ) + 1) * sizeof(WCHAR) )))
+ free( cabinet_file );
+ if (!(url = realloc( base_url, (wcslen( base_url ) + wcslen( mi->cabinet ) + 1) * sizeof(WCHAR) )))
{
+ free( base_url );
return ERROR_OUTOFMEMORY;
}
- lstrcpyW( url, base_url );
lstrcatW( url, mi->cabinet );
if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS)
{
ERR("failed to download %s (%u)\n", debugstr_w(url), rc);
- msi_free( url );
+ free( url );
return rc;
}
if ((p = wcsrchr( temppath, '\\' ))) *p = 0;
lstrcpyW( mi->sourcedir, temppath );
PathAddBackslashW( mi->sourcedir );
- msi_free( mi->cabinet );
- mi->cabinet = strdupW( p + 1 );
+ free( mi->cabinet );
+ mi->cabinet = wcsdup( p + 1 );
- msi_free( url );
+ free( url );
return ERROR_SUCCESS;
}
}
{
WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
BOOL match = source_matches_volume( mi, source );
- msi_free( source );
+ free( source );
if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE))
{
- if ((rc = msi_change_media( package, mi )) != ERROR_SUCCESS)
+ if ((rc = change_media( package, mi )) != ERROR_SUCCESS)
{
- msi_free( cabinet_file );
+ free( cabinet_file );
return rc;
}
}
}
- msi_free(mi->last_volume);
- mi->last_volume = strdupW(mi->volume_label);
+ free(mi->last_volume);
+ mi->last_volume = wcsdup(mi->volume_label);
}
if (mi->cabinet)
{
if ((rc = find_published_source( package, mi )) != ERROR_SUCCESS)
{
ERR("cabinet not found: %s\n", debugstr_w(cabinet_file));
- msi_free( cabinet_file );
+ free( cabinet_file );
return ERROR_INSTALL_FAILURE;
}
}
}
- msi_free( cabinet_file );
+ free( cabinet_file );
return ERROR_SUCCESS;
}
return ERROR_FUNCTION_FAILED;
}
}
- if (!(cab = msi_alloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
- if (!(cab->stream = msi_alloc( (lstrlenW( name ) + 1) * sizeof(WCHAR ) )))
+ if (!(cab = malloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
+ if (!(cab->stream = malloc( (wcslen( name ) + 1) * sizeof(WCHAR) )))
{
- msi_free( cab );
+ free( cab );
return ERROR_OUTOFMEMORY;
}
lstrcpyW( cab->stream, name );
#include <stdarg.h>
#define COBJMACROS
-#define NONAMELESSUNION
-
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
r = MsiOpenProductW( szwProd, phProduct );
- msi_free( szwProd );
+ free( szwProd );
return r;
}
done:
RegCloseKey(props);
- msi_free(path);
+ free(path);
return r;
}
r = MsiInstallProductW( szwPath, szwCommand );
end:
- msi_free( szwPath );
- msi_free( szwCommand );
+ free( szwPath );
+ free( szwCommand );
return r;
}
wszProduct = strdupAtoW(szProduct);
rc = MsiReinstallProductW(wszProduct, dwReinstallMode);
- msi_free(wszProduct);
+ free(wszProduct);
return rc;
}
r = MsiApplyPatchW(patch_package, install_package, eInstallType, command_line);
done:
- msi_free(patch_package);
- msi_free(install_package);
- msi_free(command_line);
+ free(patch_package);
+ free(install_package);
+ free(command_line);
return r;
}
goto done;
}
- codes = msi_alloc( ++size * sizeof(WCHAR) );
+ codes = malloc( ++size * sizeof(WCHAR) );
if (!codes)
{
r = ERROR_OUTOFMEMORY;
done:
MsiCloseHandle( info );
MsiCloseHandle( patch );
- msi_free( codes );
+ free( codes );
return r;
}
cmd_ptr = L"";
size = lstrlenW(cmd_ptr) + lstrlenW(L"%s PATCH=\"%s\"") + lstrlenW(szPatchPackage) + 1;
- cmd = msi_alloc(size * sizeof(WCHAR));
+ cmd = malloc(size * sizeof(WCHAR));
if (!cmd)
{
- msi_free(codes);
+ free(codes);
return ERROR_OUTOFMEMORY;
}
swprintf(cmd, size, L"%s PATCH=\"%s\"", cmd_ptr, szPatchPackage);
r = ERROR_SUCCESS;
}
- msi_free(cmd);
- msi_free(codes);
+ free(cmd);
+ free(codes);
return r;
}
r = MsiApplyMultiplePatchesW(patch_packages, product_code, properties_list);
done:
- msi_free(patch_packages);
- msi_free(product_code);
- msi_free(properties_list);
+ free(patch_packages);
+ free(product_code);
+ free(properties_list);
return r;
}
if (!len) return ERROR_INVALID_NAME;
- patch = msi_alloc((len + 1) * sizeof(WCHAR));
+ patch = malloc((len + 1) * sizeof(WCHAR));
if (!patch)
return ERROR_OUTOFMEMORY;
patch[len] = '\0';
r = MSI_ApplyPatchW(patch, szProductCode, szPropertiesList);
- msi_free(patch);
+ free(patch);
if (r != ERROR_SUCCESS || !*end)
break;
static void free_patchinfo( DWORD count, MSIPATCHSEQUENCEINFOW *info )
{
DWORD i;
- for (i = 0; i < count; i++) msi_free( (WCHAR *)info[i].szPatchData );
- msi_free( info );
+ for (i = 0; i < count; i++) free( (WCHAR *)info[i].szPatchData );
+ free( info );
}
static MSIPATCHSEQUENCEINFOW *patchinfoAtoW( DWORD count, const MSIPATCHSEQUENCEINFOA *info )
DWORD i;
MSIPATCHSEQUENCEINFOW *ret;
- if (!(ret = msi_alloc( count * sizeof(MSIPATCHSEQUENCEINFOW) ))) return NULL;
+ if (!(ret = malloc( count * sizeof(MSIPATCHSEQUENCEINFOW) ))) return NULL;
for (i = 0; i < count; i++)
{
if (info[i].szPatchData && !(ret[i].szPatchData = strdupAtoW( info[i].szPatchData )))
if (!(psi = patchinfoAtoW( cPatchInfo, pPatchInfo )))
{
- msi_free( package_path );
+ free( package_path );
return ERROR_OUTOFMEMORY;
}
r = MsiDetermineApplicablePatchesW( package_path, cPatchInfo, psi );
pPatchInfo[i].uStatus = psi[i].uStatus;
}
}
- msi_free( package_path );
+ free( package_path );
free_patchinfo( cPatchInfo, psi );
return r;
}
if (r != ERROR_SUCCESS)
TRACE("patch not applicable\n");
- msi_free( product_code );
+ free( product_code );
return r;
}
if (!(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
if (usersid && !(usersidW = strdupAtoW( usersid )))
{
- msi_free( productW );
+ free( productW );
return ERROR_OUTOFMEMORY;
}
if (!(patchinfoW = patchinfoAtoW( count, patchinfo )))
{
- msi_free( productW );
- msi_free( usersidW );
+ free( productW );
+ free( usersidW );
return ERROR_OUTOFMEMORY;
}
r = MsiDeterminePatchSequenceW( productW, usersidW, context, count, patchinfoW );
patchinfo[i].uStatus = patchinfoW[i].uStatus;
}
}
- msi_free( productW );
- msi_free( usersidW );
+ free( productW );
+ free( usersidW );
free_patchinfo( count, patchinfoW );
return r;
}
if ((localpath = msi_reg_get_val_str( props, L"LocalPackage" )))
{
lstrcpyW( sourcepath, localpath );
- msi_free( localpath );
+ free( localpath );
}
RegCloseKey( props );
if (!localpath || GetFileAttributesW( sourcepath ) == INVALID_FILE_ATTRIBUTES)
if (context == MSIINSTALLCONTEXT_MACHINE)
sz += lstrlenW(L" ALLUSERS=1");
- commandline = msi_alloc(sz * sizeof(WCHAR));
+ commandline = malloc(sz * sizeof(WCHAR));
if (!commandline)
{
r = ERROR_OUTOFMEMORY;
r = MSI_InstallPackage( package, sourcepath, commandline );
- msi_free(commandline);
+ free(commandline);
end:
msiobj_release( &package->hdr );
r = MsiConfigureProductExW( szwProduct, iInstallLevel, eInstallState,
szwCommandLine );
end:
- msi_free( szwProduct );
- msi_free( szwCommandLine);
+ free( szwProduct );
+ free( szwCommandLine);
return r;
}
}
r = MsiConfigureProductW( szwProduct, iInstallLevel, eInstallState );
- msi_free( szwProduct );
+ free( szwProduct );
return r;
}
if(*szwBuffer)
WideCharToMultiByte(CP_ACP, 0, szwBuffer, -1, szBuffer, GUID_SIZE, NULL, NULL);
- msi_free( szwComponent );
+ free( szwComponent );
return r;
}
if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
swprintf( temp, ARRAY_SIZE(temp), L"%u", val );
- return strdupW( temp );
+ return wcsdup( temp );
}
ERR( "unhandled value type %lu\n", *type );
else
{
unsquash_guid(val, packagecode);
- msi_free(val);
- val = strdupW(packagecode);
+ free(val);
+ val = wcsdup(packagecode);
}
}
}
r = ERROR_BAD_CONFIGURATION;
if (val != empty)
- msi_free(val);
+ free(val);
done:
RegCloseKey(prodkey);
&buffer, pcchValueBuf );
end:
- msi_free( szwProduct );
- msi_free( szwAttribute );
+ free( szwProduct );
+ free( szwAttribute );
return r;
}
if (r != ERROR_SUCCESS)
goto done;
- value = msi_alloc(++len * sizeof(WCHAR));
+ value = malloc(++len * sizeof(WCHAR));
if (!value)
{
r = ERROR_OUTOFMEMORY;
*pcchValue = len - 1;
done:
- msi_free(product);
- msi_free(usersid);
- msi_free(property);
- msi_free(value);
+ free(product);
+ free(usersid);
+ free(property);
+ free(value);
return r;
}
-static UINT msi_copy_outval(LPWSTR val, LPWSTR out, LPDWORD size)
+static UINT copy_outval(const WCHAR *val, WCHAR *out, DWORD *size)
{
UINT r = ERROR_SUCCESS;
goto done;
}
- msi_free(val);
+ free(val);
if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
szProperty = L"DisplayName";
val = reg_get_value(props, szProperty, &type);
if (!val)
- val = strdupW(L"");
+ val = wcsdup(L"");
- r = msi_copy_outval(val, szValue, pcchValue);
+ r = copy_outval(val, szValue, pcchValue);
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_TRANSFORMSW ) ||
!wcscmp( szProperty, INSTALLPROPERTY_LANGUAGEW ) ||
val = reg_get_value(hkey, szProperty, &type);
if (!val)
- val = strdupW(L"");
+ val = wcsdup(L"");
- r = msi_copy_outval(val, szValue, pcchValue);
+ r = copy_outval(val, szValue, pcchValue);
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_PRODUCTSTATEW ))
{
if (!val)
goto done;
- msi_free(val);
- val = strdupW(L"5");
+ free(val);
+ val = wcsdup(L"5");
}
else
- val = strdupW(L"1");
+ val = wcsdup(L"1");
- r = msi_copy_outval(val, szValue, pcchValue);
+ r = copy_outval(val, szValue, pcchValue);
goto done;
}
else if (props && (val = reg_get_value(props, package, &type)))
{
- msi_free(val);
- val = strdupW(L"5");
- r = msi_copy_outval(val, szValue, pcchValue);
+ free(val);
+ val = wcsdup(L"5");
+ r = copy_outval(val, szValue, pcchValue);
goto done;
}
if (prod || managed)
- val = strdupW(L"1");
+ val = wcsdup(L"1");
else
goto done;
- r = msi_copy_outval(val, szValue, pcchValue);
+ r = copy_outval(val, szValue, pcchValue);
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_ASSIGNMENTTYPEW ))
{
goto done;
/* FIXME */
- val = strdupW(L"");
- r = msi_copy_outval(val, szValue, pcchValue);
+ val = wcsdup(L"");
+ r = copy_outval(val, szValue, pcchValue);
}
else
r = ERROR_UNKNOWN_PROPERTY;
RegCloseKey(prod);
RegCloseKey(managed);
RegCloseKey(classes);
- msi_free(val);
+ free(val);
return r;
}
if (r != ERROR_SUCCESS)
goto done;
- val = msi_alloc(++len * sizeof(WCHAR));
+ val = malloc(++len * sizeof(WCHAR));
if (!val)
{
r = ERROR_OUTOFMEMORY;
*pcchValue = len;
done:
- msi_free(val);
- msi_free(patch);
- msi_free(product);
- msi_free(usersid);
- msi_free(property);
+ free(val);
+ free(patch);
+ free(product);
+ free(usersid);
+ free(property);
return r;
}
val = reg_get_value(datakey, szProperty, &type);
if (!val)
- val = strdupW(L"");
+ val = wcsdup(L"");
r = ERROR_SUCCESS;
*pcchValue = len;
done:
- msi_free(val);
+ free(val);
RegCloseKey(prodpatches);
RegCloseKey(prod);
RegCloseKey(patch);
goto done;
size++;
- if (!(bufferW = msi_alloc( size * sizeof(WCHAR) )))
+ if (!(bufferW = malloc( size * sizeof(WCHAR) )))
{
r = ERROR_OUTOFMEMORY;
goto done;
}
done:
- msi_free( patchW );
- msi_free( attrW );
- msi_free( bufferW );
+ free( patchW );
+ free( attrW );
+ free( bufferW );
return r;
}
return ERROR_OUTOFMEMORY;
}
r = MsiEnableLogW( dwLogMode, szwLogFile, attributes );
- msi_free( szwLogFile );
+ free( szwLogFile );
return r;
}
{
TRACE( "%#lx, %s, %#lx\n", dwLogMode, debugstr_w(szLogFile), attributes );
- msi_free(gszLogFile);
+ free(gszLogFile);
gszLogFile = NULL;
if (szLogFile)
{
FILE_ATTRIBUTE_NORMAL, NULL);
if (file != INVALID_HANDLE_VALUE)
{
- gszLogFile = strdupW(szLogFile);
+ gszLogFile = wcsdup(szLogFile);
CloseHandle(file);
}
else ERR( "unable to enable log %s (%lu)\n", debugstr_w(szLogFile), GetLastError() );
if (component && !(componentW = strdupAtoW( component ))) return ERROR_OUTOFMEMORY;
len = *buflen;
- if (!(driveW = msi_alloc( len * sizeof(WCHAR) )))
+ if (!(driveW = malloc( len * sizeof(WCHAR) )))
{
- msi_free( componentW );
+ free( componentW );
return ERROR_OUTOFMEMORY;
}
r = MsiEnumComponentCostsW( handle, componentW, index, state, driveW, buflen, cost, temp );
{
WideCharToMultiByte( CP_ACP, 0, driveW, -1, drive, len, NULL, NULL );
}
- msi_free( componentW );
- msi_free( driveW );
+ free( componentW );
+ free( driveW );
return r;
}
GetWindowsDirectoryW( path, MAX_PATH );
if (component && component[0])
{
- if (msi_is_global_assembly( comp )) *temp = comp->Cost;
+ if (msi_is_global_assembly( comp )) *temp = comp->cost;
if (!comp->Enabled || !comp->KeyPath)
{
*cost = 0;
}
else if ((file = msi_get_loaded_file( package, comp->KeyPath )))
{
- *cost = max( 8, comp->Cost / 512 );
+ *cost = comp->cost;
*buflen = set_drive( drive, file->TargetPath[0] );
r = ERROR_SUCCESS;
}
}
else if (IStorage_Stat( package->db->storage, &stat, STATFLAG_NONAME ) == S_OK)
{
- *temp = max( 8, stat.cbSize.QuadPart / 512 );
+ *temp = cost_from_size( stat.cbSize.QuadPart );
*buflen = set_drive( drive, path[0] );
r = ERROR_SUCCESS;
}
r = MsiQueryComponentStateW(prodcode, usersid, dwContext, comp, pdwState);
- msi_free(prodcode);
- msi_free(usersid);
- msi_free(comp);
+ free(prodcode);
+ free(usersid);
+ free(comp);
return r;
}
-static BOOL msi_comp_find_prod_key(LPCWSTR prodcode, MSIINSTALLCONTEXT context)
+static BOOL comp_find_prod_key(const WCHAR *prodcode, MSIINSTALLCONTEXT context)
{
UINT r;
HKEY hkey = NULL;
return (r == ERROR_SUCCESS);
}
-static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context)
+static BOOL comp_find_package(const WCHAR *prodcode, MSIINSTALLCONTEXT context)
{
LPCWSTR package;
HKEY hkey;
return (res == ERROR_SUCCESS);
}
-static UINT msi_comp_find_prodcode(WCHAR *squashed_pc,
- MSIINSTALLCONTEXT context,
- LPCWSTR comp, LPWSTR val, DWORD *sz)
+static UINT comp_find_prodcode(const WCHAR *squashed_pc, MSIINSTALLCONTEXT context, const WCHAR *comp, WCHAR *val,
+ DWORD *sz)
{
HKEY hkey;
LONG res;
if (!squash_guid( szProductCode, squashed_pc ))
return ERROR_INVALID_PARAMETER;
- found = msi_comp_find_prod_key(szProductCode, dwContext);
+ found = comp_find_prod_key(szProductCode, dwContext);
- if (!msi_comp_find_package(szProductCode, dwContext))
+ if (!comp_find_package(szProductCode, dwContext))
{
if (found)
{
*pdwState = INSTALLSTATE_UNKNOWN;
sz = 0;
- if (msi_comp_find_prodcode( squashed_pc, dwContext, szComponent, NULL, &sz ))
+ if (comp_find_prodcode( squashed_pc, dwContext, szComponent, NULL, &sz ))
return ERROR_UNKNOWN_COMPONENT;
if (sz == 0)
WCHAR *val;
UINT r;
- if (!(val = msi_alloc( sz ))) return ERROR_OUTOFMEMORY;
- if ((r = msi_comp_find_prodcode( squashed_pc, dwContext, szComponent, val, &sz )))
+ if (!(val = malloc( sz ))) return ERROR_OUTOFMEMORY;
+ if ((r = comp_find_prodcode( squashed_pc, dwContext, szComponent, val, &sz )))
{
- msi_free(val);
+ free(val);
return r;
}
}
else
*pdwState = INSTALLSTATE_LOCAL;
- msi_free( val );
+ free( val );
}
TRACE("-> %d\n", *pdwState);
return ERROR_OUTOFMEMORY;
}
r = MsiQueryProductStateW( szwProduct );
- msi_free( szwProduct );
+ free( szwProduct );
return r;
}
LANGID r;
INT len;
- bufW = msi_alloc(nBufferMax*sizeof(WCHAR));
+ bufW = malloc(nBufferMax * sizeof(WCHAR));
r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang);
if( r )
{
else
r = 0;
}
- msi_free(bufW);
+ free(bufW);
return r;
}
if (path && !(pathW = strdupAtoW( path ))) return E_OUTOFMEMORY;
r = MsiGetFileSignatureInformationW( pathW, flags, cert, hash, hashlen );
- msi_free( pathW );
+ free( pathW );
return r;
}
info.hFile = NULL;
info.pgKnownSubject = NULL;
+ memset( &data, 0, sizeof(data) );
data.cbStruct = sizeof(data);
- data.pPolicyCallbackData = NULL;
- data.pSIPClientData = NULL;
data.dwUIChoice = WTD_UI_NONE;
data.fdwRevocationChecks = WTD_REVOKE_WHOLECHAIN;
data.dwUnionChoice = WTD_CHOICE_FILE;
- data.u.pFile = &info;
+ data.pFile = &info;
data.dwStateAction = WTD_STATEACTION_VERIFY;
- data.hWVTStateData = NULL;
- data.pwszURLReference = NULL;
- data.dwProvFlags = 0;
data.dwUIContext = WTD_UICONTEXT_INSTALL;
+
hr = WinVerifyTrustEx( INVALID_HANDLE_VALUE, &generic_verify_v2, &data );
*cert = NULL;
if (FAILED(hr)) goto done;
goto done;
}
- val = msi_alloc(++len * sizeof(WCHAR));
+ val = malloc(++len * sizeof(WCHAR));
if (!val)
{
r = ERROR_OUTOFMEMORY;
}
done:
- msi_free(prop);
- msi_free(val);
+ free(prop);
+ free(val);
return r;
}
r = MsiVerifyPackageW( szPack );
- msi_free( szPack );
+ free( szPack );
return r;
}
if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
{
- msi_free(path);
+ free(path);
path = msi_reg_get_val_str( hkey, squashed_pc );
RegCloseKey(hkey);
if (msi_strcpy_to_awstring(path, -1, lpPathBuf, pcchBuf) == ERROR_MORE_DATA)
state = INSTALLSTATE_MOREDATA;
- msi_free(path);
+ free(path);
return state;
}
r = MSI_GetComponentPath( productW, compW, usersidW, ctx, &path, buflen );
end:
- msi_free( productW );
- msi_free( compW );
- msi_free( usersidW );
+ free( productW );
+ free( compW );
+ free( usersidW );
return r;
}
if (!parent) return ERROR_UNKNOWN_FEATURE;
*state = (parent[0] == 6) ? INSTALLSTATE_ABSENT : INSTALLSTATE_LOCAL;
- msi_free( parent );
+ free( parent );
if (*state == INSTALLSTATE_ABSENT)
return ERROR_SUCCESS;
if (!decode_base85_guid( p, &guid ))
{
if (p != components) break;
- msi_free( components );
+ free( components );
*state = INSTALLSTATE_BADCONFIG;
return ERROR_BAD_CONFIGURATION;
}
if (r != ERROR_SUCCESS)
{
- msi_free( components );
+ free( components );
*state = INSTALLSTATE_ADVERTISED;
return ERROR_SUCCESS;
}
{
source = TRUE;
}
- msi_free( path );
+ free( path );
}
- msi_free( components );
+ free( components );
if (missing)
*state = INSTALLSTATE_ADVERTISED;
if (product && !(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
if (usersid && !(usersidW = strdupAtoW( usersid )))
{
- msi_free( productW );
+ free( productW );
return ERROR_OUTOFMEMORY;
}
if (feature && !(featureW = strdupAtoW( feature )))
{
- msi_free( productW );
- msi_free( usersidW );
+ free( productW );
+ free( usersidW );
return ERROR_OUTOFMEMORY;
}
r = MsiQueryFeatureStateExW( productW, usersidW, ctx, featureW, state );
- msi_free( productW );
- msi_free( usersidW );
- msi_free( featureW );
+ free( productW );
+ free( usersidW );
+ free( featureW );
return r;
}
rc = MsiQueryFeatureStateW(szwProduct, szwFeature);
end:
- msi_free( szwProduct);
- msi_free( szwFeature);
+ free(szwProduct);
+ free(szwFeature);
return rc;
}
if( lpVersionBuf && pcchVersionBuf && *pcchVersionBuf )
{
- lpwVersionBuff = msi_alloc(*pcchVersionBuf*sizeof(WCHAR));
+ lpwVersionBuff = malloc(*pcchVersionBuf * sizeof(WCHAR));
if( !lpwVersionBuff )
goto end;
}
if( lpLangBuf && pcchLangBuf && *pcchLangBuf )
{
- lpwLangBuff = msi_alloc(*pcchLangBuf*sizeof(WCHAR));
+ lpwLangBuff = malloc(*pcchLangBuf * sizeof(WCHAR));
if( !lpwLangBuff )
goto end;
}
lpLangBuf, *pcchLangBuf + 1, NULL, NULL);
end:
- msi_free(szwFilePath);
- msi_free(lpwVersionBuff);
- msi_free(lpwLangBuff);
+ free(szwFilePath);
+ free(lpwVersionBuff);
+ free(lpwLangBuff);
return ret;
}
if (error == ERROR_RESOURCE_DATA_NOT_FOUND) return ERROR_FILE_INVALID;
return error;
}
- if (!(version = msi_alloc( len ))) return ERROR_OUTOFMEMORY;
+ if (!(version = malloc( len ))) return ERROR_OUTOFMEMORY;
if (!GetFileVersionInfoW( path, 0, len, version ))
{
- msi_free( version );
+ free( version );
return GetLastError();
}
if (!verbuf && !verlen && !langbuf && !langlen)
{
- msi_free( version );
+ free( version );
return ERROR_SUCCESS;
}
if (verlen)
*langlen = 0;
}
}
- msi_free( version );
+ free( version );
return ret;
}
ret = ERROR_SUCCESS;
}
*verlen = len;
- msi_free( version );
+ free( version );
}
return ret;
}
ret = MsiGetFeatureUsageW( prod, feat, pdwUseCount, pwDateUsed );
end:
- msi_free( prod );
- msi_free( feat );
+ free( prod );
+ free( feat );
return ret;
}
ret = MsiUseFeatureExW( prod, feat, dwInstallMode, dwReserved );
end:
- msi_free( prod );
- msi_free( feat );
+ free( prod );
+ free( feat );
return ret;
}
WCHAR *ret;
DWORD len, type;
if (RegQueryValueExW( hkey, name, NULL, &type, NULL, &len ) || type != REG_MULTI_SZ) return NULL;
- if ((ret = msi_alloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
+ if ((ret = malloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
return ret;
}
WCHAR *ret;
DWORD len, type;
if (RegQueryValueExW( hkey, name, NULL, &type, NULL, &len ) || type != REG_SZ) return NULL;
- if ((ret = msi_alloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
+ if ((ret = malloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
return ret;
}
/* FIXME: handle multiple descriptors */
ret = MsiDecomposeDescriptorW( desc, product, feature, comp, &size );
- msi_free( desc );
+ free( desc );
if (ret != ERROR_SUCCESS) return ret;
if (!szProduct) szProduct = product;
if (lstrlenW( components ) < BASE85_SIZE || !decode_base85_guid( components, &guid ))
{
- msi_free( components );
+ free( components );
return ERROR_FILE_NOT_FOUND;
}
- msi_free( components );
+ free( components );
StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
}
dwInstallMode, szwProduct, Unused1,
Unused2, &path, pcchPathBuf);
end:
- msi_free(szwProduct);
- msi_free(szwComponent);
- msi_free(szwQualifier);
+ free(szwProduct);
+ free(szwComponent);
+ free(szwQualifier);
return r;
}
}
done:
- msi_free(user);
- msi_free(org);
- msi_free(serial);
+ free(user);
+ free(org);
+ free(serial);
return state;
}
&org, pcchOrgNameBuf,
&serial, pcchSerialBuf );
- msi_free( prod );
+ free( prod );
return r;
}
r = MsiConfigureFeatureW(prod, feat, eInstallState);
end:
- msi_free(feat);
- msi_free(prod);
+ free(feat);
+ free(prod);
return r;
}
feature[0] = 0;
component[0] = 0;
r = MsiGetShortcutTargetW( target, product, feature, component );
- msi_free( target );
+ free( target );
if (r == ERROR_SUCCESS)
{
WideCharToMultiByte( CP_ACP, 0, product, -1, szProductCode, len, NULL, NULL );
sz = (lstrlenW( L"%s=%s %s=%s" ) + lstrlenW( L"REINSTALLMODE" ) + lstrlenW( reinstallmode )) * sizeof(WCHAR);
sz += (lstrlenW( L"REINSTALL" ) + lstrlenW( szFeature )) * sizeof(WCHAR);
- if (!(cmdline = msi_alloc( sz )))
+ if (!(cmdline = malloc( sz )))
{
msiobj_release( &package->hdr );
return ERROR_OUTOFMEMORY;
r = MSI_InstallPackage( package, sourcepath, cmdline );
msiobj_release( &package->hdr );
- msi_free( cmdline );
+ free( cmdline );
return r;
}
rc = MsiReinstallFeatureW(wszProduct, wszFeature, dwReinstallMode);
- msi_free(wszProduct);
- msi_free(wszFeature);
+ free(wszProduct);
+ free(wszFeature);
return rc;
}
-typedef struct
+struct md5_ctx
{
unsigned int i[2];
unsigned int buf[4];
unsigned char in[64];
unsigned char digest[16];
-} MD5_CTX;
+};
-extern VOID WINAPI MD5Init( MD5_CTX *);
-extern VOID WINAPI MD5Update( MD5_CTX *, const unsigned char *, unsigned int );
-extern VOID WINAPI MD5Final( MD5_CTX *);
+extern void WINAPI MD5Init( struct md5_ctx * );
+extern void WINAPI MD5Update( struct md5_ctx *, const unsigned char *, unsigned int );
+extern void WINAPI MD5Final( struct md5_ctx * );
UINT msi_get_filehash( MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash )
{
{
if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
{
- MD5_CTX ctx;
+ struct md5_ctx ctx;
MD5Init( &ctx );
MD5Update( &ctx, p, length );
return ERROR_OUTOFMEMORY;
r = MsiGetFileHashW( file, dwOptions, pHash );
- msi_free( file );
+ free( file );
return r;
}
if (component && !(componentW = strdupAtoW( component )))
{
- msi_free( productW );
+ free( productW );
return ERROR_OUTOFMEMORY;
}
r = MsiInstallMissingComponentW( productW, componentW, state );
- msi_free( productW );
- msi_free( componentW );
+ free( productW );
+ free( componentW );
return r;
}
if (r != ERROR_SUCCESS)
goto done;
- if (!(bufW = msi_alloc( ++lenW * sizeof(WCHAR) )))
+ if (!(bufW = malloc( ++lenW * sizeof(WCHAR) )))
{
r = ERROR_OUTOFMEMORY;
goto done;
*buflen = len - 1;
done:
- msi_free( productW );
- msi_free( featureW );
- msi_free( componentW );
- msi_free( bufW );
+ free( productW );
+ free( featureW );
+ free( componentW );
+ free( bufW );
return r;
}
return ERROR_OUTOFMEMORY;
r = MsiBeginTransactionW( nameW, attrs, id, event );
- msi_free( nameW );
+ free( nameW );
return r;
}
if (lpvReserved) break;
msi_dialog_unregister_class();
msi_free_handle_table();
- msi_free( gszLogFile );
+ free( gszLogFile );
release_typelib();
break;
}
return TRUE;
}
-typedef struct tagIClassFactoryImpl {
+struct class_factory
+{
IClassFactory IClassFactory_iface;
- HRESULT (*create_object)( IUnknown*, LPVOID* );
-} IClassFactoryImpl;
+ HRESULT (*create_object)( IUnknown *, void ** );
+};
-static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
+static inline struct class_factory *impl_from_IClassFactory(IClassFactory *iface)
{
- return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
+ return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
}
static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid,LPVOID *ppobj)
{
- IClassFactoryImpl *This = impl_from_IClassFactory(iface);
+ struct class_factory *This = impl_from_IClassFactory(iface);
TRACE("%p %s %p\n",This,debugstr_guid(riid),ppobj);
static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface,
LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
- IClassFactoryImpl *This = impl_from_IClassFactory(iface);
+ struct class_factory *This = impl_from_IClassFactory(iface);
IUnknown *unk = NULL;
HRESULT r;
MsiCF_LockServer
};
-static IClassFactoryImpl MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver };
+static struct class_factory MsiServer_CF = { { &MsiCF_Vtbl }, create_msiserver };
/******************************************************************
* DllGetClassObject [MSI.@]
#include "winemsi_s.h"
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
-extern BOOL is_wow64 DECLSPEC_HIDDEN;
+extern BOOL is_wow64;
#define MSI_DATASIZEMASK 0x00ff
#define MSITYPE_VALID 0x0100
float center_y;
UINT WordCount;
- UINT Context;
+ MSIINSTALLCONTEXT Context;
struct list subscriptions;
DWORD attributes;
LPWSTR display_name;
LPWSTR tempdir;
- BOOL installed;
BOOL clr_version[CLR_VERSION_MAX];
} MSIASSEMBLY;
INSTALLSTATE Action;
BOOL ForceLocalState;
BOOL Enabled;
- INT Cost;
+ /* Cost is in 512-byte units, as returned from MsiEnumComponentCosts() et al. */
+ int cost;
INT RefCount;
LPWSTR FullKeypath;
LPWSTR AdvertiseString;
} str;
} awcstring;
-UINT msi_strcpy_to_awstring(const WCHAR *, int, awstring *, DWORD *) DECLSPEC_HIDDEN;
+UINT msi_strcpy_to_awstring(const WCHAR *, int, awstring *, DWORD *);
/* msi server interface */
-extern MSIHANDLE msi_get_remote(MSIHANDLE handle) DECLSPEC_HIDDEN;
-extern LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr) DECLSPEC_HIDDEN;
+extern MSIHANDLE msi_get_remote(MSIHANDLE handle);
+extern LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr);
/* handle functions */
-extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type) DECLSPEC_HIDDEN;
-extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * ) DECLSPEC_HIDDEN;
-extern MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote) DECLSPEC_HIDDEN;
-extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ) DECLSPEC_HIDDEN;
-extern void msiobj_addref(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
-extern int msiobj_release(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
-extern void msiobj_lock(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
-extern void msiobj_unlock(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
-extern void msi_free_handle_table(void) DECLSPEC_HIDDEN;
+extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type);
+extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * );
+extern MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote);
+extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy );
+extern void msiobj_addref(MSIOBJECTHDR *);
+extern int msiobj_release(MSIOBJECTHDR *);
+extern void msiobj_lock(MSIOBJECTHDR *);
+extern void msiobj_unlock(MSIOBJECTHDR *);
+extern void msi_free_handle_table(void);
-extern void free_cached_tables( MSIDATABASE *db ) DECLSPEC_HIDDEN;
-extern UINT MSI_CommitTables( MSIDATABASE *db ) DECLSPEC_HIDDEN;
-extern UINT msi_commit_streams( MSIDATABASE *db ) DECLSPEC_HIDDEN;
+extern void free_cached_tables( MSIDATABASE *db );
+extern UINT MSI_CommitTables( MSIDATABASE *db );
+extern UINT msi_commit_streams( MSIDATABASE *db );
/* string table functions */
-extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persistent ) DECLSPEC_HIDDEN;
-extern UINT msi_string2id( const string_table *st, const WCHAR *data, int len, UINT *id ) DECLSPEC_HIDDEN;
-extern VOID msi_destroy_stringtable( string_table *st ) DECLSPEC_HIDDEN;
-extern const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len ) DECLSPEC_HIDDEN;
-extern HRESULT msi_init_string_table( IStorage *stg ) DECLSPEC_HIDDEN;
-extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) DECLSPEC_HIDDEN;
-extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref ) DECLSPEC_HIDDEN;
-extern UINT msi_get_string_table_codepage( const string_table *st ) DECLSPEC_HIDDEN;
-extern UINT msi_set_string_table_codepage( string_table *st, UINT codepage ) DECLSPEC_HIDDEN;
-extern WCHAR *msi_strdupW( const WCHAR *value, int len ) DECLSPEC_HIDDEN;
-
-extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name ) DECLSPEC_HIDDEN;
-extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table ) DECLSPEC_HIDDEN;
+extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persistent );
+extern UINT msi_string2id( const string_table *st, const WCHAR *data, int len, UINT *id );
+extern VOID msi_destroy_stringtable( string_table *st );
+extern const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len );
+extern HRESULT msi_init_string_table( IStorage *stg );
+extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref );
+extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref );
+extern UINT msi_get_string_table_codepage( const string_table *st );
+extern UINT msi_set_string_table_codepage( string_table *st, UINT codepage );
+extern WCHAR *msi_strdupW( const WCHAR *value, int len );
+
+extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name );
+extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table );
extern UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
- BYTE **pdata, UINT *psz ) DECLSPEC_HIDDEN;
+ BYTE **pdata, UINT *psz );
extern UINT write_stream_data( IStorage *stg, LPCWSTR stname,
- LPCVOID data, UINT sz, BOOL bTable ) DECLSPEC_HIDDEN;
+ LPCVOID data, UINT sz, BOOL bTable );
/* transform functions */
-extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond ) DECLSPEC_HIDDEN;
+extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond );
extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
- LPCWSTR szTransformFile, int iErrorCond ) DECLSPEC_HIDDEN;
-extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) DECLSPEC_HIDDEN;
-extern UINT msi_apply_transforms( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
+ LPCWSTR szTransformFile, int iErrorCond );
+extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
+extern UINT msi_apply_transforms( MSIPACKAGE *package );
/* patch functions */
-extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si ) DECLSPEC_HIDDEN;
-extern UINT msi_apply_patches( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) DECLSPEC_HIDDEN;
-extern void msi_free_patchinfo( MSIPATCHINFO *patch ) DECLSPEC_HIDDEN;
+extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si );
+extern UINT msi_apply_patches( MSIPACKAGE *package );
+extern UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code );
+extern void msi_free_patchinfo( MSIPATCHINFO *patch );
+extern UINT msi_patch_assembly( MSIPACKAGE *, MSIASSEMBLY *, MSIFILEPATCH * );
/* action internals */
-extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
-extern INT ACTION_ShowDialog( MSIPACKAGE*, LPCWSTR) DECLSPEC_HIDDEN;
-extern INT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR) DECLSPEC_HIDDEN;
-extern UINT ACTION_ForceReboot(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable ) DECLSPEC_HIDDEN;
-extern UINT MSI_SetFeatureStates( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case ) DECLSPEC_HIDDEN;
-extern const WCHAR *msi_get_command_line_option( const WCHAR *cmd, const WCHAR *option, UINT *len ) DECLSPEC_HIDDEN;
-extern UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ) DECLSPEC_HIDDEN;
-extern INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp ) DECLSPEC_HIDDEN;
-extern INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature ) DECLSPEC_HIDDEN;
-extern UINT msi_load_all_components( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern UINT msi_load_all_features( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern UINT msi_validate_product_id( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
+extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
+extern INT ACTION_ShowDialog( MSIPACKAGE*, LPCWSTR);
+extern INT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
+extern UINT ACTION_ForceReboot(MSIPACKAGE *package);
+extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable );
+extern UINT MSI_SetFeatureStates( MSIPACKAGE *package );
+extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case );
+extern const WCHAR *msi_get_command_line_option( const WCHAR *cmd, const WCHAR *option, UINT *len );
+extern UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action );
+extern INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp );
+extern INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature );
+extern UINT msi_load_all_components( MSIPACKAGE *package );
+extern UINT msi_load_all_features( MSIPACKAGE *package );
+extern UINT msi_validate_product_id( MSIPACKAGE *package );
/* record internals */
-extern void MSI_CloseRecord( MSIOBJECTHDR * ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **) DECLSPEC_HIDDEN;
-extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
-extern MSIRECORD *MSI_CreateRecord( UINT ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
-extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD) DECLSPEC_HIDDEN;
-extern int MSI_RecordGetInteger( MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
-extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
-extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ) DECLSPEC_HIDDEN;
-extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ) DECLSPEC_HIDDEN;
-extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) DECLSPEC_HIDDEN;
-extern UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int) DECLSPEC_HIDDEN;
-extern const WCHAR *msi_record_get_string(const MSIRECORD *, UINT, int *) DECLSPEC_HIDDEN;
-extern void dump_record(MSIRECORD *) DECLSPEC_HIDDEN;
-extern UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN;
-extern struct wire_record *marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN;
-extern void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN;
-extern UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle) DECLSPEC_HIDDEN;
+extern void MSI_CloseRecord( MSIOBJECTHDR * );
+extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *);
+extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **);
+extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT );
+extern MSIRECORD *MSI_CreateRecord( UINT );
+extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int );
+extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR );
+extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT );
+extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD);
+extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD);
+extern int MSI_RecordGetInteger( MSIRECORD *, UINT );
+extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD);
+extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *);
+extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec );
+extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR );
+extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR );
+extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT );
+extern MSIRECORD *MSI_CloneRecord( MSIRECORD * );
+extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * );
+extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field);
+extern UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int);
+extern const WCHAR *msi_record_get_string(const MSIRECORD *, UINT, int *);
+extern void dump_record(MSIRECORD *);
+extern UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out);
+extern struct wire_record *marshal_record(MSIHANDLE handle);
+extern void free_remote_record(struct wire_record *rec);
+extern UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle);
/* stream internals */
-extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN;
-extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN;
-extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
+extern void enum_stream_names( IStorage *stg );
+extern WCHAR *encode_streamname(BOOL is_table, const WCHAR *in);
+extern BOOL decode_streamname(LPCWSTR in, LPWSTR out);
/* database internals */
-extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN;
-extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN;
-extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN;
-extern UINT WINAPIV MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN;
+extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** );
+extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** );
+extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
+extern UINT WINAPIV MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
typedef UINT (*record_func)( MSIRECORD *, LPVOID );
-extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID ) DECLSPEC_HIDDEN;
-extern MSIRECORD * WINAPIV MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... ) DECLSPEC_HIDDEN;
-extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** ) DECLSPEC_HIDDEN;
+extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID );
+extern MSIRECORD * WINAPIV MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
+extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** );
/* view internals */
-extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * ) DECLSPEC_HIDDEN;
-extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ) DECLSPEC_HIDDEN;
-extern UINT MSI_ViewClose( MSIQUERY* ) DECLSPEC_HIDDEN;
-extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **) DECLSPEC_HIDDEN;
-extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ) DECLSPEC_HIDDEN;
-extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, LPCWSTR, UINT * ) DECLSPEC_HIDDEN;
-extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **) DECLSPEC_HIDDEN;
+extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * );
+extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** );
+extern UINT MSI_ViewClose( MSIQUERY* );
+extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **);
+extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * );
+extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, LPCWSTR, UINT * );
+extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **);
/* install internals */
-extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) DECLSPEC_HIDDEN;
+extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel );
/* package internals */
#define WINE_OPENPACKAGEFLAGS_RECACHE 0x80000000
-extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE * ) DECLSPEC_HIDDEN;
-extern UINT MSI_OpenPackageW( LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage ) DECLSPEC_HIDDEN;
-extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
-extern INT MSI_ProcessMessageVerbatim( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * ) DECLSPEC_HIDDEN;
-extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * ) DECLSPEC_HIDDEN;
-extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR ) DECLSPEC_HIDDEN;
-extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN;
-extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN;
-extern UINT MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ) DECLSPEC_HIDDEN;
-extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) DECLSPEC_HIDDEN;
-extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN;
-extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN;
-extern UINT msi_clone_properties(MSIDATABASE *) DECLSPEC_HIDDEN;
-extern UINT msi_set_context(MSIPACKAGE *) DECLSPEC_HIDDEN;
-extern void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN;
-extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT) DECLSPEC_HIDDEN;
+extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE * );
+extern UINT MSI_OpenPackageW( LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage );
+extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
+extern INT MSI_ProcessMessageVerbatim( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * );
+extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * );
+extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR );
+extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
+extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
+extern UINT MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE );
+extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename );
+extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR);
+extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR);
+extern UINT msi_clone_properties(MSIDATABASE *);
+extern UINT msi_set_context(MSIPACKAGE *);
+extern void msi_adjust_privilege_properties(MSIPACKAGE *);
+extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT);
/* for deformating */
-extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN;
+extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD );
/* registry data encoding/decoding functions */
-extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
-extern BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
-extern BOOL encode_base85_guid(GUID *,LPWSTR) DECLSPEC_HIDDEN;
-extern BOOL decode_base85_guid(LPCWSTR,GUID*) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform) DECLSPEC_HIDDEN;
+extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out);
+extern BOOL squash_guid(LPCWSTR in, LPWSTR out);
+extern BOOL encode_base85_guid(GUID *,LPWSTR);
+extern BOOL decode_base85_guid(LPCWSTR,GUID*);
+extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL);
+extern UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform);
extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
- MSIINSTALLCONTEXT context, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
+ MSIINSTALLCONTEXT context, HKEY* key, BOOL create);
extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context,
- HKEY *key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
+ HKEY *key, BOOL create);
+extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context,
- HKEY *key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
+ HKEY *key, BOOL create);
+extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid,
- HKEY *key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
+ HKEY *key, BOOL create);
+extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
- LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN;
+ LPCWSTR szUserSid, HKEY *key, BOOL create);
extern UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext,
- HKEY *key, BOOL create) DECLSPEC_HIDDEN;
+ HKEY *key, BOOL create);
extern UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT context,
- HKEY *key, BOOL create) DECLSPEC_HIDDEN;
+ HKEY *key, BOOL create);
extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
- LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteUpgradeCodesKey(const WCHAR *) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN;
-extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
-extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
-extern UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context) DECLSPEC_HIDDEN;
-extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ) DECLSPEC_HIDDEN;
-extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN;
-
-extern DWORD msi_version_str_to_dword(LPCWSTR p) DECLSPEC_HIDDEN;
-extern void msi_parse_version_string(LPCWSTR, PDWORD, PDWORD) DECLSPEC_HIDDEN;
-extern int msi_compare_file_versions(VS_FIXEDFILEINFO *, const WCHAR *) DECLSPEC_HIDDEN;
-extern int msi_compare_font_versions(const WCHAR *, const WCHAR *) DECLSPEC_HIDDEN;
-
-extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN;
-extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN;
-extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val ) DECLSPEC_HIDDEN;
-extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val ) DECLSPEC_HIDDEN;
+ LPCWSTR szUserSid, HKEY *key, BOOL create);
+extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
+extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
+extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct);
+extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct);
+extern UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context);
+extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT);
+extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct);
+extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid);
+extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode);
+extern UINT MSIREG_DeleteUpgradeCodesKey(const WCHAR *);
+extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode);
+extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create);
+extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode);
+extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode);
+extern UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context);
+extern WCHAR *msi_reg_get_val_str( HKEY hkey, const WCHAR *name );
+extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val);
+
+extern DWORD msi_version_str_to_dword(LPCWSTR p);
+extern void msi_parse_version_string(LPCWSTR, PDWORD, PDWORD);
+extern int msi_compare_file_versions(VS_FIXEDFILEINFO *, const WCHAR *);
+extern int msi_compare_font_versions(const WCHAR *, const WCHAR *);
+
+extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
+extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
+extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val );
+extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val );
/* msi dialog interface */
-extern void msi_dialog_check_messages( HANDLE ) DECLSPEC_HIDDEN;
-extern void msi_dialog_destroy( msi_dialog* ) DECLSPEC_HIDDEN;
-extern void msi_dialog_unregister_class( void ) DECLSPEC_HIDDEN;
+extern void msi_dialog_check_messages( HANDLE );
+extern void msi_dialog_destroy( msi_dialog* );
+extern void msi_dialog_unregister_class( void );
/* summary information */
-extern UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si ) DECLSPEC_HIDDEN;
-extern UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si ) DECLSPEC_HIDDEN;
-extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN;
-extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN;
-extern LPWSTR msi_get_suminfo_product( IStorage *stg ) DECLSPEC_HIDDEN;
-extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns ) DECLSPEC_HIDDEN;
-extern UINT msi_export_suminfo( MSIDATABASE *db, HANDLE handle ) DECLSPEC_HIDDEN;
-extern UINT msi_load_suminfo_properties( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
+extern UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si );
+extern UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si );
+extern WCHAR *msi_suminfo_dup_string( MSISUMMARYINFO *si,
+ UINT property );
+extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty );
+extern WCHAR *msi_get_suminfo_product( IStorage *stg );
+extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns );
+extern UINT msi_export_suminfo( MSIDATABASE *db, HANDLE handle );
+extern UINT msi_load_suminfo_properties( MSIPACKAGE *package );
/* undocumented functions */
UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD );
LANGID WINAPI MsiLoadStringA( MSIHANDLE, UINT, LPSTR, int, LANGID );
/* UI globals */
-extern INSTALLUILEVEL gUILevel DECLSPEC_HIDDEN;
-extern HWND gUIhwnd DECLSPEC_HIDDEN;
-extern INSTALLUI_HANDLERA gUIHandlerA DECLSPEC_HIDDEN;
-extern INSTALLUI_HANDLERW gUIHandlerW DECLSPEC_HIDDEN;
-extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord DECLSPEC_HIDDEN;
-extern DWORD gUIFilter DECLSPEC_HIDDEN;
-extern DWORD gUIFilterRecord DECLSPEC_HIDDEN;
-extern LPVOID gUIContext DECLSPEC_HIDDEN;
-extern LPVOID gUIContextRecord DECLSPEC_HIDDEN;
-extern WCHAR *gszLogFile DECLSPEC_HIDDEN;
-extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN;
+extern INSTALLUILEVEL gUILevel;
+extern HWND gUIhwnd;
+extern INSTALLUI_HANDLERA gUIHandlerA;
+extern INSTALLUI_HANDLERW gUIHandlerW;
+extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord;
+extern DWORD gUIFilter;
+extern DWORD gUIFilterRecord;
+extern LPVOID gUIContext;
+extern LPVOID gUIContextRecord;
+extern WCHAR *gszLogFile;
+extern HINSTANCE msi_hInstance;
/* action related functions */
-extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
-extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN;
-extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
-extern void custom_stop_server(HANDLE process, HANDLE pipe) DECLSPEC_HIDDEN;
+extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action);
+extern void ACTION_FinishCustomActions( const MSIPACKAGE* package);
+extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action);
+extern void custom_stop_server(HANDLE process, HANDLE pipe);
/* actions in other modules */
-extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_CCPSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_InstallFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_PatchFiles( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern UINT ACTION_RemoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_MoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_RegisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN;
-extern UINT ACTION_MsiUnpublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN;
+extern UINT ACTION_AppSearch(MSIPACKAGE *package);
+extern UINT ACTION_CCPSearch(MSIPACKAGE *package);
+extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
+extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
+extern UINT ACTION_PatchFiles( MSIPACKAGE *package );
+extern UINT ACTION_RemoveFiles(MSIPACKAGE *package);
+extern UINT ACTION_MoveFiles(MSIPACKAGE *package);
+extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
+extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package);
+extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
+extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
+extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
+extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
+extern UINT ACTION_RegisterFonts(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package);
+extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package);
+extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package);
+extern UINT ACTION_MsiUnpublishAssemblies(MSIPACKAGE *package);
/* Helpers */
-extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ) DECLSPEC_HIDDEN;
-extern WCHAR *msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN;
-extern LPWSTR msi_dup_property( MSIDATABASE *db, LPCWSTR prop ) DECLSPEC_HIDDEN;
-extern UINT msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *, int ) DECLSPEC_HIDDEN;
-extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN;
-extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def ) DECLSPEC_HIDDEN;
-extern WCHAR *msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder) DECLSPEC_HIDDEN;
-extern void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop) DECLSPEC_HIDDEN;
-extern WCHAR *msi_normalize_path(const WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR *msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file) DECLSPEC_HIDDEN;
-extern const WCHAR *msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name) DECLSPEC_HIDDEN;
-extern void msi_reset_source_folders( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
-extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component) DECLSPEC_HIDDEN;
-extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature) DECLSPEC_HIDDEN;
-extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file) DECLSPEC_HIDDEN;
-extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir) DECLSPEC_HIDDEN;
-extern WCHAR *msi_create_temp_file(MSIDATABASE *db) DECLSPEC_HIDDEN;
-extern void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN;
-extern WCHAR *msi_build_icon_path(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR * WINAPIV msi_build_directory_name(DWORD , ...) DECLSPEC_HIDDEN;
-extern void msi_reduce_to_long_filename(WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR *msi_create_component_advertise_string(MSIPACKAGE *, MSICOMPONENT *, const WCHAR *) DECLSPEC_HIDDEN;
-extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature) DECLSPEC_HIDDEN;
-extern UINT msi_register_unique_action(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
-extern BOOL msi_action_is_unique(const MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
+extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
+extern WCHAR *msi_dup_record_field( MSIRECORD *row, INT index );
+extern WCHAR *msi_dup_property( MSIDATABASE *db, const WCHAR *prop );
+extern UINT msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *, int );
+extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD );
+extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def );
+extern WCHAR *msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name,
+ MSIFOLDER **folder);
+extern void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop);
+extern WCHAR *msi_normalize_path(const WCHAR *);
+extern WCHAR *msi_resolve_file_source(MSIPACKAGE *package,
+ MSIFILE *file);
+extern const WCHAR *msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name);
+extern void msi_reset_source_folders( MSIPACKAGE *package );
+extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component);
+extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature);
+extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file);
+extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir);
+extern WCHAR *msi_create_temp_file(MSIDATABASE *db);
+extern void msi_free_action_script(MSIPACKAGE *package, UINT script);
+extern WCHAR *msi_build_icon_path(MSIPACKAGE *, const WCHAR *);
+extern WCHAR * WINAPIV msi_build_directory_name(DWORD , ...);
+extern void msi_reduce_to_long_filename(WCHAR *);
+extern WCHAR *msi_create_component_advertise_string(MSIPACKAGE *, MSICOMPONENT *,
+ const WCHAR *);
+extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature);
+extern UINT msi_register_unique_action(MSIPACKAGE *, const WCHAR *);
+extern BOOL msi_action_is_unique(const MSIPACKAGE *, const WCHAR *);
extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
- MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value) DECLSPEC_HIDDEN;
-extern UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN;
-extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) DECLSPEC_HIDDEN;
-extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
-extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
-extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
-extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
-extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
-extern BOOL msi_is_global_assembly(MSICOMPONENT *) DECLSPEC_HIDDEN;
-extern IAssemblyEnum *msi_create_assembly_enum(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR *msi_get_assembly_path(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN;
-extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN;
-extern WCHAR *msi_get_error_message(MSIDATABASE *, int) DECLSPEC_HIDDEN;
-extern UINT msi_strncpyWtoA(const WCHAR *str, int len, char *buf, DWORD *sz, BOOL remote) DECLSPEC_HIDDEN;
-extern UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz) DECLSPEC_HIDDEN;
-extern WCHAR *msi_get_package_code(MSIDATABASE *db) DECLSPEC_HIDDEN;
+ MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value);
+extern UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix);
+extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace);
+extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *);
+extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *);
+extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *);
+extern void msi_destroy_assembly_caches(MSIPACKAGE *);
+extern BOOL msi_is_global_assembly(MSICOMPONENT *);
+extern IAssemblyEnum *msi_create_assembly_enum(MSIPACKAGE *, const WCHAR *);
+extern WCHAR *msi_get_assembly_path(MSIPACKAGE *, const WCHAR *);
+extern WCHAR **msi_split_string(const WCHAR *, WCHAR);
+extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *);
+extern WCHAR *msi_get_error_message(MSIDATABASE *, int);
+extern UINT msi_strncpyWtoA(const WCHAR *str, int len, char *buf, DWORD *sz, BOOL remote);
+extern UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz);
+extern WCHAR *msi_get_package_code(MSIDATABASE *db);
/* wrappers for filesystem functions */
static inline void msi_disable_fs_redirection( MSIPACKAGE *package )
{
if (is_wow64 && package->platform == PLATFORM_X64) Wow64RevertWow64FsRedirection( package->cookie );
}
-extern HANDLE msi_create_file( MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD ) DECLSPEC_HIDDEN;
-extern BOOL msi_delete_file( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern BOOL msi_remove_directory( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern DWORD msi_get_file_attributes( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern BOOL msi_set_file_attributes( MSIPACKAGE *, const WCHAR *, DWORD ) DECLSPEC_HIDDEN;
-extern HANDLE msi_find_first_file( MSIPACKAGE *, const WCHAR *, WIN32_FIND_DATAW * ) DECLSPEC_HIDDEN;
-extern BOOL msi_find_next_file( MSIPACKAGE *, HANDLE, WIN32_FIND_DATAW * ) DECLSPEC_HIDDEN;
-extern BOOL msi_move_file( MSIPACKAGE *, const WCHAR *, const WCHAR *, DWORD ) DECLSPEC_HIDDEN;
-extern DWORD msi_get_file_version_info( MSIPACKAGE *, const WCHAR *, DWORD, BYTE * ) DECLSPEC_HIDDEN;
-extern BOOL msi_create_full_path( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern DWORD msi_get_disk_file_size( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
-extern UINT msi_get_filehash( MSIPACKAGE *, const WCHAR *, MSIFILEHASHINFO * ) DECLSPEC_HIDDEN;
-extern WCHAR *msi_get_font_file_version( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
+extern BOOL msi_get_temp_file_name( MSIPACKAGE *, const WCHAR *, const WCHAR *, WCHAR * );
+extern HANDLE msi_create_file( MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD );
+extern BOOL msi_delete_file( MSIPACKAGE *, const WCHAR * );
+extern BOOL msi_remove_directory( MSIPACKAGE *, const WCHAR * );
+extern DWORD msi_get_file_attributes( MSIPACKAGE *, const WCHAR * );
+extern BOOL msi_set_file_attributes( MSIPACKAGE *, const WCHAR *, DWORD );
+extern HANDLE msi_find_first_file( MSIPACKAGE *, const WCHAR *, WIN32_FIND_DATAW * );
+extern BOOL msi_find_next_file( MSIPACKAGE *, HANDLE, WIN32_FIND_DATAW * );
+extern BOOL msi_move_file( MSIPACKAGE *, const WCHAR *, const WCHAR *, DWORD );
+extern DWORD msi_get_file_version_info( MSIPACKAGE *, const WCHAR *, DWORD, BYTE * );
+extern BOOL msi_create_full_path( MSIPACKAGE *, const WCHAR * );
+extern DWORD msi_get_disk_file_size( MSIPACKAGE *, const WCHAR * );
+extern VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *, const WCHAR * );
+extern UINT msi_get_filehash( MSIPACKAGE *, const WCHAR *, MSIFILEHASHINFO * );
+extern WCHAR *msi_get_font_file_version( MSIPACKAGE *,
+ const WCHAR * );
/* media */
PVOID user;
} MSICABDATA;
-extern UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
-extern UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
-extern void msi_free_media_info(MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
-extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data) DECLSPEC_HIDDEN;
-extern UINT msi_add_cabinet_stream(MSIPACKAGE *, UINT, IStorage *, const WCHAR *) DECLSPEC_HIDDEN;
+extern UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi);
+extern UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi);
+extern void msi_free_media_info(MSIMEDIAINFO *mi);
+extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data);
+extern UINT msi_add_cabinet_stream(MSIPACKAGE *, UINT, IStorage *, const WCHAR *);
/* control event stuff */
-extern void msi_event_fire(MSIPACKAGE *, const WCHAR *, MSIRECORD *) DECLSPEC_HIDDEN;
-extern void msi_event_cleanup_all_subscriptions( MSIPACKAGE * ) DECLSPEC_HIDDEN;
+extern void msi_event_fire(MSIPACKAGE *, const WCHAR *, MSIRECORD *);
+extern void msi_event_cleanup_all_subscriptions( MSIPACKAGE * );
/* OLE automation */
typedef enum tid_t {
LAST_tid
} tid_t;
-extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj) DECLSPEC_HIDDEN;
-extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch) DECLSPEC_HIDDEN;
-extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **ti) DECLSPEC_HIDDEN;
-extern void release_typelib(void) DECLSPEC_HIDDEN;
+extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj);
+extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch);
+extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **ti);
+extern void release_typelib(void);
/* Scripting */
-extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action) DECLSPEC_HIDDEN;
+extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action);
/* User interface messages from the actions */
-extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
+extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int);
-/* memory allocation macro functions */
-static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
-static inline void *msi_alloc( size_t len )
+static inline char *strdupWtoA( LPCWSTR str )
{
- return malloc( len );
-}
+ LPSTR ret = NULL;
+ DWORD len;
-static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
-static inline void *msi_alloc_zero( size_t len )
-{
- return calloc( 1, len );
+ if (!str) return ret;
+ len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
+ ret = malloc( len );
+ if (ret)
+ WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
+ return ret;
}
-static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
-static inline void *msi_realloc( void *mem, size_t len )
+static inline LPWSTR strdupAtoW( LPCSTR str )
{
- return realloc( mem, len );
-}
+ LPWSTR ret = NULL;
+ DWORD len;
-static inline void msi_free( void *mem )
-{
- free( mem );
+ if (!str) return ret;
+ len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
+ ret = malloc( len * sizeof(WCHAR) );
+ if (ret)
+ MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
+ return ret;
}
-static inline char *strdupWtoA( LPCWSTR str )
+static inline char *strdupWtoU( LPCWSTR str )
{
LPSTR ret = NULL;
DWORD len;
if (!str) return ret;
- len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
- ret = msi_alloc( len );
+ len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
+ ret = malloc( len );
if (ret)
- WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
+ WideCharToMultiByte( CP_UTF8, 0, str, -1, ret, len, NULL, NULL );
return ret;
}
-static inline LPWSTR strdupAtoW( LPCSTR str )
+static inline LPWSTR strdupUtoW( LPCSTR str )
{
LPWSTR ret = NULL;
DWORD len;
if (!str) return ret;
- len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
- ret = msi_alloc( len * sizeof(WCHAR) );
+ len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
+ ret = malloc( len * sizeof(WCHAR) );
if (ret)
- MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
+ MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
return ret;
}
-static inline LPWSTR strdupW( LPCWSTR src )
+static inline int cost_from_size( int size )
{
- LPWSTR dest;
- if (!src) return NULL;
- dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
- if (dest)
- lstrcpyW(dest, src);
- return dest;
+ /* Cost is size rounded up to the nearest 4096 bytes,
+ * expressed in units of 512 bytes. */
+ return ((size + 4095) & ~4095) / 512;
}
#endif /* __WINE_MSI_PRIVATE__ */
LIST_FOR_EACH_SAFE( ptr, t, &query->mem )
{
- msi_free( ptr );
+ free( ptr );
}
}
r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
- msi_free( szwQuery );
+ free( szwQuery );
return r;
}
for (;;)
{
va_list va;
- query = msi_alloc( size*sizeof(WCHAR) );
+ query = malloc(size * sizeof(WCHAR));
va_start(va, fmt);
res = vswprintf(query, size, fmt, va);
va_end(va);
if (res == -1) size *= 2;
else if (res >= size) size = res + 1;
else break;
- msi_free( query );
+ free(query);
}
/* perform the query */
r = MSI_DatabaseOpenViewW(db, query, view);
- msi_free(query);
+ free(query);
return r;
}
for (;;)
{
va_list va;
- query = msi_alloc( size*sizeof(WCHAR) );
+ query = malloc(size * sizeof(WCHAR));
va_start(va, fmt);
res = vswprintf(query, size, fmt, va);
va_end(va);
if (res == -1) size *= 2;
else if (res >= size) size = res + 1;
else break;
- msi_free( query );
+ free(query);
}
/* perform the query */
r = MSI_DatabaseOpenViewW(db, query, &view);
- msi_free(query);
+ free(query);
if( r == ERROR_SUCCESS )
{
return ret;
}
-static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
- UINT type, BOOL temporary )
+static UINT set_record_type_string( MSIRECORD *rec, UINT field, UINT type, BOOL temporary )
{
WCHAR szType[0x10];
if (info == MSICOLINFO_NAMES)
MSI_RecordSetStringW( rec, i+1, name );
else
- msi_set_record_type_string( rec, i+1, type, temporary );
+ set_record_type_string( rec, i+1, type, temporary );
}
*prec = rec;
return ERROR_SUCCESS;
return ERROR_NOT_ENOUGH_MEMORY;
ret = MsiDatabaseApplyTransformW( hdb, wstr, error_cond );
- msi_free( wstr );
+ free( wstr );
return ret;
}
if (r == ERROR_SUCCESS)
{
- msi_free( db->deletefile );
+ free( db->deletefile );
db->deletefile = NULL;
}
return r;
}
-struct msi_primary_key_record_info
+struct primary_key_record_info
{
DWORD n;
MSIRECORD *rec;
};
-static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param )
+static UINT primary_key_iterator( MSIRECORD *rec, void *param )
{
- struct msi_primary_key_record_info *info = param;
+ struct primary_key_record_info *info = param;
LPCWSTR name, table;
DWORD type;
return ERROR_SUCCESS;
}
-UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
- LPCWSTR table, MSIRECORD **prec )
+UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db, const WCHAR *table, MSIRECORD **prec )
{
- struct msi_primary_key_record_info info;
+ struct primary_key_record_info info;
MSIQUERY *query = NULL;
UINT r;
/* count the number of primary key records */
info.n = 0;
info.rec = 0;
- r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info );
+ r = MSI_IterateRecords( query, 0, primary_key_iterator, &info );
if( r == ERROR_SUCCESS )
{
TRACE( "found %lu primary keys\n", info.n );
/* allocate a record and fill in the names of the tables */
info.rec = MSI_CreateRecord( info.n );
info.n = 0;
- r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info );
+ r = MSI_IterateRecords( query, 0, primary_key_iterator, &info );
if( r == ERROR_SUCCESS )
*prec = info.rec;
else
return ERROR_OUTOFMEMORY;
}
r = MsiDatabaseGetPrimaryKeysW( hdb, szwTable, phRec );
- msi_free( szwTable );
+ free( szwTable );
return r;
}
return MSICONDITION_ERROR;
}
r = MsiDatabaseIsTablePersistentW( hDatabase, szwTableName );
- msi_free( szwTableName );
+ free( szwTableName );
return r;
}
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
#define COBJMACROS
+
#ifdef __REACTOS__
#define WIN32_NO_STATUS
#endif
{
FeatureList *fl = LIST_ENTRY( item, FeatureList, entry );
list_remove( &fl->entry );
- msi_free( fl );
+ free( fl );
}
LIST_FOR_EACH_SAFE( item, cursor, &feature->Components )
{
ComponentList *cl = LIST_ENTRY( item, ComponentList, entry );
list_remove( &cl->entry );
- msi_free( cl );
+ free( cl );
}
- msi_free( feature->Feature );
- msi_free( feature->Feature_Parent );
- msi_free( feature->Directory );
- msi_free( feature->Description );
- msi_free( feature->Title );
- msi_free( feature );
+ free( feature->Feature );
+ free( feature->Feature_Parent );
+ free( feature->Directory );
+ free( feature->Description );
+ free( feature->Title );
+ free( feature );
}
static void free_folder( MSIFOLDER *folder )
{
FolderList *fl = LIST_ENTRY( item, FolderList, entry );
list_remove( &fl->entry );
- msi_free( fl );
+ free( fl );
}
- msi_free( folder->Parent );
- msi_free( folder->Directory );
- msi_free( folder->TargetDefault );
- msi_free( folder->SourceLongPath );
- msi_free( folder->SourceShortPath );
- msi_free( folder->ResolvedTarget );
- msi_free( folder->ResolvedSource );
- msi_free( folder );
+ free( folder->Parent );
+ free( folder->Directory );
+ free( folder->TargetDefault );
+ free( folder->SourceLongPath );
+ free( folder->SourceShortPath );
+ free( folder->ResolvedTarget );
+ free( folder->ResolvedSource );
+ free( folder );
}
static void free_extension( MSIEXTENSION *ext )
MSIVERB *verb = LIST_ENTRY( item, MSIVERB, entry );
list_remove( &verb->entry );
- msi_free( verb->Verb );
- msi_free( verb->Command );
- msi_free( verb->Argument );
- msi_free( verb );
+ free( verb->Verb );
+ free( verb->Command );
+ free( verb->Argument );
+ free( verb );
}
- msi_free( ext->Extension );
- msi_free( ext->ProgIDText );
- msi_free( ext );
+ free( ext->Extension );
+ free( ext->ProgIDText );
+ free( ext );
}
static void free_assembly( MSIASSEMBLY *assembly )
{
- msi_free( assembly->feature );
- msi_free( assembly->manifest );
- msi_free( assembly->application );
- msi_free( assembly->display_name );
+ free( assembly->feature );
+ free( assembly->manifest );
+ free( assembly->application );
+ free( assembly->display_name );
if (assembly->tempdir) RemoveDirectoryW( assembly->tempdir );
- msi_free( assembly->tempdir );
- msi_free( assembly );
+ free( assembly->tempdir );
+ free( assembly );
}
void msi_free_action_script( MSIPACKAGE *package, UINT script )
{
UINT i;
for (i = 0; i < package->script_actions_count[script]; i++)
- msi_free( package->script_actions[script][i] );
+ free( package->script_actions[script][i] );
- msi_free( package->script_actions[script] );
+ free( package->script_actions[script] );
package->script_actions[script] = NULL;
package->script_actions_count[script] = 0;
}
MSIFILE *file = LIST_ENTRY( item, MSIFILE, entry );
list_remove( &file->entry );
- msi_free( file->File );
- msi_free( file->FileName );
- msi_free( file->ShortName );
- msi_free( file->LongName );
- msi_free( file->Version );
- msi_free( file->Language );
+ free( file->File );
+ free( file->FileName );
+ free( file->ShortName );
+ free( file->LongName );
+ free( file->Version );
+ free( file->Language );
if (msi_is_global_assembly( file->Component )) DeleteFileW( file->TargetPath );
- msi_free( file->TargetPath );
- msi_free( file );
+ free( file->TargetPath );
+ free( file );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->components )
MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry );
list_remove( &comp->entry );
- msi_free( comp->Component );
- msi_free( comp->ComponentId );
- msi_free( comp->Directory );
- msi_free( comp->Condition );
- msi_free( comp->KeyPath );
- msi_free( comp->FullKeypath );
+ free( comp->Component );
+ free( comp->ComponentId );
+ free( comp->Directory );
+ free( comp->Condition );
+ free( comp->KeyPath );
+ free( comp->FullKeypath );
if (comp->assembly) free_assembly( comp->assembly );
- msi_free( comp );
+ free( comp );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->filepatches )
MSIFILEPATCH *patch = LIST_ENTRY( item, MSIFILEPATCH, entry );
list_remove( &patch->entry );
- msi_free( patch->path );
- msi_free( patch );
+ free( patch->path );
+ free( patch );
}
/* clean up extension, progid, class and verb structures */
MSICLASS *cls = LIST_ENTRY( item, MSICLASS, entry );
list_remove( &cls->entry );
- msi_free( cls->clsid );
- msi_free( cls->Context );
- msi_free( cls->Description );
- msi_free( cls->FileTypeMask );
- msi_free( cls->IconPath );
- msi_free( cls->DefInprocHandler );
- msi_free( cls->DefInprocHandler32 );
- msi_free( cls->Argument );
- msi_free( cls->ProgIDText );
- msi_free( cls );
+ free( cls->clsid );
+ free( cls->Context );
+ free( cls->Description );
+ free( cls->FileTypeMask );
+ free( cls->IconPath );
+ free( cls->DefInprocHandler );
+ free( cls->DefInprocHandler32 );
+ free( cls->Argument );
+ free( cls->ProgIDText );
+ free( cls );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->extensions )
MSIPROGID *progid = LIST_ENTRY( item, MSIPROGID, entry );
list_remove( &progid->entry );
- msi_free( progid->ProgID );
- msi_free( progid->Description );
- msi_free( progid->IconPath );
- msi_free( progid );
+ free( progid->ProgID );
+ free( progid->Description );
+ free( progid->IconPath );
+ free( progid );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->mimes )
MSIMIME *mt = LIST_ENTRY( item, MSIMIME, entry );
list_remove( &mt->entry );
- msi_free( mt->suffix );
- msi_free( mt->clsid );
- msi_free( mt->ContentType );
- msi_free( mt );
+ free( mt->suffix );
+ free( mt->clsid );
+ free( mt->ContentType );
+ free( mt );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->appids )
MSIAPPID *appid = LIST_ENTRY( item, MSIAPPID, entry );
list_remove( &appid->entry );
- msi_free( appid->AppID );
- msi_free( appid->RemoteServerName );
- msi_free( appid->LocalServer );
- msi_free( appid->ServiceParameters );
- msi_free( appid->DllSurrogate );
- msi_free( appid );
+ free( appid->AppID );
+ free( appid->RemoteServerName );
+ free( appid->LocalServer );
+ free( appid->ServiceParameters );
+ free( appid->DllSurrogate );
+ free( appid );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->sourcelist_info )
MSISOURCELISTINFO *info = LIST_ENTRY( item, MSISOURCELISTINFO, entry );
list_remove( &info->entry );
- msi_free( info->value );
- msi_free( info );
+ free( info->value );
+ free( info );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->sourcelist_media )
MSIMEDIADISK *info = LIST_ENTRY( item, MSIMEDIADISK, entry );
list_remove( &info->entry );
- msi_free( info->volume_label );
- msi_free( info->disk_prompt );
- msi_free( info );
+ free( info->volume_label );
+ free( info->disk_prompt );
+ free( info );
}
for (i = 0; i < SCRIPT_MAX; i++)
msi_free_action_script( package, i );
for (i = 0; i < package->unique_actions_count; i++)
- msi_free( package->unique_actions[i] );
- msi_free( package->unique_actions);
+ free( package->unique_actions[i] );
+ free( package->unique_actions );
LIST_FOR_EACH_SAFE( item, cursor, &package->binaries )
{
list_remove( &binary->entry );
if (!DeleteFileW( binary->tmpfile ))
ERR( "failed to delete %s (%lu)\n", debugstr_w(binary->tmpfile), GetLastError() );
- msi_free( binary->source );
- msi_free( binary->tmpfile );
- msi_free( binary );
+ free( binary->source );
+ free( binary->tmpfile );
+ free( binary );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->cabinet_streams )
list_remove( &cab->entry );
IStorage_Release( cab->storage );
- msi_free( cab->stream );
- msi_free( cab );
+ free( cab->stream );
+ free( cab );
}
LIST_FOR_EACH_SAFE( item, cursor, &package->patches )
msi_free_patchinfo( patch );
}
- msi_free( package->PackagePath );
- msi_free( package->ProductCode );
- msi_free( package->ActionFormat );
- msi_free( package->LastAction );
- msi_free( package->LastActionTemplate );
- msi_free( package->langids );
+ free( package->PackagePath );
+ free( package->ProductCode );
+ free( package->ActionFormat );
+ free( package->LastAction );
+ free( package->LastActionTemplate );
+ free( package->langids );
/* cleanup control event subscriptions */
msi_event_cleanup_all_subscriptions( package );
custom_stop_server(package->custom_server_64_process, package->custom_server_64_pipe);
if (package->delete_on_close) DeleteFileW( package->localfile );
- msi_free( package->localfile );
+ free( package->localfile );
MSI_ProcessMessage(NULL, INSTALLMESSAGE_TERMINATE, 0);
}
size = 0;
GetUserNameW( NULL, &size );
- user_name = msi_alloc( (size + 1) * sizeof(WCHAR) );
+ user_name = malloc( (size + 1) * sizeof(WCHAR) );
if (!user_name)
return ERROR_OUTOFMEMORY;
dom_size = 0;
LookupAccountNameW( NULL, user_name, NULL, &size, NULL, &dom_size, &use );
- psid = msi_alloc( size );
- dom = msi_alloc( dom_size*sizeof (WCHAR) );
+ psid = malloc( size );
+ dom = malloc( dom_size * sizeof (WCHAR) );
if (!psid || !dom)
{
r = ERROR_OUTOFMEMORY;
done:
LocalFree( sid_str );
- msi_free( dom );
- msi_free( psid );
- msi_free( user_name );
+ free( dom );
+ free( psid );
+ free( user_name );
return r;
}
if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
{
len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
- if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
+ if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
lstrcpyW(filename, path);
lstrcatW(filename, L"\\");
GetWindowsDirectoryW(windir, MAX_PATH);
len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
lstrlenW(L"fusion.dll") + 3;
- msi_free(filename);
- if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
+ free(filename);
+ if (!(filename = malloc(len * sizeof(WCHAR)))) return NULL;
lstrcpyW(filename, windir);
lstrcatW(filename, L"\\");
return filename;
}
-typedef struct tagLANGANDCODEPAGE
+struct lang_codepage
{
WORD wLanguage;
WORD wCodePage;
-} LANGANDCODEPAGE;
+};
static void set_msi_assembly_prop(MSIPACKAGE *package)
{
LPVOID version = NULL;
WCHAR buf[MAX_PATH];
LPWSTR fusion, verstr;
- LANGANDCODEPAGE *translate;
+ struct lang_codepage *translate;
fusion = get_fusion_filename(package);
if (!fusion)
if (!size)
goto done;
- version = msi_alloc(size);
+ version = malloc(size);
if (!version)
goto done;
msi_set_property( package->db, L"MsiNetAssemblySupport", verstr, -1 );
done:
- msi_free(fusion);
- msi_free(version);
+ free(fusion);
+ free(version);
}
static VOID set_installer_properties(MSIPACKAGE *package)
GetNativeSystemInfo( &sys_info );
len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", sys_info.wProcessorLevel );
msi_set_property( package->db, L"Intel", bufstr, len );
- if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{
GetSystemDirectoryW( pth, MAX_PATH );
PathAddBackslashW( pth );
PathAddBackslashW( pth );
msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
}
- else if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ else if (sys_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
{
msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
msi_set_property( package->db, L"Msix64", bufstr, -1 );
msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
CloseHandle( hkey );
}
- msi_free( username );
- msi_free( companyname );
+ free( username );
+ free( companyname );
if ( set_user_sid_prop( package ) != ERROR_SUCCESS)
ERR("Failed to set the UserSID property\n");
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
WCHAR *username;
- if ((username = msi_alloc( len * sizeof(WCHAR) )))
+ if ((username = malloc( len * sizeof(WCHAR) )))
{
if (GetUserNameW( username, &len ))
msi_set_property( package->db, L"LogonUser", username, len - 1 );
- msi_free( username );
+ free( username );
}
}
len = 0;
if (!GetComputerNameW( NULL, &len ) && GetLastError() == ERROR_BUFFER_OVERFLOW)
{
WCHAR *computername;
- if ((computername = msi_alloc( len * sizeof(WCHAR) )))
+ if ((computername = malloc( len * sizeof(WCHAR) )))
{
if (GetComputerNameW( computername, &len ))
msi_set_property( package->db, L"ComputerName", computername, len );
- msi_free( computername );
+ free( computername );
}
}
}
-static MSIPACKAGE *msi_alloc_package( void )
+static MSIPACKAGE *alloc_package( void )
{
MSIPACKAGE *package;
return package;
}
-static UINT msi_load_admin_properties(MSIPACKAGE *package)
+static UINT load_admin_properties(MSIPACKAGE *package)
{
BYTE *data;
UINT r, sz;
r = msi_parse_command_line(package, (WCHAR *)data, TRUE);
- msi_free(data);
+ free(data);
return r;
}
TRACE("%p\n", db);
- package = msi_alloc_package();
+ package = alloc_package();
if (package)
{
msiobj_addref( &db->hdr );
package->LastActionTemplate = NULL;
package->LastActionResult = MSI_NULL_INTEGER;
package->WordCount = 0;
- package->PackagePath = strdupW( db->path );
+ package->PackagePath = wcsdup( db->path );
create_temp_property_table( package );
msi_clone_properties( package->db );
}
if (package->WordCount & msidbSumInfoSourceTypeAdminImage)
- msi_load_admin_properties( package );
+ load_admin_properties( package );
package->log_file = INVALID_HANDLE_VALUE;
package->script = SCRIPT_NONE;
GetUrlCacheEntryInfoW( szUrl, NULL, &size );
if ( GetLastError() != ERROR_FILE_NOT_FOUND )
{
- cache_entry = msi_alloc( size );
+ cache_entry = malloc( size );
if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
{
UINT error = GetLastError();
- msi_free( cache_entry );
+ free( cache_entry );
return error;
}
lstrcpyW( filename, cache_entry->lpszLocalFileName );
- msi_free( cache_entry );
+ free( cache_entry );
return ERROR_SUCCESS;
}
if (!p)
{
WARN("invalid template string %s\n", debugstr_w(template));
- msi_free( template );
+ free( template );
return ERROR_PATCH_PACKAGE_INVALID;
}
*p = 0;
if (package->platform == PLATFORM_UNRECOGNIZED)
{
WARN("unknown platform %s\n", debugstr_w(template));
- msi_free( template );
+ free( template );
return ERROR_INSTALL_PLATFORM_UNSUPPORTED;
}
p++;
if (!*p)
{
- msi_free( template );
+ free( template );
return ERROR_SUCCESS;
}
count = 1;
for (q = p; (q = wcschr( q, ',' )); q++) count++;
- package->langids = msi_alloc( count * sizeof(LANGID) );
+ package->langids = malloc( count * sizeof(LANGID) );
if (!package->langids)
{
- msi_free( template );
+ free( template );
return ERROR_OUTOFMEMORY;
}
}
package->num_langids = i + 1;
- msi_free( template );
+ free( template );
return ERROR_SUCCESS;
}
}
if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
{
- ret = strdupW( MSI_RecordGetString( rec, 1 ) );
+ ret = wcsdup( MSI_RecordGetString( rec, 1 ) );
msiobj_release( &rec->hdr );
}
MSI_ViewClose( view );
return ERROR_FUNCTION_FAILED;
lstrcpyW( localfile, filename );
- msi_free( filename );
+ free( filename );
return ERROR_SUCCESS;
}
if (!(product_code = get_product_code( db )))
return ERROR_INSTALL_PACKAGE_INVALID;
r = get_registered_local_package( product_code, localfile );
- msi_free( product_code );
+ free( product_code );
return r;
}
WCHAR *path;
if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
- if (!(path = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
len = GetFullPathNameW( package, len, path, NULL );
r = msi_set_property( db, L"OriginalDatabase", path, len );
- msi_free( path );
+ free( path );
}
return r;
}
TRACE("opening package %s\n", debugstr_w( localfile ));
r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
if (r != ERROR_SUCCESS)
+ {
+ free( product_version );
return r;
+ }
if (product_version)
{
(product_version && wcscmp(product_version, cache_version)))
{
msiobj_release( &db->hdr );
- msi_free(product_version);
- msi_free(cache_version);
+ free( product_version );
+ free( cache_version );
return ERROR_PRODUCT_VERSION;
}
- msi_free(product_version);
- msi_free(cache_version);
+ free( product_version );
+ free( cache_version );
}
}
package = MSI_CreatePackage( db );
msiobj_release( &db->hdr );
if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
- package->localfile = strdupW( localfile );
+ package->localfile = wcsdup( localfile );
package->delete_on_close = delete_on_close;
r = msi_get_suminfo( db->storage, 0, &si );
TRACE("product already registered\n");
msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
}
- msi_free(product_code);
+ free( product_code );
while (1)
{
package->log_file = CreateFileW( gszLogFile, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
- if (!msi_init_assembly_caches( package ))
- {
- ERR("can't initialize assembly caches\n");
- msiobj_release( &package->hdr );
- return ERROR_FUNCTION_FAILED;
- }
-
/* FIXME: when should these messages be sent? */
data_row = MSI_CreateRecord(3);
if (!data_row)
}
info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
MSI_RecordSetStringW(info_row, 0, info_template);
- msi_free(info_template);
+ free(info_template);
MSI_ProcessMessage(package, INSTALLMESSAGE_INFO|MB_ICONHAND, info_row);
MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
MSI_RecordSetStringW(data_row, 3, NULL);
MSI_ProcessMessage(package, INSTALLMESSAGE_COMMONDATA, data_row);
- msi_free(productname);
+ free(productname);
msiobj_release(&info_row->hdr);
msiobj_release(&data_row->hdr);
ret = MsiOpenPackageExW( szwPack, dwOptions, phPackage );
- msi_free( szwPack );
+ free( szwPack );
return ret;
}
{
LPWSTR dialog = msi_dup_record_field(record, 0);
INT rc = ACTION_DialogBox(package, dialog);
- msi_free(dialog);
+ free(dialog);
return rc;
}
case INSTALLMESSAGE_ACTIONSTART:
MSI_RecordSetStringW(uirow, 1, deformatted);
msi_event_fire(package, L"ActionText", uirow);
- msi_free(deformatted);
+ free(deformatted);
msiobj_release(&uirow->hdr);
return 1;
}
int len = LoadStringW(msi_hInstance, IDS_ERROR_BASE + error, (LPWSTR) &ret, 0);
if (len)
{
- ret = msi_alloc((len + 1) * sizeof(WCHAR));
+ ret = malloc((len + 1) * sizeof(WCHAR));
LoadStringW(msi_hInstance, IDS_ERROR_BASE + error, ret, len + 1);
}
else
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
return res;
len++;
- message = msi_alloc(len * sizeof(WCHAR));
+ message = malloc(len * sizeof(WCHAR));
if (!message) return ERROR_OUTOFMEMORY;
MSI_FormatRecordW(package, record, message, &len);
}
/* convert it to ANSI */
len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
- msg = msi_alloc( len );
+ msg = malloc( len );
WideCharToMultiByte( CP_ACP, 0, message, -1, msg, len, NULL, NULL );
if (gUIHandlerRecord && (gUIFilterRecord & log_type))
WriteFile( package->log_file, msg, len - 1, &written, NULL );
WriteFile( package->log_file, "\n", 1, &written, NULL );
}
- msi_free( msg );
- msi_free( message );
+ free( msg );
+ free( message );
return rc;
}
template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
MSI_RecordSetStringW(record, 0, template_rec);
MSI_ProcessMessageVerbatim(package, eMessageType, record);
- msi_free(template_rec);
+ free(template_rec);
return 0;
}
}
template_rec = msi_dup_record_field(record, 0);
template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
- if (!template_prefix) template_prefix = strdupW(L"");
+ if (!template_prefix) template_prefix = wcsdup(L"");
if (!template_rec)
{
/* always returns 0 */
MSI_RecordSetStringW(record, 0, template_prefix);
MSI_ProcessMessageVerbatim(package, eMessageType, record);
- msi_free(template_prefix);
+ free(template_prefix);
return 0;
}
- template = msi_alloc((lstrlenW(template_rec) + lstrlenW(template_prefix) + 1) * sizeof(WCHAR));
- if (!template) return ERROR_OUTOFMEMORY;
+ template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
+ if (!template)
+ {
+ free(template_prefix);
+ free(template_rec);
+ return ERROR_OUTOFMEMORY;
+ }
lstrcpyW(template, template_prefix);
lstrcatW(template, template_rec);
MSI_RecordSetStringW(record, 0, template);
- msi_free(template_prefix);
- msi_free(template_rec);
- msi_free(template);
+ free(template_prefix);
+ free(template_rec);
+ free(template);
}
break;
case INSTALLMESSAGE_ACTIONSTART:
{
WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
MSI_RecordSetStringW(record, 0, template);
- msi_free(template);
+ free(template);
- msi_free(package->LastAction);
- msi_free(package->LastActionTemplate);
+ free(package->LastAction);
+ free(package->LastActionTemplate);
package->LastAction = msi_dup_record_field(record, 1);
- if (!package->LastAction) package->LastAction = strdupW(L"");
+ if (!package->LastAction) package->LastAction = wcsdup(L"");
package->LastActionTemplate = msi_dup_record_field(record, 3);
break;
}
if (package->LastAction && package->LastActionTemplate)
{
size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
- WCHAR *template = msi_alloc(len * sizeof(WCHAR));
+ WCHAR *template = malloc(len * sizeof(WCHAR));
if (!template) return ERROR_OUTOFMEMORY;
swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
MSI_RecordSetStringW(record, 0, template);
- msi_free(template);
+ free(template);
}
break;
case INSTALLMESSAGE_COMMONDATA:
{
WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
MSI_RecordSetStringW(record, 0, template);
- msi_free(template);
+ free(template);
}
break;
}
r = MsiSetPropertyW( hInstall, szwName, szwValue);
end:
- msi_free( szwName );
- msi_free( szwValue );
+ free( szwName );
+ free( szwValue );
return r;
}
LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry )
{
- msi_free( folder->ResolvedSource );
+ free( folder->ResolvedSource );
folder->ResolvedSource = NULL;
}
}
return ret;
}
-static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name )
+static MSIRECORD *get_property_row( MSIDATABASE *db, const WCHAR *name )
{
MSIRECORD *rec, *row = NULL;
MSIQUERY *view;
length = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, NULL, 0);
if (!length)
return NULL;
- buffer = msi_alloc(length * sizeof(WCHAR));
+ buffer = malloc(length * sizeof(WCHAR));
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, buffer, length);
row = MSI_CreateRecord(1);
if (!row)
{
- msi_free(buffer);
+ free(buffer);
return NULL;
}
MSI_RecordSetStringW(row, 1, buffer);
- msi_free(buffer);
+ free(buffer);
return row;
}
else if (!wcscmp(name, L"Time"))
length = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER, NULL, NULL, NULL, 0);
if (!length)
return NULL;
- buffer = msi_alloc(length * sizeof(WCHAR));
+ buffer = malloc(length * sizeof(WCHAR));
GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER, NULL, NULL, buffer, length);
row = MSI_CreateRecord(1);
if (!row)
{
- msi_free(buffer);
+ free(buffer);
return NULL;
}
MSI_RecordSetStringW(row, 1, buffer);
- msi_free(buffer);
+ free(buffer);
return row;
}
TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
- row = msi_get_property_row( db, szName );
+ row = get_property_row( db, szName );
if (*pchValueBuf > 0)
szValueBuf[0] = 0;
return NULL;
sz++;
- str = msi_alloc(sz * sizeof(WCHAR));
+ str = malloc(sz * sizeof(WCHAR));
r = msi_get_property(db, prop, str, &sz);
if (r != ERROR_SUCCESS)
{
- msi_free(str);
+ free(str);
str = NULL;
}
{
LPWSTR str = msi_dup_property( db, prop );
int val = str ? wcstol(str, NULL, 10) : def;
- msi_free(str);
+ free(str);
return val;
}
return r;
}
- row = msi_get_property_row(package->db, nameW);
+ row = get_property_row(package->db, nameW);
if (row)
value = msi_record_get_string(row, 1, &len);
return r;
}
- row = msi_get_property_row(package->db, name);
+ row = get_property_row(package->db, name);
if (row)
value = msi_record_get_string(row, 1, &len);
if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
}
- info = msi_alloc(sizeof(MSISOURCELISTINFO));
+ info = malloc(sizeof(MSISOURCELISTINFO));
if (!info)
return ERROR_OUTOFMEMORY;
info->context = context;
info->options = options;
info->property = property;
- info->value = strdupW(value);
+ info->value = wcsdup(value);
list_add_head(&package->sourcelist_info, &info->entry);
return ERROR_SUCCESS;
if (disk->disk_id == disk_id) return ERROR_SUCCESS;
}
- disk = msi_alloc(sizeof(MSIMEDIADISK));
+ disk = malloc(sizeof(MSIMEDIADISK));
if (!disk)
return ERROR_OUTOFMEMORY;
disk->context = context;
disk->options = options;
disk->disk_id = disk_id;
- disk->volume_label = strdupW(volume_label);
- disk->disk_prompt = strdupW(disk_prompt);
+ disk->volume_label = wcsdup(volume_label);
+ disk->disk_prompt = wcsdup(disk_prompt);
list_add_head(&package->sourcelist_media, &disk->entry);
return ERROR_SUCCESS;
static void free_transform_desc( struct transform_desc *desc )
{
- msi_free( desc->product_code_from );
- msi_free( desc->product_code_to );
- msi_free( desc->version_from );
- msi_free( desc->version_to );
- msi_free( desc->upgrade_code );
- msi_free( desc );
+ free( desc->product_code_from );
+ free( desc->product_code_to );
+ free( desc->version_from );
+ free( desc->version_to );
+ free( desc->upgrade_code );
+ free( desc );
}
static struct transform_desc *parse_transform_desc( const WCHAR *str )
const WCHAR *p = str, *q;
UINT len;
- if (!(ret = msi_alloc_zero( sizeof(*ret) ))) return NULL;
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
q = wcschr( p, '}' );
if (*p != '{' || !q) goto error;
len = q - p + 1;
- if (!(ret->product_code_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
+ if (!(ret->product_code_from = malloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->product_code_from, p, len * sizeof(WCHAR) );
ret->product_code_from[len] = 0;
p = q + 1;
if (!(q = wcschr( p, ';' ))) goto error;
len = q - p;
- if (!(ret->version_from = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
+ if (!(ret->version_from = malloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->version_from, p, len * sizeof(WCHAR) );
ret->version_from[len] = 0;
if (*p != '{' || !q) goto error;
len = q - p + 1;
- if (!(ret->product_code_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
+ if (!(ret->product_code_to = malloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->product_code_to, p, len * sizeof(WCHAR) );
ret->product_code_to[len] = 0;
p = q + 1;
if (!(q = wcschr( p, ';' ))) goto error;
len = q - p;
- if (!(ret->version_to = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
+ if (!(ret->version_to = malloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->version_to, p, len * sizeof(WCHAR) );
ret->version_to[len] = 0;
if (*p != '{' || !q) goto error;
len = q - p + 1;
- if (!(ret->upgrade_code = msi_alloc( (len + 1) * sizeof(WCHAR) ))) goto error;
+ if (!(ret->upgrade_code = malloc( (len + 1) * sizeof(WCHAR) ))) goto error;
memcpy( ret->upgrade_code, p, len * sizeof(WCHAR) );
ret->upgrade_code[len] = 0;
if (!(product = msi_get_suminfo_product( transform )))
{
WARN("no product property!\n");
- msi_free( template );
+ free( template );
msiobj_release( &si->hdr );
return ERROR_FUNCTION_FAILED;
}
TRACE("product property: %s\n", debugstr_w(product));
if (!(desc = parse_transform_desc( product )))
{
- msi_free( template );
+ free( template );
msiobj_release( &si->hdr );
return ERROR_FUNCTION_FAILED;
}
- msi_free( product );
+ free( product );
if (wanted_flags & MSITRANSFORM_VALIDATE_LANGUAGE)
{
if (!product_code_installed)
{
- msi_free( template );
+ free( template );
free_transform_desc( desc );
msiobj_release( &si->hdr );
return ERROR_INSTALL_PACKAGE_INVALID;
{
valid_flags |= MSITRANSFORM_VALIDATE_PRODUCT;
}
- msi_free( product_code_installed );
+ free( product_code_installed );
}
- msi_free( template );
+ free( template );
if (wanted_flags & MSITRANSFORM_VALIDATE_MAJORVERSION)
{
WCHAR *product_version_installed = msi_dup_property( package->db, L"ProductVersion" );
valid_flags |= MSITRANSFORM_VALIDATE_MAJORVERSION;
wanted_flags &= ~MSITRANSFORM_VALIDATE_MINORVERSION;
}
- msi_free( product_version_installed );
+ free( product_version_installed );
}
else if (wanted_flags & MSITRANSFORM_VALIDATE_MINORVERSION)
{
if (major_installed == major && minor_installed == minor)
valid_flags |= MSITRANSFORM_VALIDATE_MINORVERSION;
- msi_free( product_version_installed );
+ free( product_version_installed );
}
if (wanted_flags & MSITRANSFORM_VALIDATE_UPGRADECODE)
{
}
if (!wcscmp( desc->upgrade_code, upgrade_code_installed ))
valid_flags |= MSITRANSFORM_VALIDATE_UPGRADECODE;
- msi_free( upgrade_code_installed );
+ free( upgrade_code_installed );
}
free_transform_desc( desc );
{
if (!wcscmp( guids[i], product_code )) ret = ERROR_SUCCESS;
}
- msi_free( guids );
- msi_free( guid_list );
- msi_free( product_code );
+ free( guids );
+ free( guid_list );
+ free( product_code );
return ret;
}
-static UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
+static UINT parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
{
MSIPATCHINFO *pi;
UINT r = ERROR_SUCCESS;
WCHAR *p;
- if (!(pi = msi_alloc_zero( sizeof(MSIPATCHINFO) )))
+ if (!(pi = calloc( 1, sizeof(MSIPATCHINFO) )))
{
return ERROR_OUTOFMEMORY;
}
if (!(pi->patchcode = msi_suminfo_dup_string( si, PID_REVNUMBER )))
{
- msi_free( pi );
+ free( pi );
return ERROR_OUTOFMEMORY;
}
p = pi->patchcode;
if (*p != '{')
{
- msi_free( pi->patchcode );
- msi_free( pi );
+ free( pi->patchcode );
+ free( pi );
return ERROR_PATCH_PACKAGE_INVALID;
}
if (!(p = wcschr( p + 1, '}' )))
{
- msi_free( pi->patchcode );
- msi_free( pi );
+ free( pi->patchcode );
+ free( pi );
return ERROR_PATCH_PACKAGE_INVALID;
}
if (p[1])
TRACE("patch code %s\n", debugstr_w(pi->patchcode));
if (!(pi->products = msi_suminfo_dup_string( si, PID_TEMPLATE )))
{
- msi_free( pi->patchcode );
- msi_free( pi );
+ free( pi->patchcode );
+ free( pi );
return ERROR_OUTOFMEMORY;
}
if (!(pi->transforms = msi_suminfo_dup_string( si, PID_LASTAUTHOR )))
{
- msi_free( pi->patchcode );
- msi_free( pi->products );
- msi_free( pi );
+ free( pi->patchcode );
+ free( pi->products );
+ free( pi );
return ERROR_OUTOFMEMORY;
}
*patch = pi;
property = MSI_RecordGetString( rec, 1 );
patch = msi_dup_property( package->db, L"PATCH" );
msi_set_property( package->db, property, patch, -1 );
- msi_free( patch );
+ free( patch );
msiobj_release( &rec->hdr );
}
static struct patch_offset_list *patch_offset_list_create( void )
{
- struct patch_offset_list *pos = msi_alloc( sizeof(struct patch_offset_list) );
+ struct patch_offset_list *pos = malloc( sizeof(struct patch_offset_list) );
list_init( &pos->files );
list_init( &pos->patches );
pos->count = pos->max = 0;
LIST_FOR_EACH_ENTRY_SAFE( po, po2, &pos->files, struct patch_offset, entry )
{
- msi_free( po->name );
- msi_free( po );
+ free( po->name );
+ free( po );
}
LIST_FOR_EACH_ENTRY_SAFE( po, po2, &pos->patches, struct patch_offset, entry )
{
- msi_free( po->name );
- msi_free( po );
+ free( po->name );
+ free( po );
}
- msi_free( pos );
+ free( pos );
}
static void patch_offset_get_filepatches( MSIDATABASE *db, UINT last_sequence, struct patch_offset_list *pos )
while (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
{
- struct patch_offset *po = msi_alloc( sizeof(struct patch_offset) );
+ struct patch_offset *po = malloc( sizeof(struct patch_offset) );
po->name = msi_dup_record_field( rec, 1 );
po->sequence = MSI_RecordGetInteger( rec, 2 );
UINT attributes = MSI_RecordGetInteger( rec, 7 );
if (attributes & msidbFileAttributesPatchAdded)
{
- struct patch_offset *po = msi_alloc( sizeof(struct patch_offset) );
+ struct patch_offset *po = malloc( sizeof(struct patch_offset) );
po->name = msi_dup_record_field( rec, 1 );
po->sequence = MSI_RecordGetInteger( rec, 8 );
msiobj_release( &rec->hdr );
continue;
}
- if (!(media = msi_alloc( sizeof( *media ))))
+ if (!(media = malloc( sizeof( *media ))))
{
msiobj_release( &rec->hdr );
goto done;
LIST_FOR_EACH_ENTRY_SAFE( media, next, &media_list, struct patch_media, entry )
{
list_remove( &media->entry );
- msi_free( media->prompt );
- msi_free( media->cabinet );
- msi_free( media->volume );
- msi_free( media->source );
- msi_free( media );
+ free( media->prompt );
+ free( media->cabinet );
+ free( media->volume );
+ free( media->source );
+ free( media );
}
return r;
}
return ret;
}
-static UINT msi_apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch )
+static UINT apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch )
{
UINT i, r = ERROR_SUCCESS;
WCHAR **substorage;
r = patch_add_media( package, patch_db->storage, patch );
}
}
- msi_free( substorage );
+ free( substorage );
if (r != ERROR_SUCCESS)
return r;
void msi_free_patchinfo( MSIPATCHINFO *patch )
{
- msi_free( patch->patchcode );
- msi_free( patch->products );
- msi_free( patch->transforms );
- msi_free( patch->filename );
- msi_free( patch->localfile );
- msi_free( patch );
+ free( patch->patchcode );
+ free( patch->products );
+ free( patch->transforms );
+ free( patch->filename );
+ free( patch->localfile );
+ free( patch );
}
-static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
+static UINT apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
{
MSIDATABASE *patch_db = NULL;
WCHAR localfile[MAX_PATH];
r = ERROR_SUCCESS;
goto done;
}
- r = msi_parse_patch_summary( si, &patch );
+ r = parse_patch_summary( si, &patch );
if ( r != ERROR_SUCCESS )
goto done;
r = ERROR_OUTOFMEMORY;
patch->registered = FALSE;
- if (!(patch->filename = strdupW( file ))) goto done;
- if (!(patch->localfile = strdupW( localfile ))) goto done;
+ if (!(patch->filename = wcsdup( file ))) goto done;
+ if (!(patch->localfile = wcsdup( localfile ))) goto done;
- r = msi_apply_patch_db( package, patch_db, patch );
+ r = apply_patch_db( package, patch_db, patch );
if (r != ERROR_SUCCESS) WARN("patch failed to apply %u\n", r);
done:
patches = msi_split_string( patch_list, ';' );
for (i = 0; patches && patches[i] && r == ERROR_SUCCESS; i++)
- r = msi_apply_patch_package( package, patches[i] );
+ r = apply_patch_package( package, patches[i] );
- msi_free( patches );
- msi_free( patch_list );
+ free( patches );
+ free( patch_list );
return r;
}
WCHAR *p = wcsrchr( package->PackagePath, '\\' );
DWORD len = p - package->PackagePath + 1;
- if (!(transform = msi_alloc( (len + lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR)) ))
+ if (!(transform = malloc( (len + wcslen( xforms[i] ) + 1) * sizeof(WCHAR)) ))
{
- msi_free( xforms );
- msi_free( xform_list );
+ free( xforms );
+ free( xform_list );
return ERROR_OUTOFMEMORY;
}
memcpy( transform, package->PackagePath, len * sizeof(WCHAR) );
memcpy( transform + len, xforms[i], (lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR) );
}
r = MSI_DatabaseApplyTransformW( package->db, transform, 0 );
- if (transform != xforms[i]) msi_free( transform );
+ if (transform != xforms[i]) free( transform );
}
}
- msi_free( xforms );
- msi_free( xform_list );
+ free( xforms );
+ free( xform_list );
return r;
}
msiobj_release( &patch_db->hdr );
return r;
}
- r = msi_parse_patch_summary( si, &patch_info );
+ r = parse_patch_summary( si, &patch_info );
msiobj_release( &si->hdr );
if (r != ERROR_SUCCESS)
{
return r;
}
patch_info->registered = TRUE;
- patch_info->localfile = strdupW( patch_file );
+ patch_info->localfile = wcsdup( patch_file );
if (!patch_info->localfile)
{
msiobj_release( &patch_db->hdr );
msi_free_patchinfo( patch_info );
return ERROR_OUTOFMEMORY;
}
- r = msi_apply_patch_db( package, patch_db, patch_info );
+ r = apply_patch_db( package, patch_db, patch_info );
msiobj_release( &patch_db->hdr );
if (r != ERROR_SUCCESS)
{
#endif
#define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
#include "msipriv.h"
#include "query.h"
struct expr *right;
};
-struct tagJOINTABLE;
union ext_column
{
struct
struct
{
UINT column;
- struct tagJOINTABLE *table;
+ struct join_table *table;
} parsed;
};
struct list *mem;
} SQL_input;
-UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview,
- struct list *mem ) DECLSPEC_HIDDEN;
+UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, struct list *mem );
-UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) DECLSPEC_HIDDEN;
+UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view );
-UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
- const column_info *columns ) DECLSPEC_HIDDEN;
+UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, const column_info *columns );
-UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) DECLSPEC_HIDDEN;
+UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
-UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
- column_info *columns ) DECLSPEC_HIDDEN;
+UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, column_info *columns );
-UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
- struct expr *cond ) DECLSPEC_HIDDEN;
+UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables, struct expr *cond );
UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
- column_info *col_info, BOOL hold ) DECLSPEC_HIDDEN;
+ column_info *col_info, BOOL hold );
UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
- column_info *columns, column_info *values, BOOL temp ) DECLSPEC_HIDDEN;
+ column_info *columns, column_info *values, BOOL temp );
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
- column_info *list, struct expr *expr ) DECLSPEC_HIDDEN;
+ column_info *list, struct expr *expr );
-UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) DECLSPEC_HIDDEN;
+UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
-UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold ) DECLSPEC_HIDDEN;
+UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_info *colinfo, int hold );
-UINT STREAMS_CreateView( MSIDATABASE *db, MSIVIEW **view ) DECLSPEC_HIDDEN;
+UINT STREAMS_CreateView( MSIDATABASE *db, MSIVIEW **view );
-UINT STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view ) DECLSPEC_HIDDEN;
+UINT STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view );
-UINT DROP_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name ) DECLSPEC_HIDDEN;
+UINT DROP_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name );
-int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN;
+int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip);
-MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) DECLSPEC_HIDDEN;
+MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec );
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
- MSICONDITION persistent, BOOL hold ) DECLSPEC_HIDDEN;
+ MSICONDITION persistent, BOOL hold );
-UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN;
+UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row );
-UINT msi_view_refresh_row( MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec ) DECLSPEC_HIDDEN;
+UINT msi_view_refresh_row( MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec );
#endif /* __WINE_MSI_QUERY_H */
case MSIFIELD_INT:
break;
case MSIFIELD_WSTR:
- msi_free( field->u.szwVal);
+ free( field->u.szwVal);
break;
case MSIFIELD_STREAM:
IStream_Release( field->u.stream );
WCHAR *ret;
if (!value) return NULL;
- if (!(ret = msi_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
+ if (!(ret = malloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
memcpy( ret, value, len * sizeof(WCHAR) );
ret[len] = 0;
return ret;
return ret;
}
-static UINT msi_get_stream_size( IStream *stm )
+static UINT get_stream_size( IStream *stm )
{
STATSTG stat;
HRESULT r;
case MSIFIELD_NULL:
break;
case MSIFIELD_STREAM:
- return msi_get_stream_size( rec->fields[iField].u.stream );
+ return get_stream_size( rec->fields[iField].u.stream );
}
return 0;
}
rec = msihandle2msiinfo( handle, MSIHANDLETYPE_RECORD );
if( !rec )
{
- msi_free( valueW );
+ free( valueW );
return ERROR_INVALID_HANDLE;
}
msiobj_lock( &rec->hdr );
ret = MSI_RecordSetStringW( rec, iField, valueW );
msiobj_unlock( &rec->hdr );
msiobj_release( &rec->hdr );
- msi_free( valueW );
+ free( valueW );
return ret;
}
return ERROR_OUTOFMEMORY;
}
ret = MsiRecordSetStreamW(hRecord, iField, wstr);
- msi_free(wstr);
+ free(wstr);
return ret;
}
return ERROR_SUCCESS;
}
-static UINT msi_dump_stream_to_file( IStream *stm, LPCWSTR name )
+static UINT dump_stream_to_file( IStream *stm, const WCHAR *name )
{
ULARGE_INTEGER size;
LARGE_INTEGER pos;
r = MSI_RecordGetIStream( rec, iField, &stm );
if( r == ERROR_SUCCESS )
{
- r = msi_dump_stream_to_file( stm, name );
+ r = dump_stream_to_file( stm, name );
IStream_Release( stm );
}
return NULL;
sz++;
- str = msi_alloc( sz * sizeof(WCHAR) );
+ str = malloc( sz * sizeof(WCHAR) );
if (!str) return NULL;
str[0] = 0;
r = MSI_RecordGetStringW( rec, field, str, &sz );
if (r != ERROR_SUCCESS)
{
ERR("failed to get string!\n");
- msi_free( str );
+ free( str );
return NULL;
}
return str;
ret->fields[i].u.iVal = rec->fields[i].u.iVal;
break;
case MSIFIELD_WSTR:
- ret->fields[i].u.szwVal = strdupW(rec->fields[i].u.szwVal);
+ ret->fields[i].u.szwVal = wcsdup(rec->fields[i].u.szwVal);
break;
case MSIFIELD_STREAM:
IStream_AddRef(rec->fields[i].u.stream);
return NULL;
len += sizeof (WCHAR);
- val = msi_alloc( len );
+ val = malloc( len );
if (!val)
return NULL;
val[0] = 0;
WCHAR *ret;
if (!OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &token )) return NULL;
- if (!(user = msi_alloc( size )))
+ if (!(user = malloc( size )))
{
CloseHandle( token );
return NULL;
}
if (!GetTokenInformation( token, TokenUser, user, size, &size ))
{
- msi_free( user );
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER || !(user = msi_alloc( size )))
+ free( user );
+ if (GetLastError() != ERROR_INSUFFICIENT_BUFFER || !(user = malloc( size )))
{
CloseHandle( token );
return NULL;
CloseHandle( token );
if (!ConvertSidToStringSidW( user->User.Sid, &ret ))
{
- msi_free( user );
+ free( user );
return NULL;
}
- msi_free( user );
+ free( user );
return ret;
}
szComponent, MAX_FEATURE_CHARS+1, NULL, NULL );
}
- msi_free( str );
+ free( str );
return r;
}
WideCharToMultiByte(CP_ACP, 0, szwParent, -1, szParent, GUID_SIZE, NULL, NULL);
}
- msi_free( szwProduct);
+ free(szwProduct);
return r;
}
if (sid && !sid_len) return ERROR_INVALID_PARAMETER;
if (user_sid && !(user_sidW = strdupAtoW( user_sid ))) return ERROR_OUTOFMEMORY;
- if (sid && !(sidW = msi_alloc( *sid_len * sizeof(WCHAR) )))
+ if (sid && !(sidW = malloc( *sid_len * sizeof(WCHAR) )))
{
- msi_free( user_sidW );
+ free( user_sidW );
return ERROR_OUTOFMEMORY;
}
r = MsiEnumComponentsExW( user_sidW, ctx, index, guidW, installed_ctx, sidW, sid_len );
if (guid) WideCharToMultiByte( CP_ACP, 0, guidW, GUID_SIZE, guid, GUID_SIZE, NULL, NULL );
if (sid) WideCharToMultiByte( CP_ACP, 0, sidW, *sid_len + 1, sid, *sid_len + 1, NULL, NULL );
}
- msi_free( user_sidW );
- msi_free( sidW );
+ free( user_sidW );
+ free( sidW );
return r;
}
if( r == ERROR_SUCCESS )
WideCharToMultiByte(CP_ACP, 0, szwProduct, -1, szProduct, GUID_SIZE, NULL, NULL);
- msi_free( szwComponent);
+ free(szwComponent);
return r;
}
/* figure out how big the name is we want to return */
name_max = 0x10;
r = ERROR_OUTOFMEMORY;
- name = msi_alloc( name_max * sizeof(WCHAR) );
+ name = malloc( name_max * sizeof(WCHAR) );
if (!name)
goto end;
val_max = 0x10;
r = ERROR_OUTOFMEMORY;
- val = msi_alloc( val_max );
+ val = malloc( val_max );
if (!val)
goto end;
if (name_sz + 1 >= name_max)
{
name_max *= 2;
- msi_free( name );
- name = msi_alloc( name_max * sizeof (WCHAR) );
+ free( name );
+ name = malloc( name_max * sizeof (WCHAR) );
if (!name)
goto end;
continue;
if (val_sz > val_max)
{
val_max = val_sz + sizeof (WCHAR);
- msi_free( val );
- val = msi_alloc( val_max * sizeof (WCHAR) );
+ free( val );
+ val = malloc( val_max * sizeof (WCHAR) );
if (!val)
goto end;
continue;
r = r2;
end:
- msi_free(val);
- msi_free(name);
+ free(val);
+ free(name);
RegCloseKey(key);
return r;
}
r = MSI_EnumComponentQualifiers( comp, iIndex,
&qual, pcchQualifierBuf, &appdata, pcchApplicationDataBuf );
- msi_free( comp );
+ free( comp );
return r;
}
WideCharToMultiByte( CP_ACP, 0, productW, GUID_SIZE,
lpProductBuf, GUID_SIZE, NULL, NULL );
}
- msi_free( szwUpgradeCode);
+ free( szwUpgradeCode );
return r;
}
goto done;
}
- targsid = msi_alloc(++len * sizeof(WCHAR));
+ targsid = malloc(++len * sizeof(WCHAR));
if (!targsid)
{
r = ERROR_OUTOFMEMORY;
*pcchTargetUserSid = len;
done:
- msi_free(prodcode);
- msi_free(usersid);
- msi_free(targsid);
+ free(prodcode);
+ free(usersid);
+ free(targsid);
return r;
}
-static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid,
- MSIINSTALLCONTEXT context,
- LPWSTR patch, MSIPATCHSTATE *state)
+static UINT get_patch_state(const WCHAR *prodcode, const WCHAR *usersid, MSIINSTALLCONTEXT context,
+ WCHAR *patch, MSIPATCHSTATE *state)
{
DWORD type, val, size;
HKEY prod, hkey = 0;
return r;
}
-static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
- MSIINSTALLCONTEXT context, DWORD filter, DWORD index, DWORD *idx,
- LPWSTR patch, LPWSTR targetprod, MSIINSTALLCONTEXT *targetctx,
- LPWSTR targetsid, DWORD *sidsize, LPWSTR *transforms)
+static UINT check_product_patches(const WCHAR *prodcode, const WCHAR *usersid, MSIINSTALLCONTEXT context,
+ DWORD filter, DWORD index, DWORD *idx, WCHAR *patch, WCHAR *targetprod,
+ MSIINSTALLCONTEXT *targetctx, WCHAR *targetsid, DWORD *sidsize, WCHAR **transforms)
{
MSIPATCHSTATE state = MSIPATCHSTATE_INVALID;
LPWSTR ptr, patches = NULL;
goto done;
}
- patches = msi_alloc(size);
+ patches = malloc(size);
if (!patches)
{
r = ERROR_OUTOFMEMORY;
if (transforms)
{
- *transforms = msi_alloc(size);
+ *transforms = malloc(size);
if (!*transforms)
{
r = ERROR_OUTOFMEMORY;
{
if (!(filter & MSIPATCHSTATE_APPLIED))
{
- temp = msi_get_patch_state(prodcode, usersid, context,
- ptr, &state);
+ temp = get_patch_state(prodcode, usersid, context, ptr, &state);
if (temp == ERROR_BAD_CONFIGURATION)
{
r = ERROR_BAD_CONFIGURATION;
{
if (!(filter & MSIPATCHSTATE_APPLIED))
{
- temp = msi_get_patch_state(prodcode, usersid, context,
- ptr, &state);
+ temp = get_patch_state(prodcode, usersid, context, ptr, &state);
if (temp == ERROR_BAD_CONFIGURATION)
{
r = ERROR_BAD_CONFIGURATION;
done:
RegCloseKey(prod);
- msi_free(patches);
+ free(patches);
return r;
}
-static UINT msi_enum_patches(LPCWSTR szProductCode, LPCWSTR szUserSid,
- DWORD dwContext, DWORD dwFilter, DWORD dwIndex, DWORD *idx,
- LPWSTR szPatchCode, LPWSTR szTargetProductCode,
- MSIINSTALLCONTEXT *pdwTargetProductContext, LPWSTR szTargetUserSid,
- LPDWORD pcchTargetUserSid, LPWSTR *szTransforms)
+static UINT enum_patches(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter,
+ DWORD dwIndex, DWORD *idx, WCHAR *szPatchCode, WCHAR *szTargetProductCode,
+ MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid,
+ WCHAR **szTransforms)
{
LPWSTR usersid = NULL;
UINT r = ERROR_INVALID_PARAMETER;
if (dwContext & MSIINSTALLCONTEXT_USERMANAGED)
{
- r = msi_check_product_patches(szProductCode, szUserSid,
- MSIINSTALLCONTEXT_USERMANAGED, dwFilter,
- dwIndex, idx, szPatchCode,
- szTargetProductCode,
- pdwTargetProductContext, szTargetUserSid,
- pcchTargetUserSid, szTransforms);
+ r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_USERMANAGED, dwFilter, dwIndex, idx,
+ szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid,
+ pcchTargetUserSid, szTransforms);
if (r != ERROR_NO_MORE_ITEMS)
goto done;
}
if (dwContext & MSIINSTALLCONTEXT_USERUNMANAGED)
{
- r = msi_check_product_patches(szProductCode, szUserSid,
- MSIINSTALLCONTEXT_USERUNMANAGED, dwFilter,
- dwIndex, idx, szPatchCode,
- szTargetProductCode,
- pdwTargetProductContext, szTargetUserSid,
- pcchTargetUserSid, szTransforms);
+ r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_USERUNMANAGED, dwFilter, dwIndex, idx,
+ szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid,
+ pcchTargetUserSid, szTransforms);
if (r != ERROR_NO_MORE_ITEMS)
goto done;
}
if (dwContext & MSIINSTALLCONTEXT_MACHINE)
{
- r = msi_check_product_patches(szProductCode, szUserSid,
- MSIINSTALLCONTEXT_MACHINE, dwFilter,
- dwIndex, idx, szPatchCode,
- szTargetProductCode,
- pdwTargetProductContext, szTargetUserSid,
- pcchTargetUserSid, szTransforms);
+ r = check_product_patches(szProductCode, szUserSid, MSIINSTALLCONTEXT_MACHINE, dwFilter, dwIndex, idx,
+ szPatchCode, szTargetProductCode, pdwTargetProductContext, szTargetUserSid,
+ pcchTargetUserSid, szTransforms);
if (r != ERROR_NO_MORE_ITEMS)
goto done;
}
if (dwIndex == 0)
last_index = 0;
- r = msi_enum_patches(szProductCode, szUserSid, dwContext, dwFilter,
- dwIndex, &idx, szPatchCode, szTargetProductCode,
- pdwTargetProductContext, szTargetUserSid,
- pcchTargetUserSid, NULL);
+ r = enum_patches(szProductCode, szUserSid, dwContext, dwFilter, dwIndex, &idx, szPatchCode, szTargetProductCode,
+ pdwTargetProductContext, szTargetUserSid, pcchTargetUserSid, NULL);
if (r == ERROR_SUCCESS)
last_index = dwIndex;
return ERROR_OUTOFMEMORY;
len = *pcchTransformsBuf;
- transforms = msi_alloc( len * sizeof(WCHAR) );
+ transforms = malloc(len * sizeof(WCHAR));
if (!transforms)
{
r = ERROR_OUTOFMEMORY;
*pcchTransformsBuf = strlen( lpTransformsBuf );
done:
- msi_free(transforms);
- msi_free(product);
+ free(transforms);
+ free(product);
return r;
}
RegCloseKey(prod);
- r = msi_enum_patches(szProduct, NULL, MSIINSTALLCONTEXT_ALL,
- MSIPATCHSTATE_ALL, iPatchIndex, &idx, lpPatchBuf,
- NULL, NULL, NULL, NULL, &transforms);
+ r = enum_patches(szProduct, NULL, MSIINSTALLCONTEXT_ALL, MSIPATCHSTATE_ALL, iPatchIndex, &idx, lpPatchBuf, NULL,
+ NULL, NULL, NULL, &transforms);
if (r != ERROR_SUCCESS)
goto done;
*pcchTransformsBuf = lstrlenW(transforms);
done:
- msi_free(transforms);
+ free(transforms);
return r;
}
if (product && !(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
if (usersid && !(usersidW = strdupAtoW( usersid )))
{
- msi_free( productW );
+ free( productW );
return ERROR_OUTOFMEMORY;
}
- if (sid && !(sidW = msi_alloc( *sid_len * sizeof(WCHAR) )))
+ if (sid && !(sidW = malloc( *sid_len * sizeof(WCHAR) )))
{
- msi_free( usersidW );
- msi_free( productW );
+ free( usersidW );
+ free( productW );
return ERROR_OUTOFMEMORY;
}
r = MsiEnumProductsExW( productW, usersidW, ctx, index, installed_productW,
installed_product, GUID_SIZE, NULL, NULL );
if (sid) WideCharToMultiByte( CP_ACP, 0, sidW, *sid_len + 1, sid, *sid_len + 1, NULL, NULL );
}
- msi_free( productW );
- msi_free( usersidW );
- msi_free( sidW );
+ free( productW );
+ free( usersidW );
+ free( sidW );
return r;
}
#endif
/*
- * MsiActiveScriptSite - Our IActiveScriptSite implementation.
+ * struct script_site - Our IActiveScriptSite implementation.
*/
-typedef struct {
+struct script_site
+{
IActiveScriptSite IActiveScriptSite_iface;
IDispatch *installer;
IDispatch *session;
LONG ref;
-} MsiActiveScriptSite;
+};
-static inline MsiActiveScriptSite *impl_from_IActiveScriptSite( IActiveScriptSite *iface )
+static inline struct script_site *impl_from_IActiveScriptSite( IActiveScriptSite *iface )
{
- return CONTAINING_RECORD(iface, MsiActiveScriptSite, IActiveScriptSite_iface);
+ return CONTAINING_RECORD(iface, struct script_site, IActiveScriptSite_iface);
}
/*
*/
static HRESULT WINAPI MsiActiveScriptSite_QueryInterface(IActiveScriptSite* iface, REFIID riid, void** obj)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
static ULONG WINAPI MsiActiveScriptSite_AddRef(IActiveScriptSite* iface)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE( "(%p)->(%lu)\n", This, ref );
return ref;
static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE( "(%p)->(%lu)\n", This, ref );
if (!ref)
- msi_free(This);
+ free(This);
return ref;
}
static HRESULT WINAPI MsiActiveScriptSite_GetLCID(IActiveScriptSite* iface, LCID* plcid)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p)\n", This, plcid);
return E_NOTIMPL; /* Script will use system-defined locale */
}
static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown** ppiunkItem, ITypeInfo** ppti)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE( "(%p)->(%p, %lu, %p, %p)\n", This, pstrName, dwReturnMask, ppiunkItem, ppti );
static HRESULT WINAPI MsiActiveScriptSite_GetDocVersionString(IActiveScriptSite* iface, BSTR* pbstrVersion)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p)\n", This, pbstrVersion);
return E_NOTIMPL;
}
static HRESULT WINAPI MsiActiveScriptSite_OnScriptTerminate(IActiveScriptSite* iface, const VARIANT* pvarResult, const EXCEPINFO* pexcepinfo)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)->(%p, %p)\n", This, pvarResult, pexcepinfo);
return S_OK;
}
static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface, IActiveScriptError* pscripterror)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
EXCEPINFO exception;
HRESULT hr;
static HRESULT WINAPI MsiActiveScriptSite_OnEnterScript(IActiveScriptSite* iface)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)\n", This);
return S_OK;
}
static HRESULT WINAPI MsiActiveScriptSite_OnLeaveScript(IActiveScriptSite* iface)
{
- MsiActiveScriptSite *This = impl_from_IActiveScriptSite(iface);
+ struct script_site *This = impl_from_IActiveScriptSite(iface);
TRACE("(%p)\n", This);
return S_OK;
}
MsiActiveScriptSite_OnLeaveScript
};
-static HRESULT create_activescriptsite(MsiActiveScriptSite **obj)
+static HRESULT create_activescriptsite(struct script_site **obj)
{
- MsiActiveScriptSite* object;
+ struct script_site *object;
TRACE("(%p)\n", obj);
*obj = NULL;
- object = msi_alloc( sizeof(MsiActiveScriptSite) );
+ object = malloc(sizeof(*object));
if (!object)
return E_OUTOFMEMORY;
HRESULT hr;
IActiveScript *pActiveScript = NULL;
IActiveScriptParse *pActiveScriptParse = NULL;
- MsiActiveScriptSite *scriptsite;
+ struct script_site *scriptsite;
IDispatch *pDispatch = NULL;
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
DISPID dispid;
#include <stdarg.h>
+#define COBJMACROS
+
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
/* below is the query interface to a table */
-typedef struct tagMSISELECTVIEW
+struct select_view
{
MSIVIEW view;
MSIDATABASE *db;
UINT num_cols;
UINT max_cols;
UINT cols[1];
-} MSISELECTVIEW;
+};
-static UINT translate_record( MSISELECTVIEW *sv, MSIRECORD *in, MSIRECORD **out )
+static UINT translate_record( struct select_view *sv, MSIRECORD *in, MSIRECORD **out )
{
UINT r, col_count, i;
MSIRECORD *object;
static UINT SELECT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %d %p\n", sv, row, col, val );
static UINT SELECT_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %d %p\n", sv, row, col, stm );
static UINT SELECT_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
UINT i, expanded_mask = 0, r = ERROR_SUCCESS, col_count = 0;
MSIRECORD *expanded;
static UINT SELECT_insert_row( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
UINT table_cols, r;
MSIRECORD *outrec;
static UINT SELECT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p %p\n", sv, record);
static UINT SELECT_close( struct tagMSIVIEW *view )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv );
static UINT SELECT_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p %p %p\n", sv, rows, cols );
static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p %d %p %p %p %p\n", sv, n, name, type, temporary, table_name );
UINT msi_select_update(MSIVIEW *view, MSIRECORD *rec, UINT row)
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
UINT r, i, col, type, val;
IStream *stream;
LPCWSTR str;
if (MSI_RecordGetIStream(rec, i + 1, &stream))
return ERROR_FUNCTION_FAILED;
r = sv->table->ops->set_stream(sv->table, row, col, stream);
+ IStream_Release(stream);
}
else if (type & MSITYPE_STRING)
{
static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY mode,
MSIRECORD *rec, UINT row )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
MSIRECORD *table_rec;
UINT r;
static UINT SELECT_delete( struct tagMSIVIEW *view )
{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
+ struct select_view *sv = (struct select_view *)view;
TRACE("%p\n", sv );
sv->table->ops->delete( sv->table );
sv->table = NULL;
- msi_free( sv );
+ free( sv );
return ERROR_SUCCESS;
}
NULL,
};
-static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name,
- LPCWSTR table_name )
+static UINT SELECT_AddColumn( struct select_view *sv, const WCHAR *name, const WCHAR *table_name )
{
UINT r, n;
MSIVIEW *table;
UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
const column_info *columns )
{
- MSISELECTVIEW *sv = NULL;
+ struct select_view *sv = NULL;
UINT count = 0, r = ERROR_SUCCESS;
TRACE("%p\n", sv );
count = select_count_columns( columns );
- sv = msi_alloc_zero( FIELD_OFFSET( MSISELECTVIEW, cols[count] ));
+ sv = calloc( 1, offsetof( struct select_view, cols[count] ) );
if( !sv )
return ERROR_FUNCTION_FAILED;
if( r == ERROR_SUCCESS )
*view = &sv->view;
else
- msi_free( sv );
+ free( sv );
return r;
}
* These apis are defined in MSI 3.0
*/
-typedef struct tagMediaInfo
+struct media_info
{
struct list entry;
LPWSTR path;
WCHAR szIndex[10];
DWORD index;
-} media_info;
+};
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions,
MSIINSTALLCONTEXT context, BOOL create)
/* FIXME: add tests for an invalid format */
if (pcchVolumeLabel)
- volume = msi_alloc(*pcchVolumeLabel * sizeof(WCHAR));
+ volume = malloc(*pcchVolumeLabel * sizeof(WCHAR));
if (pcchDiskPrompt)
- prompt = msi_alloc(*pcchDiskPrompt * sizeof(WCHAR));
+ prompt = malloc(*pcchDiskPrompt * sizeof(WCHAR));
if (volume) *volume = '\0';
if (prompt) *prompt = '\0';
*pcchDiskPrompt + 1, NULL, NULL);
done:
- msi_free(product);
- msi_free(usersid);
- msi_free(volume);
- msi_free(prompt);
+ free(product);
+ free(usersid);
+ free(volume);
+ free(prompt);
return r;
}
goto done;
}
- value = msi_alloc(++valuesz * sizeof(WCHAR));
- data = msi_alloc(++datasz * sizeof(WCHAR));
+ value = malloc(++valuesz * sizeof(WCHAR));
+ data = malloc(++datasz * sizeof(WCHAR));
if (!value || !data)
{
r = ERROR_OUTOFMEMORY;
index++;
done:
- msi_free(value);
- msi_free(data);
+ free(value);
+ free(data);
RegCloseKey(source);
return r;
if (r != ERROR_SUCCESS)
goto done;
- source = msi_alloc(++len * sizeof(WCHAR));
+ source = malloc(++len * sizeof(WCHAR));
if (!source)
{
r = ERROR_OUTOFMEMORY;
*pcchSource = len - 1;
done:
- msi_free(product);
- msi_free(usersid);
- msi_free(source);
+ free(product);
+ free(usersid);
+ free(source);
if (r == ERROR_SUCCESS)
{
if (ret != ERROR_SUCCESS)
goto done;
- value = msi_alloc(++len * sizeof(WCHAR));
+ value = malloc(++len * sizeof(WCHAR));
if (!value)
return ERROR_OUTOFMEMORY;
*pcchValue = len - 1;
done:
- msi_free(product);
- msi_free(usersid);
- msi_free(property);
- msi_free(value);
+ free(product);
+ free(usersid);
+ free(property);
+ free(value);
return ret;
}
goto output_out;
}
- source = msi_alloc(size);
+ source = malloc(size);
RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW,
0, 0, (LPBYTE)source, &size);
if (!*source)
{
- msi_free(source);
+ free(source);
RegCloseKey(sourcekey);
return ERROR_SUCCESS;
}
{
if (*source != 'n' && *source != 'u' && *source != 'm')
{
- msi_free(source);
+ free(source);
RegCloseKey(sourcekey);
return ERROR_SUCCESS;
}
}
*pcchValue = lstrlenW(ptr);
- msi_free(source);
+ free(source);
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_PACKAGENAMEW ))
{
ret = MsiSourceListSetInfoW(product, usersid, dwContext, dwOptions,
property, value);
- msi_free(product);
- msi_free(usersid);
- msi_free(property);
- msi_free(value);
+ free(product);
+ free(usersid);
+ free(property);
+ free(value);
return ret;
}
}
size = lstrlenW(L"%c;%d;%s") + lstrlenW(value) + 7;
- buffer = msi_alloc(size * sizeof(WCHAR));
+ buffer = malloc(size * sizeof(WCHAR));
if (!buffer)
return ERROR_OUTOFMEMORY;
r = OpenSourceKey(product, &source, MSICODE_PRODUCT, context, FALSE);
if (r != ERROR_SUCCESS)
{
- msi_free(buffer);
+ free(buffer);
return r;
}
size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
r = RegSetValueExW(source, INSTALLPROPERTY_LASTUSEDSOURCEW, 0,
REG_SZ, (LPBYTE)buffer, size);
- msi_free(buffer);
+ free(buffer);
RegCloseKey(source);
return r;
{
if (LookupAccountNameW(NULL, szUserName, NULL, &sidsize, NULL, &domsize, NULL))
{
- PSID psid = msi_alloc(sidsize);
+ PSID psid = malloc(sidsize);
if (LookupAccountNameW(NULL, szUserName, psid, &sidsize, NULL, &domsize, NULL))
ConvertSidToStringSidW(psid, &sidstr);
- msi_free(psid);
+ free(psid);
}
r = MSIREG_OpenProductKey(szProduct, NULL,
ret = MsiSourceListAddSourceW(szwproduct, szwusername, dwReserved, szwsource);
- msi_free(szwproduct);
- msi_free(szwusername);
- msi_free(szwsource);
+ free(szwproduct);
+ free(szwusername);
+ free(szwsource);
return ret;
}
ret = MsiSourceListAddSourceExW(product, usersid, dwContext,
dwOptions, source, dwIndex);
- msi_free(product);
- msi_free(usersid);
- msi_free(source);
+ free(product);
+ free(usersid);
+ free(source);
return ret;
}
{
while (!list_empty(sourcelist))
{
- media_info *info = LIST_ENTRY(list_head(sourcelist), media_info, entry);
+ struct media_info *info = LIST_ENTRY(list_head(sourcelist), struct media_info, entry);
list_remove(&info->entry);
- msi_free(info->path);
- msi_free(info);
+ free(info->path);
+ free(info);
}
}
-static void add_source_to_list(struct list *sourcelist, media_info *info,
- DWORD *index)
+static void add_source_to_list(struct list *sourcelist, struct media_info *info, DWORD *index)
{
- media_info *iter;
+ struct media_info *iter;
BOOL found = FALSE;
if (index) *index = 0;
return;
}
- LIST_FOR_EACH_ENTRY(iter, sourcelist, media_info, entry)
+ LIST_FOR_EACH_ENTRY(iter, sourcelist, struct media_info, entry)
{
if (!found && info->index < iter->index)
{
DWORD index = 0;
WCHAR name[10];
DWORD size, val_size;
- media_info *entry;
+ struct media_info *entry;
*count = 0;
if (r != ERROR_SUCCESS)
return r;
- entry = msi_alloc(sizeof(media_info));
+ entry = malloc(sizeof(*entry));
if (!entry)
goto error;
- entry->path = msi_alloc(val_size);
+ entry->path = malloc(val_size);
if (!entry->path)
{
- msi_free(entry);
+ free(entry);
goto error;
}
NULL, (LPBYTE)entry->path, &val_size);
if (r != ERROR_SUCCESS)
{
- msi_free(entry->path);
- msi_free(entry);
+ free(entry->path);
+ free(entry);
goto error;
}
HKEY sourcekey, typekey;
UINT rc;
struct list sourcelist;
- media_info *info;
+ struct media_info *info;
WCHAR *source, squashed_pc[SQUASHED_GUID_SIZE], name[10];
LPCWSTR postfix;
DWORD size, count, index;
postfix = (dwOptions & MSISOURCETYPE_NETWORK) ? L"\\" : L"/";
if (szSource[lstrlenW(szSource) - 1] == *postfix)
- source = strdupW(szSource);
+ source = wcsdup(szSource);
else
{
size = lstrlenW(szSource) + 2;
- source = msi_alloc(size * sizeof(WCHAR));
+ source = malloc(size * sizeof(WCHAR));
lstrcpyW(source, szSource);
lstrcatW(source, postfix);
}
else
{
swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex);
- info = msi_alloc(sizeof(media_info));
+ info = malloc(sizeof(*info));
if (!info)
{
rc = ERROR_OUTOFMEMORY;
goto done;
}
- info->path = strdupW(source);
+ info->path = wcsdup(source);
lstrcpyW(info->szIndex, name);
info->index = dwIndex;
add_source_to_list(&sourcelist, info, &index);
- LIST_FOR_EACH_ENTRY(info, &sourcelist, media_info, entry)
+ LIST_FOR_EACH_ENTRY(info, &sourcelist, struct media_info, entry)
{
if (info->index < index)
continue;
done:
free_source_list(&sourcelist);
- msi_free(source);
+ free(source);
RegCloseKey(typekey);
RegCloseKey(sourcekey);
return rc;
r = MsiSourceListAddMediaDiskW(product, usersid, dwContext, dwOptions,
dwDiskId, volume, prompt);
- msi_free(product);
- msi_free(usersid);
- msi_free(volume);
- msi_free(prompt);
+ free(product);
+ free(usersid);
+ free(volume);
+ free(prompt);
return r;
}
if (szDiskPrompt) size += lstrlenW(szDiskPrompt);
size *= sizeof(WCHAR);
- buffer = msi_alloc(size);
+ buffer = malloc(size);
*buffer = '\0';
if (szVolumeLabel) lstrcpyW(buffer, szVolumeLabel);
if (szDiskPrompt) lstrcatW(buffer, szDiskPrompt);
RegSetValueExW(mediakey, szIndex, 0, REG_SZ, (LPBYTE)buffer, size);
- msi_free(buffer);
+ free(buffer);
RegCloseKey(sourcekey);
RegCloseKey(mediakey);
SQL_input* sql = (SQL_input*) info;
struct list *mem;
- mem = msi_alloc( sizeof (struct list) + sz );
+ mem = malloc( sizeof (struct list) + sz );
list_add_tail( sql->mem, mem );
return &mem[1];
}
#define NUM_STORAGES_COLS 2
#define MAX_STORAGES_NAME_LEN 62
-typedef struct tabSTORAGE
+struct storage
{
UINT str_index;
IStorage *storage;
} STORAGE;
-typedef struct tagMSISTORAGESVIEW
+struct storages_view
{
MSIVIEW view;
MSIDATABASE *db;
- STORAGE *storages;
+ struct storage *storages;
UINT max_storages;
UINT num_rows;
UINT row_size;
-} MSISTORAGESVIEW;
+};
-static BOOL storages_set_table_size(MSISTORAGESVIEW *sv, UINT size)
+static BOOL storages_set_table_size(struct storages_view *sv, UINT size)
{
if (size >= sv->max_storages)
{
sv->max_storages *= 2;
- sv->storages = msi_realloc(sv->storages, sv->max_storages * sizeof(*sv->storages));
+ sv->storages = realloc(sv->storages, sv->max_storages * sizeof(*sv->storages));
if (!sv->storages)
return FALSE;
}
static UINT STORAGES_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, val);
static UINT STORAGES_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, stm);
}
size = stat.cbSize.QuadPart;
- data = msi_alloc(size);
+ data = malloc(size);
if (!data)
return E_OUTOFMEMORY;
goto done;
done:
- msi_free(data);
+ free(data);
if (lockbytes) ILockBytes_Release(lockbytes);
return hr;
}
static UINT STORAGES_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream )
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
IStorage *stg, *substg, *prev;
const WCHAR *name;
HRESULT hr;
static UINT STORAGES_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
IStorage *stg, *substg = NULL, *prev;
IStream *stm;
LPWSTR name = NULL;
return r;
}
- name = strdupW(MSI_RecordGetString(rec, 1));
+ name = wcsdup(MSI_RecordGetString(rec, 1));
if (!name)
{
r = ERROR_OUTOFMEMORY;
if (prev) IStorage_Release(prev);
done:
- msi_free(name);
+ free(name);
if (substg) IStorage_Release(substg);
IStorage_Release(stg);
static UINT STORAGES_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
if (!storages_set_table_size(sv, ++sv->num_rows))
return ERROR_FUNCTION_FAILED;
static UINT STORAGES_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
TRACE("(%p, %p, %p)\n", view, rows, cols);
return ERROR_SUCCESS;
}
-static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row)
+static UINT storages_find_row(struct storages_view *sv, MSIRECORD *rec, UINT *row)
{
LPCWSTR str;
UINT r, i, id, data;
static UINT storages_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
UINT r, row;
r = storages_find_row(sv, rec, &row);
static UINT storages_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
UINT r, row;
r = storages_find_row(sv, rec, &row);
static UINT STORAGES_delete(struct tagMSIVIEW *view)
{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
+ struct storages_view *sv = (struct storages_view *)view;
UINT i;
TRACE("(%p)\n", view);
IStorage_Release(sv->storages[i].storage);
}
- msi_free(sv->storages);
+ free(sv->storages);
sv->storages = NULL;
- msi_free(sv);
+ free(sv);
return ERROR_SUCCESS;
}
NULL,
};
-static INT add_storages_to_table(MSISTORAGESVIEW *sv)
+static INT add_storages_to_table(struct storages_view *sv)
{
IEnumSTATSTG *stgenum = NULL;
STATSTG stat;
return -1;
sv->max_storages = 1;
- sv->storages = msi_alloc(sizeof(*sv->storages));
+ sv->storages = malloc(sizeof(*sv->storages));
if (!sv->storages)
return -1;
UINT STORAGES_CreateView(MSIDATABASE *db, MSIVIEW **view)
{
- MSISTORAGESVIEW *sv;
+ struct storages_view *sv;
INT rows;
TRACE("(%p, %p)\n", db, view);
- sv = msi_alloc_zero( sizeof(MSISTORAGESVIEW) );
+ sv = calloc(1, sizeof(*sv));
if (!sv)
return ERROR_FUNCTION_FAILED;
rows = add_storages_to_table(sv);
if (rows < 0)
{
- msi_free( sv );
+ free(sv);
return ERROR_FUNCTION_FAILED;
}
sv->num_rows = rows;
#define NUM_STREAMS_COLS 2
-typedef struct tagMSISTREAMSVIEW
+struct streams_view
{
MSIVIEW view;
MSIDATABASE *db;
UINT num_cols;
-} MSISTREAMSVIEW;
+};
static BOOL streams_resize_table( MSIDATABASE *db, UINT size )
{
if (!db->num_streams_allocated)
{
- if (!(db->streams = msi_alloc_zero( size * sizeof(MSISTREAM) ))) return FALSE;
+ if (!(db->streams = calloc( size, sizeof(MSISTREAM) ))) return FALSE;
db->num_streams_allocated = size;
return TRUE;
}
{
MSISTREAM *tmp;
UINT new_size = db->num_streams_allocated * 2;
- if (!(tmp = msi_realloc( db->streams, new_size * sizeof(*tmp) ))) return FALSE;
+ if (!(tmp = realloc( db->streams, new_size * sizeof(*tmp) ))) return FALSE;
memset( tmp + db->num_streams_allocated, 0, (new_size - db->num_streams_allocated) * sizeof(*tmp) );
db->streams = tmp;
db->num_streams_allocated = new_size;
static UINT STREAMS_fetch_int(struct tagMSIVIEW *view, UINT row, UINT col, UINT *val)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %d, %p)\n", view, row, col, val);
static UINT STREAMS_fetch_stream(struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
LARGE_INTEGER pos;
HRESULT hr;
static UINT STREAMS_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream )
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
IStream *prev;
TRACE("view %p, row %u, col %u, stream %p.\n", view, row, col, stream);
static UINT STREAMS_set_row(struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %p, %08x)\n", view, row, rec, mask);
return ERROR_SUCCESS;
}
-static UINT streams_find_row( MSISTREAMSVIEW *sv, MSIRECORD *rec, UINT *row )
+static UINT streams_find_row( struct streams_view *sv, MSIRECORD *rec, UINT *row )
{
const WCHAR *str;
UINT r, i, id, val;
static UINT STREAMS_insert_row(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
UINT i, r, num_rows = sv->db->num_streams + 1;
TRACE("(%p, %p, %d, %d)\n", view, rec, row, temporary);
static UINT STREAMS_delete_row(struct tagMSIVIEW *view, UINT row)
{
- MSIDATABASE *db = ((MSISTREAMSVIEW *)view)->db;
+ MSIDATABASE *db = ((struct streams_view *)view)->db;
UINT i, num_rows = db->num_streams - 1;
const WCHAR *name;
WCHAR *encname;
db->num_streams = num_rows;
hr = IStorage_DestroyElement( db->storage, encname );
- msi_free( encname );
+ free( encname );
return FAILED( hr ) ? ERROR_FUNCTION_FAILED : ERROR_SUCCESS;
}
static UINT STREAMS_get_dimensions(struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %p, %p)\n", view, rows, cols);
static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary, table_name);
static UINT streams_modify_update(struct tagMSIVIEW *view, MSIRECORD *rec)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
UINT r, row;
r = streams_find_row(sv, rec, &row);
static UINT streams_modify_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
UINT r;
r = streams_find_row( sv, rec, NULL );
static UINT STREAMS_delete(struct tagMSIVIEW *view)
{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
+ struct streams_view *sv = (struct streams_view *)view;
TRACE("(%p)\n", view);
- msi_free(sv);
+ free(sv);
return ERROR_SUCCESS;
}
return ERROR_OUTOFMEMORY;
hr = open_stream( db, encname, ret );
- msi_free( encname );
+ free( encname );
if (FAILED( hr ))
return ERROR_FUNCTION_FAILED;
UINT STREAMS_CreateView(MSIDATABASE *db, MSIVIEW **view)
{
- MSISTREAMSVIEW *sv;
+ struct streams_view *sv;
UINT r;
TRACE("(%p, %p)\n", db, view);
if (r != ERROR_SUCCESS)
return r;
- if (!(sv = msi_alloc_zero( sizeof(MSISTREAMSVIEW) )))
+ if (!(sv = calloc( 1, sizeof(*sv) )))
return ERROR_OUTOFMEMORY;
sv->view.ops = &streams_ops;
if (FAILED( hr ))
{
ERR( "failed to write stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
- msi_free( encname );
+ free( encname );
IStream_Release( stream );
return ERROR_FUNCTION_FAILED;
}
if (FAILED( hr ))
{
ERR( "failed to commit stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
- msi_free( encname );
+ free( encname );
return ERROR_FUNCTION_FAILED;
}
}
else if (hr != STG_E_FILEALREADYEXISTS)
{
ERR( "failed to create stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
- msi_free( encname );
+ free( encname );
return ERROR_FUNCTION_FAILED;
}
- msi_free( encname );
+ free( encname );
}
return ERROR_SUCCESS;
if (!validate_codepage( codepage ))
return NULL;
- st = msi_alloc( sizeof (string_table) );
+ st = malloc( sizeof(string_table) );
if( !st )
return NULL;
if( entries < 1 )
entries = 1;
- st->strings = msi_alloc_zero( sizeof(struct msistring) * entries );
+ st->strings = calloc( entries, sizeof(struct msistring) );
if( !st->strings )
{
- msi_free( st );
+ free( st );
return NULL;
}
- st->sorted = msi_alloc( sizeof (UINT) * entries );
+ st->sorted = malloc( sizeof(UINT) * entries );
if( !st->sorted )
{
- msi_free( st->strings );
- msi_free( st );
+ free( st->strings );
+ free( st );
return NULL;
}
{
if( st->strings[i].persistent_refcount ||
st->strings[i].nonpersistent_refcount )
- msi_free( st->strings[i].data );
+ free( st->strings[i].data );
}
- msi_free( st->strings );
- msi_free( st->sorted );
- msi_free( st );
+ free( st->strings );
+ free( st->sorted );
+ free( st );
}
static int st_find_free_entry( string_table *st )
/* dynamically resize */
sz = st->maxcount + 1 + st->maxcount / 2;
- if (!(p = msi_realloc( st->strings, sz * sizeof(*p) ))) return -1;
+ if (!(p = realloc( st->strings, sz * sizeof(*p) ))) return -1;
memset( p + st->maxcount, 0, (sz - st->maxcount) * sizeof(*p) );
- if (!(s = msi_realloc( st->sorted, sz * sizeof(*s) )))
+ if (!(s = realloc( st->sorted, sz * sizeof(*s) )))
{
- msi_free( p );
+ free( p );
return -1;
}
if (!(sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 )))
return r;
- str = msi_alloc( sz*sizeof(WCHAR) );
+ str = malloc( sz * sizeof(WCHAR) );
if( !str )
return ERROR_NOT_ENOUGH_MEMORY;
MultiByteToWideChar( st->codepage, 0, buffer, -1, str, sz );
r = msi_string2id( st, str, sz - 1, id );
- msi_free( str );
+ free( str );
return r;
}
/* allocate a new string */
sz = MultiByteToWideChar( st->codepage, 0, data, len, NULL, 0 );
- str = msi_alloc( (sz+1)*sizeof(WCHAR) );
+ str = malloc( (sz + 1) * sizeof(WCHAR) );
if( !str )
return -1;
MultiByteToWideChar( st->codepage, 0, data, len, str, sz );
/* allocate a new string */
TRACE( "%s, n = %d len = %d\n", debugstr_wn(data, len), n, len );
- str = msi_alloc( (len+1)*sizeof(WCHAR) );
+ str = malloc( (len + 1) * sizeof(WCHAR) );
if( !str )
return -1;
memcpy( str, data, len*sizeof(WCHAR) );
TRACE( "loaded %lu strings\n", count );
end:
- msi_free( pool );
- msi_free( data );
+ free( pool );
+ free( data );
return st;
}
TRACE("%u %u %u\n", st->maxcount, datasize, poolsize );
- pool = msi_alloc( poolsize );
+ pool = malloc( poolsize );
if( ! pool )
{
WARN("Failed to alloc pool %d bytes\n", poolsize );
goto err;
}
- data = msi_alloc( datasize );
+ data = malloc( datasize );
if( ! data )
{
WARN("Failed to alloc data %d bytes\n", datasize );
ret = ERROR_SUCCESS;
err:
- msi_free( data );
- msi_free( pool );
+ free( data );
+ free( pool );
return ret;
}
#include "pshpack1.h"
-typedef struct {
+struct property_set_header
+{
WORD wByteOrder;
WORD wFormat;
DWORD dwOSVer;
CLSID clsID;
DWORD reserved;
-} PROPERTYSETHEADER;
+};
-typedef struct {
+struct format_id_offset
+{
FMTID fmtid;
DWORD dwOffset;
-} FORMATIDOFFSET;
+};
-typedef struct {
+struct property_section_header
+{
DWORD cbSection;
DWORD cProperties;
-} PROPERTYSECTIONHEADER;
+};
-typedef struct {
+struct property_id_offset
+{
DWORD propid;
DWORD dwOffset;
-} PROPERTYIDOFFSET;
+};
-typedef struct {
+struct property_data
+{
DWORD type;
union {
INT i4;
BYTE str[1];
} str;
} u;
-} PROPERTY_DATA;
+};
#include "poppack.h"
(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc,
PROPVAR_CHANGE_FLAGS flags, VARTYPE vt);
-#define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER))
+#define SECT_HDR_SIZE (sizeof(struct property_section_header))
static void free_prop( PROPVARIANT *prop )
{
if (prop->vt == VT_LPSTR )
- msi_free( prop->pszVal );
+ free( prop->pszVal );
prop->vt = VT_EMPTY;
}
{
UINT type;
DWORD i, size;
- PROPERTY_DATA *propdata;
+ struct property_data *propdata;
PROPVARIANT property, *ptr;
PROPVARIANT changed;
- PROPERTYIDOFFSET *idofs;
- PROPERTYSECTIONHEADER *section_hdr;
+ struct property_id_offset *idofs;
+ struct property_section_header *section_hdr;
- section_hdr = (PROPERTYSECTIONHEADER*) &data[0];
- idofs = (PROPERTYIDOFFSET*) &data[SECT_HDR_SIZE];
+ section_hdr = (struct property_section_header *) &data[0];
+ idofs = (struct property_id_offset *)&data[SECT_HDR_SIZE];
/* now set all the properties */
for( i = 0; i < section_hdr->cProperties; i++ )
break;
}
- propdata = (PROPERTY_DATA*) &data[ idofs[i].dwOffset ];
+ propdata = (struct property_data *)&data[ idofs[i].dwOffset ];
/* check we don't run off the end of the data */
size = sz - idofs[i].dwOffset - sizeof(DWORD);
property.vt = propdata->type;
if( propdata->type == VT_LPSTR )
{
- LPSTR str = msi_alloc( propdata->u.str.len );
+ char *str = malloc( propdata->u.str.len );
memcpy( str, propdata->u.str.str, propdata->u.str.len );
str[ propdata->u.str.len - 1 ] = 0;
property.pszVal = str;
static UINT load_summary_info( MSISUMMARYINFO *si, IStream *stm )
{
- PROPERTYSETHEADER set_hdr;
- FORMATIDOFFSET format_hdr;
- PROPERTYSECTIONHEADER section_hdr;
+ struct property_set_header set_hdr;
+ struct format_id_offset format_hdr;
+ struct property_section_header section_hdr;
LPBYTE data = NULL;
LARGE_INTEGER ofs;
ULONG count, sz;
return ERROR_FUNCTION_FAILED;
}
- data = msi_alloc( section_hdr.cbSection);
+ data = malloc( section_hdr.cbSection );
if( !data )
return ERROR_FUNCTION_FAILED;
else
ERR( "failed to read properties %lu %lu\n", count, sz );
- msi_free( data );
+ free( data );
return ERROR_SUCCESS;
}
static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm )
{
UINT ret = ERROR_FUNCTION_FAILED;
- PROPERTYSETHEADER set_hdr;
- FORMATIDOFFSET format_hdr;
- PROPERTYSECTIONHEADER section_hdr;
- PROPERTYIDOFFSET idofs[MSI_MAX_PROPS];
+ struct property_set_header set_hdr;
+ struct format_id_offset format_hdr;
+ struct property_section_header section_hdr;
+ struct property_id_offset idofs[MSI_MAX_PROPS];
LPBYTE data = NULL;
ULONG count, sz;
HRESULT r;
section_hdr.cbSection += sz;
}
- data = msi_alloc_zero( section_hdr.cbSection );
+ data = calloc( 1, section_hdr.cbSection );
sz = 0;
memcpy( &data[sz], §ion_hdr, sizeof section_hdr );
sz += write_property_to_data( &si->property[i], &data[sz] );
r = IStream_Write( stm, data, sz, &count );
- msi_free( data );
+ free( data );
if( FAILED(r) || count != sz )
return ret;
ret = MsiGetSummaryInformationW(hDatabase, szwDatabase, uiUpdateCount, pHandle);
- msi_free( szwDatabase );
+ free( szwDatabase );
return ret;
}
{
len = WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
NULL, 0, NULL, NULL );
- prop->pszVal = msi_alloc( len );
+ prop->pszVal = malloc( len );
WideCharToMultiByte( CP_ACP, 0, str->str.w, -1,
prop->pszVal, len, NULL, NULL );
}
else
{
len = lstrlenA( str->str.a ) + 1;
- prop->pszVal = msi_alloc( len );
+ prop->pszVal = malloc( len );
lstrcpyA( prop->pszVal, str->str.a );
}
break;
return ERROR_SUCCESS;
}
-static UINT msi_set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType,
- INT iValue, FILETIME *pftValue, awcstring *str )
+static UINT suminfo_set_prop( MSISUMMARYINFO *si, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue,
+ awcstring *str )
{
UINT type = get_type( uiProperty );
if( type == VT_EMPTY || type != uiDataType )
str.unicode = TRUE;
str.str.w = szValue;
- ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
+ ret = suminfo_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
msiobj_release( &si->hdr );
return ret;
}
str.unicode = FALSE;
str.str.a = szValue;
- ret = msi_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
+ ret = suminfo_set_prop( si, uiProperty, uiDataType, iValue, pftValue, &str );
msiobj_release( &si->hdr );
return ret;
}
break;
case VT_LPSTR:
len++;
- if (!(str.str.a = msi_alloc( len )))
+ if (!(str.str.a = malloc( len )))
return ERROR_OUTOFMEMORY;
r = get_prop( si, row, NULL, NULL, NULL, &str, &len );
if (r != ERROR_SUCCESS)
{
- msi_free( str.str.a );
+ free( str.str.a );
return r;
}
sz = len;
if (!WriteFile( handle, str.str.a, sz, &sz, NULL ))
{
- msi_free( str.str.a );
+ free( str.str.a );
return ERROR_WRITE_FAULT;
}
- msi_free( str.str.a );
+ free( str.str.a );
break;
case VT_FILETIME:
if (!FileTimeToSystemTime( &file_time, &system_time ))
return ERROR_OUTOFMEMORY;
r = MsiCreateTransformSummaryInfoW( db, db_ref, transformW, error, validation );
- msi_free( transformW );
+ free( transformW );
return r;
}
}
len++;
- if (!(package_code = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ if (!(package_code = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
str.str.w = package_code;
r = get_prop( si, PID_REVNUMBER, NULL, NULL, NULL, &str, &len );
if (r != ERROR_SUCCESS)
{
- msi_free( package_code );
+ free( package_code );
msiobj_release( &si->hdr );
return r;
}
r = msi_set_property( package->db, L"PackageCode", package_code, len );
- msi_free( package_code );
+ free( package_code );
count = 0;
get_prop( si, PID_WORDCOUNT, NULL, &count, NULL, NULL, NULL );
#define MSITABLE_HASH_TABLE_SIZE 37
-typedef struct tagMSICOLUMNHASHENTRY
+struct column_hash_entry
{
- struct tagMSICOLUMNHASHENTRY *next;
+ struct column_hash_entry *next;
UINT value;
UINT row;
-} MSICOLUMNHASHENTRY;
+};
-typedef struct tagMSICOLUMNINFO
+struct column_info
{
LPCWSTR tablename;
UINT number;
LPCWSTR colname;
UINT type;
UINT offset;
- MSICOLUMNHASHENTRY **hash_table;
-} MSICOLUMNINFO;
+ struct column_hash_entry **hash_table;
+};
struct tagMSITABLE
{
BOOL *data_persistent;
UINT row_count;
struct list entry;
- MSICOLUMNINFO *colinfo;
+ struct column_info *colinfo;
UINT col_count;
MSICONDITION persistent;
LONG ref_count;
};
/* information for default tables */
-static const MSICOLUMNINFO _Columns_cols[4] = {
+static const struct column_info _Columns_cols[4] =
+{
{ L"_Columns", 1, L"Table", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
{ L"_Columns", 2, L"Number", MSITYPE_VALID | MSITYPE_KEY | 2, 2, NULL },
{ L"_Columns", 3, L"Name", MSITYPE_VALID | MSITYPE_STRING | 64, 4, NULL },
{ L"_Columns", 4, L"Type", MSITYPE_VALID | 2, 6, NULL },
};
-static const MSICOLUMNINFO _Tables_cols[1] = {
+static const struct column_info _Tables_cols[1] =
+{
{ L"_Tables", 1, L"Name", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
};
#define MAX_STREAM_NAME 0x1f
-static inline UINT bytes_per_column( MSIDATABASE *db, const MSICOLUMNINFO *col, UINT bytes_per_strref )
+static inline UINT bytes_per_column( MSIDATABASE *db, const struct column_info *col, UINT bytes_per_strref )
{
if( MSITYPE_IS_BINARY(col->type) )
return 2;
if( !bTable )
count = lstrlenW( in )+2;
- if (!(out = msi_alloc( count*sizeof(WCHAR) ))) return NULL;
+ if (!(out = malloc( count * sizeof(WCHAR) ))) return NULL;
p = out;
if( bTable )
*p++ = ch;
}
ERR("Failed to encode stream name (%s)\n",debugstr_w(in));
- msi_free( out );
+ free( out );
return NULL;
}
r = IStorage_OpenStream(stg, encname, NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm);
- msi_free( encname );
+ free(encname);
if( FAILED( r ) )
{
WARN( "open stream failed r = %#lx - empty table?\n", r );
}
sz = stat.cbSize.QuadPart;
- data = msi_alloc( sz );
+ data = malloc(sz);
if( !data )
{
WARN( "couldn't allocate memory r = %#lx!\n", r );
r = IStream_Read(stm, data, sz, &count );
if( FAILED( r ) || ( count != sz ) )
{
- msi_free( data );
+ free(data);
WARN("read stream failed r = %#lx!\n", r);
goto end;
}
r = IStorage_CreateStream( stg, encname,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
}
- msi_free( encname );
+ free( encname );
if( FAILED( r ) )
{
WARN( "open stream failed r = %#lx\n", r );
return ret;
}
-static void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count )
+static void free_colinfo( struct column_info *colinfo, UINT count )
{
UINT i;
- for (i = 0; i < count; i++) msi_free( colinfo[i].hash_table );
+ for (i = 0; i < count; i++) free( colinfo[i].hash_table );
}
static void free_table( MSITABLE *table )
{
UINT i;
for( i=0; i<table->row_count; i++ )
- msi_free( table->data[i] );
- msi_free( table->data );
- msi_free( table->data_persistent );
- msi_free_colinfo( table->colinfo, table->col_count );
- msi_free( table->colinfo );
- msi_free( table );
+ free( table->data[i] );
+ free( table->data );
+ free( table->data_persistent );
+ free_colinfo( table->colinfo, table->col_count );
+ free( table->colinfo );
+ free( table );
}
-static UINT msi_table_get_row_size( MSIDATABASE *db, const MSICOLUMNINFO *cols, UINT count, UINT bytes_per_strref )
+static UINT table_get_row_size( MSIDATABASE *db, const struct column_info *cols, UINT count, UINT bytes_per_strref )
{
- const MSICOLUMNINFO *last_col;
+ const struct column_info *last_col;
if (!count)
return 0;
TRACE("%s\n",debugstr_w(t->name));
- row_size = msi_table_get_row_size( db, t->colinfo, t->col_count, db->bytes_per_strref );
- row_size_mem = msi_table_get_row_size( db, t->colinfo, t->col_count, LONG_STR_BYTES );
+ row_size = table_get_row_size( db, t->colinfo, t->col_count, db->bytes_per_strref );
+ row_size_mem = table_get_row_size( db, t->colinfo, t->col_count, LONG_STR_BYTES );
/* if we can't read the table, just assume that it's empty */
read_stream_data( stg, t->name, TRUE, &rawdata, &rawsize );
if ((t->row_count = rawsize / row_size))
{
- if (!(t->data = msi_alloc_zero( t->row_count * sizeof(USHORT *) ))) goto err;
- if (!(t->data_persistent = msi_alloc_zero( t->row_count * sizeof(BOOL) ))) goto err;
+ if (!(t->data = calloc( t->row_count, sizeof(USHORT *) ))) goto err;
+ if (!(t->data_persistent = calloc( t->row_count, sizeof(BOOL) ))) goto err;
}
/* transpose all the data */
{
UINT ofs = 0, ofs_mem = 0;
- t->data[i] = msi_alloc( row_size_mem );
+ t->data[i] = malloc( row_size_mem );
if( !t->data[i] )
goto err;
t->data_persistent[i] = TRUE;
}
}
- msi_free( rawdata );
+ free( rawdata );
return ERROR_SUCCESS;
err:
- msi_free( rawdata );
+ free( rawdata );
return ERROR_FUNCTION_FAILED;
}
return NULL;
}
-static void table_calc_column_offsets( MSIDATABASE *db, MSICOLUMNINFO *colinfo, DWORD count )
+static void table_calc_column_offsets( MSIDATABASE *db, struct column_info *colinfo, DWORD count )
{
DWORD i;
}
}
-static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO *colinfo, UINT *sz )
+static UINT get_defaulttablecolumns( MSIDATABASE *db, const WCHAR *name, struct column_info *colinfo, UINT *sz )
{
- const MSICOLUMNINFO *p;
+ const struct column_info *p;
DWORD i, n;
TRACE("%s\n", debugstr_w(name));
return ERROR_SUCCESS;
}
-static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINFO *colinfo, UINT *sz );
+static UINT get_tablecolumns( MSIDATABASE *, const WCHAR *, struct column_info *, UINT * );
-static UINT table_get_column_info( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINFO **pcols, UINT *pcount )
+static UINT table_get_column_info( MSIDATABASE *db, const WCHAR *name, struct column_info **pcols, UINT *pcount )
{
UINT r, column_count = 0;
- MSICOLUMNINFO *columns;
+ struct column_info *columns;
/* get the number of columns in this table */
column_count = 0;
TRACE("table %s found\n", debugstr_w(name));
- columns = msi_alloc( column_count * sizeof(MSICOLUMNINFO) );
+ columns = malloc( column_count * sizeof(*columns) );
if (!columns)
return ERROR_FUNCTION_FAILED;
r = get_tablecolumns( db, name, columns, &column_count );
if (r != ERROR_SUCCESS)
{
- msi_free( columns );
+ free( columns );
return ERROR_FUNCTION_FAILED;
}
*pcols = columns;
}
/* nonexistent tables should be interpreted as empty tables */
- table = msi_alloc( sizeof(MSITABLE) + lstrlenW( name ) * sizeof(WCHAR) );
+ table = malloc( sizeof(MSITABLE) + wcslen( name ) * sizeof(WCHAR) );
if (!table)
return ERROR_FUNCTION_FAILED;
return ret;
}
-static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINFO *colinfo, UINT *sz )
+static UINT get_tablecolumns( MSIDATABASE *db, const WCHAR *szTableName, struct column_info *colinfo, UINT *sz )
{
UINT r, i, n = 0, table_id, count, maxcount = *sz;
MSITABLE *table = NULL;
if (colinfo && n != maxcount)
{
ERR("missing column in table %s\n", debugstr_w(szTableName));
- msi_free_colinfo( colinfo, maxcount );
+ free_colinfo( colinfo, maxcount );
return ERROR_FUNCTION_FAILED;
}
table_calc_column_offsets( db, colinfo, n );
return ERROR_BAD_QUERY_SYNTAX;
}
- table = msi_alloc( sizeof (MSITABLE) + lstrlenW(name)*sizeof (WCHAR) );
+ table = malloc( sizeof(MSITABLE) + wcslen(name) * sizeof(WCHAR) );
if( !table )
return ERROR_FUNCTION_FAILED;
for( col = col_info; col; col = col->next )
table->col_count++;
- table->colinfo = msi_alloc( table->col_count * sizeof(MSICOLUMNINFO) );
+ table->colinfo = malloc( table->col_count * sizeof(*table->colinfo) );
if (!table->colinfo)
{
free_table( table );
TRACE("Saving %s\n", debugstr_w( t->name ) );
- row_size = msi_table_get_row_size( db, t->colinfo, t->col_count, bytes_per_strref );
+ row_size = table_get_row_size( db, t->colinfo, t->col_count, bytes_per_strref );
row_count = t->row_count;
for (i = 0; i < t->row_count; i++)
{
}
}
rawsize = row_count * row_size;
- rawdata = msi_alloc_zero( rawsize );
+ rawdata = calloc( 1, rawsize );
if( !rawdata )
{
r = ERROR_NOT_ENOUGH_MEMORY;
r = write_stream_data( db->storage, t->name, rawdata, rawsize, TRUE );
err:
- msi_free( rawdata );
+ free( rawdata );
return r;
}
-static void msi_update_table_columns( MSIDATABASE *db, LPCWSTR name )
+static void update_table_columns( MSIDATABASE *db, const WCHAR *name )
{
MSITABLE *table;
UINT size, offset, old_count;
if (!(table = find_cached_table( db, name ))) return;
old_count = table->col_count;
- msi_free_colinfo( table->colinfo, table->col_count );
- msi_free( table->colinfo );
+ free_colinfo( table->colinfo, table->col_count );
+ free( table->colinfo );
table->colinfo = NULL;
table_get_column_info( db, name, &table->colinfo, &table->col_count );
if (!table->col_count) return;
- size = msi_table_get_row_size( db, table->colinfo, table->col_count, LONG_STR_BYTES );
+ size = table_get_row_size( db, table->colinfo, table->col_count, LONG_STR_BYTES );
offset = table->colinfo[table->col_count - 1].offset;
for ( n = 0; n < table->row_count; n++ )
{
- table->data[n] = msi_realloc( table->data[n], size );
+ table->data[n] = realloc( table->data[n], size );
if (old_count < table->col_count)
memset( &table->data[n][offset], 0, size - offset );
}
/* below is the query interface to a table */
-typedef struct tagMSITABLEVIEW
+struct table_view
{
MSIVIEW view;
MSIDATABASE *db;
MSITABLE *table;
- MSICOLUMNINFO *columns;
+ struct column_info *columns;
UINT num_cols;
UINT row_size;
WCHAR name[1];
-} MSITABLEVIEW;
+};
static UINT TABLE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT offset, n;
if( !tv->table )
return ERROR_SUCCESS;
}
-static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname )
+static UINT get_stream_name( const struct table_view *tv, UINT row, WCHAR **pstname )
{
LPWSTR p, stname = NULL;
UINT i, r, type, ival;
TRACE("%p %d\n", tv, row);
len = lstrlenW( tv->name ) + 1;
- stname = msi_alloc( len*sizeof(WCHAR) );
+ stname = malloc( len * sizeof(WCHAR) );
if ( !stname )
{
r = ERROR_OUTOFMEMORY;
}
len += lstrlenW( L"." ) + lstrlenW( sval );
- p = msi_realloc ( stname, len*sizeof(WCHAR) );
+ p = realloc( stname, len * sizeof(WCHAR) );
if ( !p )
{
r = ERROR_OUTOFMEMORY;
return ERROR_SUCCESS;
err:
- msi_free( stname );
+ free( stname );
*pstname = NULL;
return r;
}
*/
static UINT TABLE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r;
WCHAR *name;
if (r != ERROR_SUCCESS)
ERR("fetching stream %s, error = %u\n", debugstr_w(name), r);
- msi_free( name );
+ free( name );
return r;
}
/* Set a table value, i.e. preadjusted integer or string ID. */
-static UINT table_set_bytes( MSITABLEVIEW *tv, UINT row, UINT col, UINT val )
+static UINT table_set_bytes( struct table_view *tv, UINT row, UINT col, UINT val )
{
UINT offset, n, i;
return ERROR_FUNCTION_FAILED;
}
- msi_free( tv->columns[col-1].hash_table );
+ free( tv->columns[col-1].hash_table );
tv->columns[col-1].hash_table = NULL;
n = bytes_per_column( tv->db, &tv->columns[col - 1], LONG_STR_BYTES );
return ERROR_SUCCESS;
}
-static UINT int_to_table_storage( const MSITABLEVIEW *tv, UINT col, int val, UINT *ret )
+static UINT int_to_table_storage( const struct table_view *tv, UINT col, int val, UINT *ret )
{
if ((tv->columns[col-1].type & MSI_DATASIZEMASK) == 2)
{
static UINT TABLE_set_int( MSIVIEW *view, UINT row, UINT col, int val )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r, table_int;
TRACE("row %u, col %u, val %d.\n", row, col, val);
static UINT TABLE_set_string( MSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
BOOL persistent;
UINT id, r;
static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
if (!tv->table)
return ERROR_INVALID_PARAMETER;
static UINT TABLE_set_stream( MSIVIEW *view, UINT row, UINT col, IStream *stream )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
WCHAR *name;
UINT r;
return r;
r = add_stream( tv->db, name, stream );
- msi_free( name );
+ free( name );
return r;
}
-static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT iField, UINT *pvalue )
+static UINT get_table_value_from_record( struct table_view *tv, MSIRECORD *rec, UINT iField, UINT *pvalue )
{
- MSICOLUMNINFO columninfo;
+ struct column_info columninfo;
UINT r;
if (!iField || iField > tv->num_cols || MSI_RecordIsNull( rec, iField ))
static UINT TABLE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT i, val, r = ERROR_SUCCESS;
if ( !tv->table )
r = add_stream( tv->db, stname, stm );
IStream_Release( stm );
- msi_free ( stname );
+ free( stname );
if ( r != ERROR_SUCCESS )
return r;
static UINT table_create_new_row( struct tagMSIVIEW *view, UINT *num, BOOL temporary )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
BYTE **p, *row;
BOOL *b;
UINT sz;
if( !tv->table )
return ERROR_INVALID_PARAMETER;
- row = msi_alloc_zero( tv->row_size );
+ row = calloc( 1, tv->row_size );
if( !row )
return ERROR_NOT_ENOUGH_MEMORY;
sz = (*row_count + 1) * sizeof (BYTE*);
if( *data_ptr )
- p = msi_realloc( *data_ptr, sz );
+ p = realloc( *data_ptr, sz );
else
- p = msi_alloc( sz );
+ p = malloc( sz );
if( !p )
{
- msi_free( row );
+ free( row );
return ERROR_NOT_ENOUGH_MEMORY;
}
sz = (*row_count + 1) * sizeof (BOOL);
if( *data_persist_ptr )
- b = msi_realloc( *data_persist_ptr, sz );
+ b = realloc( *data_persist_ptr, sz );
else
- b = msi_alloc( sz );
+ b = malloc( sz );
if( !b )
{
- msi_free( row );
- msi_free( p );
+ free( row );
+ free( p );
return ERROR_NOT_ENOUGH_MEMORY;
}
static UINT TABLE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
TRACE("%p %p\n", tv, record);
static UINT TABLE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
TRACE("%p %p %p\n", view, rows, cols );
UINT n, LPCWSTR *name, UINT *type, BOOL *temporary,
LPCWSTR *table_name )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
TRACE("%p %d %p %p\n", tv, n, name, type );
return ERROR_SUCCESS;
}
-static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column );
+static UINT table_find_row( struct table_view *, MSIRECORD *, UINT *, UINT * );
-static UINT table_validate_new( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *column )
+static UINT table_validate_new( struct table_view *tv, MSIRECORD *rec, UINT *column )
{
UINT r, row, i;
}
/* check there are no duplicate keys */
- r = msi_table_find_row( tv, rec, &row, column );
+ r = table_find_row( tv, rec, &row, column );
if (r == ERROR_SUCCESS)
return ERROR_FUNCTION_FAILED;
return ERROR_SUCCESS;
}
-static int compare_record( MSITABLEVIEW *tv, UINT row, MSIRECORD *rec )
+static int compare_record( struct table_view *tv, UINT row, MSIRECORD *rec )
{
UINT r, i, ivalue, x;
return 1;
}
-static int find_insert_index( MSITABLEVIEW *tv, MSIRECORD *rec )
+static int find_insert_index( struct table_view *tv, MSIRECORD *rec )
{
int idx, c, low = 0, high = tv->table->row_count - 1;
static UINT TABLE_insert_row( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row, BOOL temporary )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT i, r;
TRACE("%p %p %s\n", tv, rec, temporary ? "TRUE" : "FALSE" );
static UINT TABLE_delete_row( struct tagMSIVIEW *view, UINT row )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r, num_rows, num_cols, i;
TRACE("%p %d\n", tv, row);
/* reset the hash tables */
for (i = 0; i < tv->num_cols; i++)
{
- msi_free( tv->columns[i].hash_table );
+ free(tv->columns[i].hash_table);
tv->columns[i].hash_table = NULL;
}
tv->table->data_persistent[i - 1] = tv->table->data_persistent[i];
}
- msi_free(tv->table->data[num_rows - 1]);
+ free(tv->table->data[num_rows - 1]);
return ERROR_SUCCESS;
}
-static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
+static UINT table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r, new_row;
/* FIXME: MsiViewFetch should set rec index 0 to some ID that
if (!tv->table)
return ERROR_INVALID_PARAMETER;
- r = msi_table_find_row(tv, rec, &new_row, NULL);
+ r = table_find_row(tv, rec, &new_row, NULL);
if (r != ERROR_SUCCESS)
{
ERR("can't find row to modify\n");
return TABLE_set_row(view, new_row, rec, (1 << tv->num_cols) - 1);
}
-static UINT msi_table_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
+static UINT table_assign(struct tagMSIVIEW *view, MSIRECORD *rec)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW *)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r, row;
if (!tv->table)
return ERROR_INVALID_PARAMETER;
- r = msi_table_find_row(tv, rec, &row, NULL);
+ r = table_find_row(tv, rec, &row, NULL);
if (r == ERROR_SUCCESS)
return TABLE_set_row(view, row, rec, (1 << tv->num_cols) - 1);
else
return TABLE_insert_row( view, rec, -1, FALSE );
}
-static UINT msi_refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row )
+static UINT refresh_record( struct tagMSIVIEW *view, MSIRECORD *rec, UINT row )
{
MSIRECORD *curr;
UINT r, i, count;
static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
UINT r, frow, column;
TRACE("%p %d %p\n", view, eModifyMode, rec );
break;
case MSIMODIFY_REFRESH:
- r = msi_refresh_record( view, rec, row );
+ r = refresh_record( view, rec, row );
break;
case MSIMODIFY_UPDATE:
- r = msi_table_update( view, rec, row );
+ r = table_update( view, rec, row );
break;
case MSIMODIFY_ASSIGN:
- r = msi_table_assign( view, rec );
+ r = table_assign( view, rec );
break;
case MSIMODIFY_MERGE:
/* check row that matches this record */
- r = msi_table_find_row( tv, rec, &frow, &column );
+ r = table_find_row( tv, rec, &frow, &column );
if (r != ERROR_SUCCESS)
{
r = table_validate_new( tv, rec, NULL );
static UINT TABLE_delete( struct tagMSIVIEW *view )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
TRACE("%p\n", view );
tv->table = NULL;
tv->columns = NULL;
- msi_free( tv );
+ free( tv );
return ERROR_SUCCESS;
}
static UINT TABLE_add_ref(struct tagMSIVIEW *view)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
TRACE( "%p, %ld\n", view, tv->table->ref_count );
return InterlockedIncrement(&tv->table->ref_count);
static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
MSIRECORD *rec = NULL;
MSIVIEW *columns = NULL;
UINT row, r;
{
UINT size = tv->table->colinfo[number-1].offset;
tv->table->col_count--;
- tv->table->colinfo = msi_realloc( tv->table->colinfo, sizeof(*tv->table->colinfo) * tv->table->col_count );
+ tv->table->colinfo = realloc(tv->table->colinfo, sizeof(*tv->table->colinfo) * tv->table->col_count);
for (row = 0; row < tv->table->row_count; row++)
- tv->table->data[row] = msi_realloc( tv->table->data[row], size );
+ tv->table->data[row] = realloc(tv->table->data[row], size);
return ERROR_SUCCESS;
}
return r;
}
- r = msi_table_find_row((MSITABLEVIEW *)columns, rec, &row, NULL);
+ r = table_find_row((struct table_view *)columns, rec, &row, NULL);
if (r != ERROR_SUCCESS)
goto done;
if (r != ERROR_SUCCESS)
goto done;
- msi_update_table_columns(tv->db, tv->name);
+ update_table_columns(tv->db, tv->name);
done:
msiobj_release(&rec->hdr);
static UINT TABLE_release(struct tagMSIVIEW *view)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
INT ref = tv->table->ref_count;
UINT r;
INT i;
{
UINT i, r, table_id, col_id, size, offset;
BOOL temporary = type & MSITYPE_TEMPORARY;
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
- MSICOLUMNINFO *colinfo;
+ struct table_view *tv = (struct table_view *)view;
+ struct column_info *colinfo;
if (temporary && !hold && !tv->table->ref_count)
return ERROR_SUCCESS;
return ERROR_BAD_QUERY_SYNTAX;
}
- colinfo = msi_realloc(tv->table->colinfo, sizeof(*tv->table->colinfo) * (tv->table->col_count + 1));
+ colinfo = realloc(tv->table->colinfo, sizeof(*tv->table->colinfo) * (tv->table->col_count + 1));
if (!colinfo)
return ERROR_OUTOFMEMORY;
tv->table->colinfo = colinfo;
table_calc_column_offsets( tv->db, tv->table->colinfo, tv->table->col_count);
- size = msi_table_get_row_size( tv->db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES );
+ size = table_get_row_size( tv->db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES );
offset = tv->table->colinfo[tv->table->col_count - 1].offset;
for (i = 0; i < tv->table->row_count; i++)
{
- BYTE *data = msi_realloc( tv->table->data[i], size );
+ BYTE *data = realloc(tv->table->data[i], size);
if (!data)
{
tv->table->col_count--;
static UINT TABLE_drop(struct tagMSIVIEW *view)
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
MSIVIEW *tables = NULL;
MSIRECORD *rec = NULL;
UINT r, row;
return r;
}
- r = msi_table_find_row((MSITABLEVIEW *)tables, rec, &row, NULL);
+ r = table_find_row((struct table_view *)tables, rec, &row, NULL);
if (r != ERROR_SUCCESS)
goto done;
UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view )
{
- MSITABLEVIEW *tv ;
+ struct table_view *tv ;
UINT r, sz;
TRACE("%p %s %p\n", db, debugstr_w(name), view );
else if ( !wcscmp( name, L"_Storages" ) )
return STORAGES_CreateView( db, view );
- sz = FIELD_OFFSET( MSITABLEVIEW, name[lstrlenW( name ) + 1] );
- tv = msi_alloc_zero( sz );
+ sz = FIELD_OFFSET( struct table_view, name[lstrlenW( name ) + 1] );
+ tv = calloc( 1, sz );
if( !tv )
return ERROR_FUNCTION_FAILED;
r = get_table( db, name, &tv->table );
if( r != ERROR_SUCCESS )
{
- msi_free( tv );
+ free( tv );
WARN("table not found\n");
return r;
}
tv->db = db;
tv->columns = tv->table->colinfo;
tv->num_cols = tv->table->col_count;
- tv->row_size = msi_table_get_row_size( db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES );
+ tv->row_size = table_get_row_size( db, tv->table->colinfo, tv->table->col_count, LONG_STR_BYTES );
TRACE("%s one row is %d bytes\n", debugstr_w(name), tv->row_size );
return ERROR_SUCCESS;
}
-static WCHAR* create_key_string(MSITABLEVIEW *tv, MSIRECORD *rec)
+static WCHAR *create_key_string(struct table_view *tv, MSIRECORD *rec)
{
DWORD i, p, len, key_len = 0;
WCHAR *key;
key_len++;
}
- key = msi_alloc( key_len * sizeof(WCHAR) );
+ key = malloc( key_len * sizeof(WCHAR) );
if(!key)
return NULL;
return key;
}
-static UINT msi_record_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, LPWSTR name, DWORD *len )
+static UINT record_stream_name( const struct table_view *tv, MSIRECORD *rec, WCHAR *name, DWORD *len )
{
UINT p = 0, i, r;
DWORD l;
static UINT TransformView_fetch_int( MSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
if (!tv->table || col > tv->table->col_count)
{
static UINT TransformView_fetch_stream( MSIVIEW *view, UINT row, UINT col, IStream **stm )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
if (!tv->table || col > tv->table->col_count)
{
static const WCHAR query_pfx[] =
L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`, `Data`, `Current`) VALUES (1, '";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
WCHAR buf[256], *query;
MSIRECORD *old_rec;
MSIQUERY *q;
qlen += wcslen( tv->columns[i].colname ) + 3;
qlen += wcslen( key ) + 3;
if (MSITYPE_IS_BINARY( tv->columns[i].type ))
- r = msi_record_stream_name( tv, rec, NULL, &len );
+ r = record_stream_name( tv, rec, NULL, &len );
else
r = MSI_RecordGetStringW( rec, i + 1, NULL, &len );
if (r != ERROR_SUCCESS)
{
if (old_rec)
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return r;
}
qlen += len + 3;
if (old_rec && (r = MSI_RecordGetStringW( old_rec, i+1, NULL, &len )))
{
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return r;
}
qlen += len + 3; /* strlen("')") + 1 */
if (qlen > ARRAY_SIZE(buf))
{
- query = msi_alloc( qlen * sizeof(WCHAR) );
+ query = malloc( qlen * sizeof(WCHAR) );
if (!query)
{
if (old_rec)
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return ERROR_OUTOFMEMORY;
}
}
query[p++] = '\'';
len = qlen - p;
if (MSITYPE_IS_BINARY( tv->columns[i].type ))
- msi_record_stream_name( tv, rec, query + p, &len );
+ record_stream_name( tv, rec, query + p, &len );
else
MSI_RecordGetStringW( rec, i + 1, query + p, &len );
p += len;
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
{
if (old_rec)
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return r;
}
{
if (old_rec)
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return r;
}
}
if (old_rec)
msiobj_release( &old_rec->hdr );
- msi_free( key );
+ free( key );
return ERROR_SUCCESS;
}
-static UINT TransformView_create_table( MSITABLEVIEW *tv, MSIRECORD *rec )
+static UINT TransformView_create_table( struct table_view *tv, MSIRECORD *rec )
{
static const WCHAR query_fmt[] =
L"INSERT INTO `_TransformView` (`Table`, `Column`, `new`) VALUES ('%s', 'CREATE', 1)";
len = _snwprintf( NULL, 0, query_fmt, name ) + 1;
if (len > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
if (!query)
return ERROR_OUTOFMEMORY;
}
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
return r;
return r;
}
-static UINT TransformView_add_column( MSITABLEVIEW *tv, MSIRECORD *rec )
+static UINT TransformView_add_column( struct table_view *tv, MSIRECORD *rec )
{
static const WCHAR query_pfx[] =
L"INSERT INTO `_TransformView` (`new`, `Table`, `Current`, `Column`, `Data`) VALUES (1, '";
if (qlen > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
qlen = len;
if (!query)
return ERROR_OUTOFMEMORY;
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
return r;
static const WCHAR query_fmt[] =
L"INSERT INTO `_TransformView` (`new`, `Table`, `Column`, `Row`) VALUES (1, '%s', 'INSERT', '%s')";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
WCHAR buf[256], *query = buf;
MSIQUERY *q;
WCHAR *key;
len = _snwprintf( NULL, 0, query_fmt, tv->name, key ) + 1;
if (len > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
if (!query)
{
- msi_free( key );
+ free( key );
return ERROR_OUTOFMEMORY;
}
}
swprintf( query, len, query_fmt, tv->name, key );
- msi_free( key );
+ free( key );
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
return r;
return TransformView_set_row( view, row, rec, ~0 );
}
-static UINT TransformView_drop_table( MSITABLEVIEW *tv, UINT row )
+static UINT TransformView_drop_table( struct table_view *tv, UINT row )
{
static const WCHAR query_pfx[] = L"INSERT INTO `_TransformView` ( `new`, `Table`, `Column` ) VALUES ( 1, '";
static const WCHAR query_sfx[] = L"', 'DROP' )";
len = ARRAY_SIZE(query_pfx) - 1 + table_len + ARRAY_SIZE(query_sfx);
if (len > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
if (!query)
return ERROR_OUTOFMEMORY;
}
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
return r;
static const WCHAR query_column[] = L"', 'DELETE', '";
static const WCHAR query_sfx[] = L"')";
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
WCHAR *key, buf[256], *query = buf;
UINT r, len, name_len, key_len;
MSIRECORD *rec;
len = ARRAY_SIZE(query_pfx) + name_len + ARRAY_SIZE(query_column) + key_len + ARRAY_SIZE(query_sfx) - 2;
if (len > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
if (!query)
{
- msi_free( tv );
- msi_free( key );
+ free( tv );
+ free( key );
return ERROR_OUTOFMEMORY;
}
}
memcpy( query + len, key, key_len * sizeof(WCHAR) );
len += key_len;
memcpy( query + len, query_sfx, ARRAY_SIZE(query_sfx) * sizeof(WCHAR) );
- msi_free( key );
+ free( key );
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
return r;
static UINT TransformView_delete( MSIVIEW *view )
{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
+ struct table_view *tv = (struct table_view *)view;
if (!tv->table || tv->columns != tv->table->colinfo)
- msi_free( tv->columns );
+ free( tv->columns );
return TABLE_delete( view );
}
NULL
};
-UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIVIEW **view )
+static UINT TransformView_Create( MSIDATABASE *db, string_table *st, LPCWSTR name, MSIVIEW **view )
{
static const WCHAR query_pfx[] = L"SELECT `Column`, `Data`, `Current` FROM `_TransformView` WHERE `Table`='";
static const WCHAR query_sfx[] = L"' AND `Row` IS NULL AND `Current` IS NOT NULL AND `new` = 1";
WCHAR buf[256], *query = buf;
UINT r, len, name_len, size, add_col;
- MSICOLUMNINFO *colinfo;
- MSITABLEVIEW *tv;
+ struct column_info *colinfo;
+ struct table_view *tv;
MSIRECORD *rec;
MSIQUERY *q;
name_len = wcslen( name );
- r = TABLE_CreateView( db, name, view );
+ r = TABLE_CreateView( db, name, (MSIVIEW **)&tv );
if (r == ERROR_INVALID_PARAMETER)
{
/* table does not exist */
- size = FIELD_OFFSET( MSITABLEVIEW, name[name_len + 1] );
- tv = msi_alloc_zero( size );
+ size = FIELD_OFFSET( struct table_view, name[name_len + 1] );
+ tv = calloc( 1, size );
if (!tv)
return ERROR_OUTOFMEMORY;
tv->db = db;
memcpy( tv->name, name, name_len * sizeof(WCHAR) );
- *view = (MSIVIEW*)tv;
}
else if (r != ERROR_SUCCESS)
{
return r;
}
- else
- {
- tv = (MSITABLEVIEW*)*view;
- }
tv->view.ops = &transform_view_ops;
len = ARRAY_SIZE(query_pfx) + name_len + ARRAY_SIZE(query_sfx) - 1;
if (len > ARRAY_SIZE(buf))
{
- query = msi_alloc( len * sizeof(WCHAR) );
+ query = malloc( len * sizeof(WCHAR) );
if (!query)
{
- msi_free( tv );
+ free( tv );
return ERROR_OUTOFMEMORY;
}
}
r = MSI_DatabaseOpenViewW( tv->db, query, &q );
if (query != buf)
- msi_free( query );
+ free( query );
if (r != ERROR_SUCCESS)
{
- msi_free( tv );
+ free( tv );
return r;
}
r = MSI_ViewExecute( q, NULL );
if (r != ERROR_SUCCESS)
{
- msi_free( tv );
+ free( tv );
return r;
}
{
MSI_ViewClose( q );
msiobj_release( &q->hdr );
- msi_free( tv );
+ free( tv );
return r;
}
if (!add_col)
{
MSI_ViewClose( q );
msiobj_release( &q->hdr );
+ *view = (MSIVIEW *)tv;
return ERROR_SUCCESS;
}
- colinfo = msi_alloc_zero( (add_col + tv->num_cols) * sizeof(*colinfo) );
+ colinfo = calloc( add_col + tv->num_cols, sizeof(*colinfo) );
if (!colinfo)
{
MSI_ViewClose( q );
msiobj_release( &q->hdr );
- msi_free( tv );
- return r;
+ free( tv );
+ return ERROR_OUTOFMEMORY;
}
while (MSI_ViewFetch( q, &rec ) == ERROR_SUCCESS)
memcpy( colinfo, tv->columns, tv->num_cols * sizeof(*colinfo) );
tv->columns = colinfo;
tv->num_cols += add_col;
+ *view = (MSIVIEW *)tv;
return ERROR_SUCCESS;
}
return ret;
}
-static UINT msi_record_encoded_stream_name( const MSITABLEVIEW *tv, MSIRECORD *rec, LPWSTR *pstname )
+static UINT record_encoded_stream_name( const struct table_view *tv, MSIRECORD *rec, WCHAR **pstname )
{
UINT r;
DWORD len;
TRACE("%p %p\n", tv, rec);
- r = msi_record_stream_name( tv, rec, NULL, &len );
+ r = record_stream_name( tv, rec, NULL, &len );
if (r != ERROR_SUCCESS)
return r;
len++;
- name = msi_alloc( len * sizeof(WCHAR) );
+ name = malloc( len * sizeof(WCHAR) );
if (!name)
return ERROR_OUTOFMEMORY;
- r = msi_record_stream_name( tv, rec, name, &len );
+ r = record_stream_name( tv, rec, name, &len );
if (r != ERROR_SUCCESS)
{
- msi_free( name );
+ free( name );
return r;
}
*pstname = encode_streamname( FALSE, name );
- msi_free( name );
+ free( name );
return ERROR_SUCCESS;
}
-static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st,
- IStorage *stg, const BYTE *rawdata, UINT bytes_per_strref )
+static MSIRECORD *get_transform_record( const struct table_view *tv, const string_table *st, IStorage *stg,
+ const BYTE *rawdata, UINT bytes_per_strref )
{
UINT i, val, ofs = 0;
USHORT mask;
- MSICOLUMNINFO *columns = tv->columns;
+ struct column_info *columns = tv->columns;
MSIRECORD *rec;
mask = rawdata[0] | (rawdata[1] << 8);
ofs += bytes_per_column( tv->db, &columns[i], bytes_per_strref );
- r = msi_record_encoded_stream_name( tv, rec, &encname );
+ r = record_encoded_stream_name( tv, rec, &encname );
if ( r != ERROR_SUCCESS )
{
msiobj_release( &rec->hdr );
if ( r != ERROR_SUCCESS )
{
msiobj_release( &rec->hdr );
- msi_free( encname );
+ free( encname );
return NULL;
}
MSI_RecordSetStream( rec, i+1, stm );
TRACE(" field %d [%s]\n", i+1, debugstr_w(encname));
- msi_free( encname );
+ free( encname );
}
else if( columns[i].type & MSITYPE_STRING )
{
}
}
-static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec )
+static UINT *record_to_row( const struct table_view *tv, MSIRECORD *rec )
{
UINT i, r, *data;
- data = msi_alloc( tv->num_cols *sizeof (UINT) );
+ data = malloc( tv->num_cols * sizeof (UINT) );
for( i=0; i<tv->num_cols; i++ )
{
data[i] = 0;
these keys can't match any record, so fail now. */
if (r != ERROR_SUCCESS)
{
- msi_free( data );
+ free( data );
return NULL;
}
}
{
if (int_to_table_storage( tv, i + 1, MSI_RecordGetInteger( rec, i + 1 ), &data[i] ))
{
- msi_free( data );
+ free( data );
return NULL;
}
}
return data;
}
-static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data, UINT *column )
+static UINT row_matches( struct table_view *tv, UINT row, const UINT *data, UINT *column )
{
UINT i, r, x, ret = ERROR_FUNCTION_FAILED;
return ret;
}
-static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row, UINT *column )
+static UINT table_find_row( struct table_view *tv, MSIRECORD *rec, UINT *row, UINT *column )
{
UINT i, r = ERROR_FUNCTION_FAILED, *data;
- data = msi_record_to_row( tv, rec );
+ data = record_to_row( tv, rec );
if( !data )
return r;
for( i = 0; i < tv->table->row_count; i++ )
{
- r = msi_row_matches( tv, i, data, column );
+ r = row_matches( tv, i, data, column );
if( r == ERROR_SUCCESS )
{
*row = i;
break;
}
}
- msi_free( data );
+ free( data );
return r;
}
-typedef struct
+struct transform_data
{
struct list entry;
LPWSTR name;
-} TRANSFORMDATA;
+};
-static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
- string_table *st, TRANSFORMDATA *transform,
- UINT bytes_per_strref, int err_cond )
+static UINT table_load_transform( MSIDATABASE *db, IStorage *stg, string_table *st, struct transform_data *transform,
+ UINT bytes_per_strref, int err_cond )
{
BYTE *rawdata = NULL;
- MSITABLEVIEW *tv = NULL;
+ struct table_view *tv = NULL;
UINT r, n, sz, i, mask, num_cols, colcol = 0, rawsize = 0;
MSIRECORD *rec = NULL;
WCHAR coltable[32];
break;
}
- rec = msi_get_transform_record( tv, st, stg, &rawdata[n], bytes_per_strref );
+ rec = get_transform_record( tv, st, stg, &rawdata[n], bytes_per_strref );
if (rec)
{
WCHAR table[32];
if (TRACE_ON(msidb)) dump_record( rec );
if (tv->table)
- r = msi_table_find_row( tv, rec, &row, NULL );
+ r = table_find_row( tv, rec, &row, NULL );
else
r = ERROR_FUNCTION_FAILED;
if (r == ERROR_SUCCESS)
WARN("failed to insert row %u\n", r);
}
- if (!(err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM) &&
- !wcscmp( name, L"_Columns" ))
- msi_update_table_columns( db, table );
+ if (!(err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM) && !wcscmp( name, L"_Columns" ))
+ update_table_columns( db, table );
msiobj_release( &rec->hdr );
}
err:
/* no need to free the table, it's associated with the database */
- msi_free( rawdata );
+ free( rawdata );
if( tv )
tv->view.ops->delete( &tv->view );
{
struct list transforms;
IEnumSTATSTG *stgenum = NULL;
- TRANSFORMDATA *transform;
- TRANSFORMDATA *tables = NULL, *columns = NULL;
+ struct transform_data *transform;
+ struct transform_data *tables = NULL, *columns = NULL;
HRESULT hr;
STATSTG stat;
string_table *strings;
while ( TRUE )
{
- MSITABLEVIEW *tv = NULL;
+ struct table_view *tv = NULL;
WCHAR name[0x40];
ULONG count = 0;
!wcscmp( name+1, L"_StringData" ) )
continue;
- transform = msi_alloc_zero( sizeof(TRANSFORMDATA) );
+ transform = calloc( 1, sizeof(*transform) );
if ( !transform )
break;
list_add_tail( &transforms, &transform->entry );
- transform->name = strdupW( name + 1 );
+ transform->name = wcsdup( name + 1 );
if ( !wcscmp( transform->name, L"_Tables" ) )
tables = transform;
* Apply _Tables and _Columns transforms first so that
* the table metadata is correct, and empty tables exist.
*/
- ret = msi_table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond );
+ ret = table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond );
if (ret != ERROR_SUCCESS && ret != ERROR_INVALID_TABLE)
goto end;
- ret = msi_table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond );
+ ret = table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond );
if (ret != ERROR_SUCCESS && ret != ERROR_INVALID_TABLE)
goto end;
while ( !list_empty( &transforms ) )
{
- transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry );
+ transform = LIST_ENTRY( list_head( &transforms ), struct transform_data, entry );
if ( wcscmp( transform->name, L"_Columns" ) &&
wcscmp( transform->name, L"_Tables" ) &&
ret == ERROR_SUCCESS )
{
- ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
+ ret = table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
}
list_remove( &transform->entry );
- msi_free( transform->name );
- msi_free( transform );
+ free( transform->name );
+ free( transform );
}
if ( ret == ERROR_SUCCESS )
msi_destroy_stringtable( strings );
if (transform_view)
{
- struct tagMSITABLE *table = ((MSITABLEVIEW*)transform_view)->table;
+ struct tagMSITABLE *table = ((struct table_view *)transform_view)->table;
if (ret != ERROR_SUCCESS)
transform_view->ops->release( transform_view );
** All the keywords of the SQL language are stored as in a hash
** table composed of instances of the following structure.
*/
-typedef struct Keyword Keyword;
-struct Keyword {
+struct keyword
+{
const WCHAR *name; /* The keyword name */
unsigned int len;
int tokenType; /* The token value for this keyword */
** They MUST be in alphabetical order
*/
#define X(str) str, ARRAY_SIZE(str) - 1
-static const Keyword aKeywordTable[] = {
+static const struct keyword aKeywordTable[] = {
{ X(L"ADD"), TK_ADD },
{ X(L"ALTER"), TK_ALTER },
{ X(L"AND"), TK_AND },
** Comparison function for binary search.
*/
static int __cdecl compKeyword(const void *m1, const void *m2){
- const Keyword *k1 = m1, *k2 = m2;
+ const struct keyword *k1 = m1, *k2 = m2;
int ret, len = min( k1->len, k2->len );
if ((ret = wcsnicmp( k1->name, k2->name, len ))) return ret;
** returned. If the input is not a keyword, TK_ID is returned.
*/
static int sqliteKeywordCode(const WCHAR *z, int n){
- Keyword key, *r;
+ struct keyword key, *r;
if( n>MAX_TOKEN_LEN )
return TK_ID;
key.tokenType = 0;
key.name = z;
key.len = n;
- r = bsearch( &key, aKeywordTable, ARRAY_SIZE(aKeywordTable), sizeof(Keyword), compKeyword );
+ r = bsearch( &key, aKeywordTable, ARRAY_SIZE(aKeywordTable), sizeof(struct keyword), compKeyword );
if( r )
return r->tokenType;
return TK_ID;
/* below is the query interface to a table */
-typedef struct tagMSIUPDATEVIEW
+struct update_view
{
MSIVIEW view;
MSIDATABASE *db;
MSIVIEW *wv;
column_info *vals;
-} MSIUPDATEVIEW;
+};
static UINT UPDATE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
TRACE("%p %d %d %p\n", uv, row, col, val );
static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
UINT i, r, col_count = 0, row_count = 0;
MSIRECORD *values = NULL;
MSIRECORD *where = NULL;
static UINT UPDATE_close( struct tagMSIVIEW *view )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv;
TRACE("%p\n", uv);
static UINT UPDATE_get_dimensions( struct tagMSIVIEW *view, UINT *rows, UINT *cols )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv;
TRACE("%p %p %p\n", uv, rows, cols );
static UINT UPDATE_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *name,
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv;
TRACE("%p %d %p %p %p %p\n", uv, n, name, type, temporary, table_name );
static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
MSIRECORD *rec, UINT row )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
TRACE("%p %d %p\n", uv, eModifyMode, rec );
static UINT UPDATE_delete( struct tagMSIVIEW *view )
{
- MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
+ struct update_view *uv = (struct update_view *)view;
MSIVIEW *wv;
TRACE("%p\n", uv );
if( wv )
wv->ops->delete( wv );
msiobj_release( &uv->db->hdr );
- msi_free( uv );
+ free( uv );
return ERROR_SUCCESS;
}
UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
column_info *columns, struct expr *expr )
{
- MSIUPDATEVIEW *uv = NULL;
+ struct update_view *uv = NULL;
UINT r;
MSIVIEW *sv = NULL, *wv = NULL;
return r;
}
- uv = msi_alloc_zero( sizeof *uv );
+ uv = calloc( 1, sizeof *uv );
if( !uv )
{
wv->ops->delete( wv );
if (find_product( prop, product ))
{
TRACE( "related product property %s already contains %s\n", debugstr_w(action_prop), debugstr_w(product) );
- msi_free( prop );
+ free( prop );
return;
}
if (prop) len += lstrlenW( prop );
len += lstrlenW( product ) + 2;
- if (!(newprop = msi_alloc( len * sizeof(WCHAR) ))) return;
+ if (!(newprop = malloc( len * sizeof(WCHAR) ))) return;
if (prop)
{
lstrcpyW( newprop, prop );
TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) );
- msi_free( prop );
- msi_free( newprop );
+ free( prop );
+ free( newprop );
}
static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
/* below is the query interface to a table */
-typedef struct tagMSIROWENTRY
+struct row_entry
{
struct tagMSIWHEREVIEW *wv; /* used during sorting */
UINT values[1];
-} MSIROWENTRY;
+};
-typedef struct tagJOINTABLE
+struct join_table
{
- struct tagJOINTABLE *next;
+ struct join_table *next;
MSIVIEW *view;
UINT col_count;
UINT row_count;
UINT table_index;
-} JOINTABLE;
+};
typedef struct tagMSIORDERINFO
{
{
MSIVIEW view;
MSIDATABASE *db;
- JOINTABLE *tables;
+ struct join_table *tables;
UINT row_count;
UINT col_count;
UINT table_count;
- MSIROWENTRY **reorder;
+ struct row_entry **reorder;
UINT reorder_size; /* number of entries available in reorder */
struct expr *cond;
UINT rec_index;
return;
for (i = 0; i < wv->row_count; i++)
- msi_free(wv->reorder[i]);
+ free(wv->reorder[i]);
- msi_free( wv->reorder );
+ free(wv->reorder);
wv->reorder = NULL;
wv->reorder_size = 0;
wv->row_count = 0;
static UINT init_reorder(MSIWHEREVIEW *wv)
{
- MSIROWENTRY **new = msi_alloc_zero(sizeof(MSIROWENTRY *) * INITIAL_REORDER_SIZE);
+ struct row_entry **new = calloc(INITIAL_REORDER_SIZE, sizeof(*new));
if (!new)
return ERROR_OUTOFMEMORY;
static UINT add_row(MSIWHEREVIEW *wv, UINT vals[])
{
- MSIROWENTRY *new;
+ struct row_entry *new;
if (wv->reorder_size <= wv->row_count)
{
- MSIROWENTRY **new_reorder;
+ struct row_entry **new_reorder;
UINT newsize = wv->reorder_size * 2;
- new_reorder = msi_realloc(wv->reorder, newsize * sizeof(*new_reorder));
+ new_reorder = realloc(wv->reorder, newsize * sizeof(*new_reorder));
if (!new_reorder)
return ERROR_OUTOFMEMORY;
memset(new_reorder + wv->reorder_size, 0, (newsize - wv->reorder_size) * sizeof(*new_reorder));
wv->reorder_size = newsize;
}
- new = msi_alloc(FIELD_OFFSET( MSIROWENTRY, values[wv->table_count] ));
+ new = malloc(offsetof(struct row_entry, values[wv->table_count]));
if (!new)
return ERROR_OUTOFMEMORY;
return ERROR_SUCCESS;
}
-static JOINTABLE *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col)
+static struct join_table *find_table(MSIWHEREVIEW *wv, UINT col, UINT *table_col)
{
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
if(col == 0 || col > wv->col_count)
return NULL;
static UINT parse_column(MSIWHEREVIEW *wv, union ext_column *column,
UINT *column_type)
{
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
UINT i, r;
do
static UINT WHERE_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
UINT *rows;
UINT r;
static UINT WHERE_fetch_stream( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
UINT *rows;
UINT r;
static UINT WHERE_set_int(struct tagMSIVIEW *view, UINT row, UINT col, int val)
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
UINT *rows;
UINT r;
static UINT WHERE_set_string(struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len)
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
UINT *rows;
UINT r;
static UINT WHERE_set_stream(MSIVIEW *view, UINT row, UINT col, IStream *stream)
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
UINT *rows;
UINT r;
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
UINT i, r, offset = 0;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
UINT *rows;
UINT mask_copy = mask;
static inline UINT expr_fetch_value(const union ext_column *expr, const UINT rows[], UINT *val)
{
- JOINTABLE *table = expr->parsed.table;
+ struct join_table *table = expr->parsed.table;
if( rows[table->table_index] == INVALID_ROW_INDEX )
{
return ERROR_SUCCESS;
}
-static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, JOINTABLE **tables,
+static UINT check_condition( MSIWHEREVIEW *wv, MSIRECORD *record, struct join_table **tables,
UINT table_rows[] )
{
UINT r = ERROR_FUNCTION_FAILED;
static int __cdecl compare_entry( const void *left, const void *right )
{
- const MSIROWENTRY *le = *(const MSIROWENTRY**)left;
- const MSIROWENTRY *re = *(const MSIROWENTRY**)right;
+ const struct row_entry *le = *(const struct row_entry **)left;
+ const struct row_entry *re = *(const struct row_entry **)right;
const MSIWHEREVIEW *wv = le->wv;
MSIORDERINFO *order = wv->order_info;
UINT i, j, r, l_val, r_val;
return 0;
}
-static void add_to_array( JOINTABLE **array, JOINTABLE *elem )
+static void add_to_array( struct join_table **array, struct join_table *elem )
{
while (*array && *array != elem)
array++;
*array = elem;
}
-static BOOL in_array( JOINTABLE **array, JOINTABLE *elem )
+static BOOL in_array( struct join_table **array, struct join_table *elem )
{
while (*array && *array != elem)
array++;
#define JOIN_TO_CONST_EXPR 0x10000 /* comparison to a table involved with
a CONST_EXPR comaprison */
-static UINT reorder_check( const struct expr *expr, JOINTABLE **ordered_tables,
- BOOL process_joins, JOINTABLE **lastused )
+static UINT reorder_check( const struct expr *expr, struct join_table **ordered_tables,
+ BOOL process_joins, struct join_table **lastused )
{
UINT res = 0;
}
/* reorders the tablelist in a way to evaluate the condition as fast as possible */
-static JOINTABLE **ordertables( MSIWHEREVIEW *wv )
+static struct join_table **ordertables( MSIWHEREVIEW *wv )
{
- JOINTABLE *table;
- JOINTABLE **tables;
+ struct join_table *table, **tables;
- tables = msi_alloc_zero( (wv->table_count + 1) * sizeof(*tables) );
+ tables = calloc(wv->table_count + 1, sizeof(*tables));
if (wv->cond)
{
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
UINT r;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
UINT *rows;
- JOINTABLE **ordered_tables;
+ struct join_table **ordered_tables;
UINT i = 0;
TRACE("%p %p\n", wv, record);
ordered_tables = ordertables( wv );
- rows = msi_alloc( wv->table_count * sizeof(*rows) );
+ rows = malloc(wv->table_count * sizeof(*rows));
for (i = 0; i < wv->table_count; i++)
rows[i] = INVALID_ROW_INDEX;
if (wv->order_info)
wv->order_info->error = ERROR_SUCCESS;
- qsort(wv->reorder, wv->row_count, sizeof(MSIROWENTRY *), compare_entry);
+ qsort(wv->reorder, wv->row_count, sizeof(struct row_entry *), compare_entry);
if (wv->order_info)
r = wv->order_info->error;
- msi_free( rows );
- msi_free( ordered_tables );
+ free(rows);
+ free(ordered_tables);
return r;
}
static UINT WHERE_close( struct tagMSIVIEW *view )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
TRACE("%p\n", wv );
UINT *type, BOOL *temporary, LPCWSTR *table_name )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table;
+ struct join_table *table;
TRACE("%p %d %p %p %p %p\n", wv, n, name, type, temporary, table_name );
MSIRECORD *rec, UINT row )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
UINT r;
TRACE("%p %d %p\n", wv, eModifyMode, rec);
static UINT WHERE_delete( struct tagMSIVIEW *view )
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
TRACE("%p\n", wv );
while(table)
{
- JOINTABLE *next;
+ struct join_table *next;
table->view->ops->delete(table->view);
table->view = NULL;
next = table->next;
- msi_free(table);
+ free(table);
table = next;
}
wv->tables = NULL;
free_reorder(wv);
- msi_free(wv->order_info);
+ free(wv->order_info);
wv->order_info = NULL;
msiobj_release( &wv->db->hdr );
- msi_free( wv );
+ free(wv);
return ERROR_SUCCESS;
}
static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns)
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view;
- JOINTABLE *table = wv->tables;
+ struct join_table *table = wv->tables;
column_info *column = columns;
MSIORDERINFO *orderinfo;
UINT r, count = 0;
if (count == 0)
return ERROR_SUCCESS;
- orderinfo = msi_alloc(FIELD_OFFSET(MSIORDERINFO, columns[count]));
+ orderinfo = malloc(offsetof(MSIORDERINFO, columns[count]));
if (!orderinfo)
return ERROR_OUTOFMEMORY;
return ERROR_SUCCESS;
error:
- msi_free(orderinfo);
+ free(orderinfo);
return r;
}
TRACE("(%s)\n", debugstr_w(tables) );
- wv = msi_alloc_zero( sizeof *wv );
+ wv = calloc(1, sizeof *wv);
if( !wv )
return ERROR_FUNCTION_FAILED;
while (*tables)
{
- JOINTABLE *table;
+ struct join_table *table;
if ((ptr = wcschr(tables, ' ')))
*ptr = '\0';
- table = msi_alloc(sizeof(JOINTABLE));
+ table = malloc(sizeof(*table));
if (!table)
{
r = ERROR_OUTOFMEMORY;
if (r != ERROR_SUCCESS)
{
WARN("can't create table: %s\n", debugstr_w(tables));
- msi_free(table);
+ free(table);
r = ERROR_BAD_QUERY_SYNTAX;
goto end;
}
{
ERR("can't get table dimensions\n");
table->view->ops->delete(table->view);
- msi_free(table);
+ free(table);
goto end;
}
dll/win32/msgsm32.acm # Synced to WineStaging-4.0
dll/win32/mshtml # Synced to WineStaging-1.7.55
dll/win32/mshtml.tlb # Synced to WineStaging-1.7.55
-dll/win32/msi # Synced to WineStaging-7.3 (+ dialog.c synced to bbce5d014db7f023b133d6d09e6846e027586f7d)
+dll/win32/msi # Synced to Wine-9.8
dll/win32/msimg32 # Synced to WineStaging-3.3
dll/win32/msimtf # Synced to WineStaging-4.18
dll/win32/msisip # Synced to WineStaging-4.18
base/applications/write # Synced to WineStaging-3.3
base/services/rpcss # Synced to WineStaging-3.3
base/system/expand # Synced to WineStaging-3.3
-base/system/msiexec # Synced to WineStaging-3.3
+base/system/msiexec # Synced to Wine-9.8
modules/rosapps/applications/winfile # Autosync
In addition the following libs, dlls and source files are mostly based on code ported
#include <msidefs.h>
#include <msi.h>
#include <fci.h>
-#include <srrestoreptapi.h>
#include <wtypes.h>
#include <shellapi.h>
#include <winsvc.h>
#include "utils.h"
#include "typelib.h"
-static UINT (WINAPI *pMsiQueryComponentStateA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
-static UINT (WINAPI *pMsiSourceListEnumSourcesA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiSourceListGetInfoA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
-static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
- (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiQueryFeatureStateExA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
-
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-
-static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
-static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
-
static BOOL is_wow64;
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
/* make the max size large so there is only one cab file */
#define MEDIA_SIZE 0x7FFFFFFF
-static void init_functionpointers(void)
-{
- HMODULE hmsi = GetModuleHandleA("msi.dll");
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hsrclient = LoadLibraryA("srclient.dll");
-
-#define GET_PROC(mod, func) \
- p ## func = (void*)GetProcAddress(mod, #func); \
- if(!p ## func) \
- trace("GetProcAddress(%s) failed\n", #func);
-
- GET_PROC(hmsi, MsiQueryComponentStateA);
- GET_PROC(hmsi, MsiSourceListEnumSourcesA);
- GET_PROC(hmsi, MsiSourceListGetInfoA);
- GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hmsi, MsiQueryFeatureStateExA);
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hkernel32, IsWow64Process)
-
- GET_PROC(hsrclient, SRRemoveRestorePoint);
- GET_PROC(hsrclient, SRSetRestorePointA);
-
-#undef GET_PROC
-}
-
static char *get_user_sid(void)
{
HANDLE token;
RemoveDirectoryA("msitest");
}
-static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
-{
- RESTOREPOINTINFOA spec;
-
- spec.dwEventType = event_type;
- spec.dwRestorePtType = APPLICATION_INSTALL;
- spec.llSequenceNumber = status->llSequenceNumber;
- lstrcpyA(spec.szDescription, "msitest restore point");
-
- return pSRSetRestorePointA(&spec, status);
-}
-
-static void remove_restore_point(DWORD seq_number)
-{
- DWORD res;
-
- res = pSRRemoveRestorePoint(seq_number);
- if (res != ERROR_SUCCESS)
- trace("Failed to remove the restore point : %#lx\n", res);
-}
-
-static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
-
static void delete_pfmsitest_files(void)
{
SHFILEOPSTRUCTA shfl;
static const CHAR userugkey[] = "Software\\Microsoft\\Installer\\UpgradeCodes"
"\\51AAE0C44620A5E4788506E91F249BD2";
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
BOOL old_installer = FALSE;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
if (!res)
CHECK_DEL_REG_STR(patches, "AllPatches", "");
- delete_key(patches, "", access);
+ RegDeleteKeyExA(patches, "", access, 0);
RegCloseKey(patches);
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
currentuser:
if (!res)
CHECK_DEL_REG_STR(patches, "AllPatches", "");
- delete_key(patches, "", access);
+ RegDeleteKeyExA(patches, "", access, 0);
RegCloseKey(patches);
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
machprod:
CHECK_DEL_REG_STR(net, "1", temp);
- res = delete_key(net, "", access);
+ res = RegDeleteKeyExA(net, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(net);
CHECK_DEL_REG_STR(media, "1", "DISK1;");
- res = delete_key(media, "", access);
+ res = RegDeleteKeyExA(media, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(media);
- res = delete_key(sourcelist, "", access);
+ res = RegDeleteKeyExA(sourcelist, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(sourcelist);
- res = delete_key(hkey, "", access);
+ res = RegDeleteKeyExA(hkey, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
- res = delete_key(hkey, "", access);
+ res = RegDeleteKeyExA(hkey, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
CHAR keypath[MAX_PATH];
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udfeatpath, usersid);
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udpridpath, usersid);
- delete_key(HKEY_LOCAL_MACHINE, keypath, access);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
/* PublishFeatures, machine */
r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udfeatpath, "S-1-5-18");
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
- delete_key(hkey, "", access);
+ RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udpridpath, "S-1-5-18");
- delete_key(HKEY_LOCAL_MACHINE, keypath, access);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
error:
DeleteFileA(msifile);
"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\"
"UserData\\%s\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
- delete_key(props, "", access);
+ RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
sprintf(keypath, keypridfmt, usersid);
- delete_key(HKEY_LOCAL_MACHINE, keypath, access);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
/* RegisterUser, machine */
r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
- delete_key(props, "", access);
+ RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
sprintf(keypath, keypridfmt, "S-1-5-18");
- delete_key(HKEY_LOCAL_MACHINE, keypath, access);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
error:
free(company);
CHAR program_files_maximus[MAX_PATH];
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
- delete_key(comp, "", access);
+ RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
- delete_key(comp, "", access);
+ RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
/* ProcessComponents, machine */
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
- delete_key(comp, "", access);
+ RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
- delete_key(comp, "", access);
+ RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
error:
LONG res;
HKEY uninstall, prodkey, uninstall_32node = NULL;
INSTALLSTATE state;
- char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
+ char date[MAX_PATH], date2[MAX_PATH], temp[MAX_PATH], buf[MAX_PATH];
+ const char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
REGSAM access = KEY_ALL_ACCESS;
- DWORD error;
+ DWORD error, type, size;
- if (!pMsiQueryFeatureStateExA)
- {
- win_skip("MsiQueryFeatureStateExA is not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
state = 0xdead;
SetLastError(0xdeadbeef);
- r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
+ r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
CHECK_REG_STR(prodkey, "DisplayName", "MSITEST");
CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1");
- CHECK_REG_STR(prodkey, "InstallDate", date);
+
+ get_date_str(date2);
+ size = ARRAY_SIZE(buf);
+ buf[0] = '\0';
+ res = RegQueryValueExA(prodkey, "InstallDate", NULL, &type, (BYTE *)buf, &size);
+ ok(!res, "Failed to query value, error %ld\n", res);
+ ok(type == REG_SZ, "Got wrong type %lu\n", type);
+ ok(!strcmp(buf, date) || !strcmp(buf, date2), "got %s\n", debugstr_a(buf));
+
CHECK_REG_STR(prodkey, "InstallSource", temp);
CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}");
CHECK_REG_STR(prodkey, "Publisher", "Wine");
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
CHAR path[MAX_PATH];
CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
- if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
- {
- win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
/* nothing published */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
/* after RegisterProduct */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
/* after ProcessComponents */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
/* after PublishFeatures */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
/* after PublishProduct */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
ok(size == 11, "Expected 11, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
char props[4 * MAX_PATH + 74];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
LONG res;
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HKEY env, env2;
LONG res;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
SC_HANDLE manager, service;
DWORD error;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HKEY hKey;
DWORD err_control, err_controlsize, err_controltype;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HKEY key;
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
WORD len;
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HRESULT hr;
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
BYTE *data;
DWORD size;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
"english.txt", INSTALLMODE_DEFAULT, NULL, &size);
ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
- if (pRegDeleteKeyExA)
- res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
- else
- res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2);
+ res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
ok(res == ERROR_SUCCESS, "RegDeleteKey failed %ld\n", res);
res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key);
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HANDLE file;
BOOL ret;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
LONG res;
HKEY hkey;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
LONG res;
HKEY hkey;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
LONG res;
HKEY hkey;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
LONG res;
HKEY hkey;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
const char *path;
int access;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
DeleteFileA(msifile);
}
+static HANDLE get_admin_token(void)
+{
+ TOKEN_ELEVATION_TYPE type;
+ TOKEN_LINKED_TOKEN linked;
+ DWORD size;
+
+#ifdef __REACTOS__
+#ifndef GetCurrentThreadEffectiveToken
+#define GetCurrentProcessToken() ((HANDLE)~(ULONG_PTR)3)
+#define GetCurrentThreadEffectiveToken() GetCurrentProcessToken()
+#endif
+#endif
+
+ if (!GetTokenInformation(GetCurrentThreadEffectiveToken(), TokenElevationType, &type, sizeof(type), &size)
+ || type == TokenElevationTypeFull)
+ return NULL;
+
+ if (!GetTokenInformation(GetCurrentThreadEffectiveToken(), TokenLinkedToken, &linked, sizeof(linked), &size))
+ return NULL;
+ return linked.LinkedToken;
+}
+
+void restart_as_admin_elevated(void)
+{
+ HANDLE token;
+ PROCESS_INFORMATION pi;
+ STARTUPINFOW si;
+
+ if (!(token = get_admin_token())) return;
+
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
+ if (CreateProcessAsUserW(token, NULL, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
+ {
+ DWORD exit_code;
+
+ trace("restarting\n");
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ GetExitCodeProcess(pi.hProcess, &exit_code);
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ ExitProcess(exit_code);
+ }
+ else trace("failed to restart as admin %lu\n", GetLastError());
+
+ CloseHandle(token);
+}
+
START_TEST(action)
{
DWORD len;
char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
- STATEMGRSTATUS status;
- BOOL ret = FALSE;
- init_functionpointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
+
subtest("custom");
- if (pIsWow64Process)
- pIsWow64Process(GetCurrentProcess(), &is_wow64);
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
ok(get_system_dirs(), "failed to retrieve system dirs\n");
ok(get_user_dirs(), "failed to retrieve user dirs\n");
- /* Create a restore point ourselves so we circumvent the multitude of restore points
- * that would have been created by all the installation and removal tests.
- *
- * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
- * creation of restore points.
- */
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
- {
- memset(&status, 0, sizeof(status));
- ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
- }
-
/* Create only one log file and don't append. We have to pass something
* for the log mode for this to work. The logfile needs to have an absolute
* path otherwise we still end up with some extra logfiles as some tests
test_remove_existing_products();
DeleteFileA(log_file);
-
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
- {
- ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
- if (ret)
- remove_restore_point(status.llSequenceNumber);
- }
-
SetCurrentDirectoryA(prev_path);
}
#include <oaidl.h>
#include "wine/test.h"
+#include "utils.h"
#ifdef __REACTOS__
#include "ole2.h"
static BOOL is_wow64;
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
static const char *msifile = "winetest-automation.msi";
static FILETIME systemtime;
-static CHAR CURR_DIR[MAX_PATH];
static EXCEPINFO excepinfo;
/*
"regdata\t1\tSOFTWARE\\Wine\\msitest\tblah\tbad\tdangler\n"
"OrderTest\t1\tSOFTWARE\\Wine\\msitest\tOrderTestName\tOrderTestValue\tcomponent\n";
-typedef struct _msi_table
-{
- const CHAR *filename;
- const CHAR *data;
- int size;
-} msi_table;
-
#define ADD_TABLE(x) {#x".idt", x##_dat, sizeof(x##_dat)}
static const msi_table tables[] =
ADD_INFO_FILETIME(PID_LASTPRINTED, &systemtime)
};
-static void init_functionpointers(void)
-{
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
-
-#define GET_PROC(dll, func) \
- p ## func = (void *)GetProcAddress(dll, #func); \
- if(!p ## func) \
- trace("GetProcAddress(%s) failed\n", #func);
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hkernel32, IsWow64Process)
-
-#undef GET_PROC
-}
-
-static BOOL is_process_limited(void)
-{
- SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
- PSID Group = NULL;
- BOOL IsInGroup;
- HANDLE token;
-
- if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
- DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
- !CheckTokenMembership(NULL, Group, &IsInGroup))
- {
- trace("Could not check if the current user is an administrator\n");
- FreeSid(Group);
- return FALSE;
- }
- FreeSid(Group);
-
- if (!IsInGroup)
- {
- /* Only administrators have enough privileges for these tests */
- return TRUE;
- }
-
- if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
- {
- BOOL ret;
- TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
- DWORD size;
-
- ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
- CloseHandle(token);
- return (ret && type == TokenElevationTypeLimited);
- }
- return FALSE;
-}
-
-static LONG delete_key_portable( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
-
/*
* Database Helpers
*/
MsiCloseHandle(summary);
}
-static void create_database(const CHAR *name, const msi_table *tables, int num_tables,
- const msi_summary_info *info, int num_info)
+static void create_database_suminfo(const CHAR *name, const msi_table *tables, int num_tables,
+ const msi_summary_info *info, int num_info)
{
MSIHANDLE db;
UINT r;
DWORD len;
/* Prepare package */
- create_database(msifile, tables, ARRAY_SIZE(tables), summary_info, ARRAY_SIZE(summary_info));
+ create_database_suminfo(msifile, tables, ARRAY_SIZE(tables), summary_info, ARRAY_SIZE(summary_info));
len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
CURR_DIR, -1, path, MAX_PATH);
* Installation helpers
*/
-static char PROG_FILES_DIR[MAX_PATH];
-
static BOOL get_program_files_dir(LPSTR buf)
{
HKEY hkey;
return TRUE;
}
-static void create_file(const CHAR *name, DWORD size)
-{
- HANDLE file;
- DWORD written, left;
-
- file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
- WriteFile(file, name, strlen(name), &written, NULL);
- WriteFile(file, "\n", strlen("\n"), &written, NULL);
-
- left = size - lstrlenA(name) - 1;
-
- SetFilePointer(file, left, NULL, FILE_CURRENT);
- SetEndOfFile(file);
-
- CloseHandle(file);
-}
-
static void create_test_files(void)
{
CreateDirectoryA("msitest", NULL);
create_file("msitest\\filename", 100);
}
-static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
-{
- CHAR path[MAX_PATH];
-
- lstrcpyA(path, PROG_FILES_DIR);
- lstrcatA(path, "\\");
- lstrcatA(path, rel_path);
-
- if (is_file)
- return DeleteFileA(path);
- else
- return RemoveDirectoryA(path);
-}
-
static void delete_test_files(void)
{
- DeleteFileA(msifile);
DeleteFileA("msitest\\cabout\\new\\five.txt");
DeleteFileA("msitest\\cabout\\four.txt");
DeleteFileA("msitest\\second\\three.txt");
RegCloseKey(hkey);
free(string);
- delete_key_portable(hkeyParent, subkey, access);
+ RegDeleteKeyExA(hkeyParent, subkey, access, 0);
return ERROR_SUCCESS;
}
IDispatch *pStringList = NULL;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
/* In fact InstallProduct would succeed but then Windows XP
* would not allow us to clean up the registry!
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Remove registry keys written by RegisterProduct standard action */
- res = delete_key_portable(HKEY_LOCAL_MACHINE,
+ res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{837450fa-a39b-4bc8-b321-08b393f784b3}",
- KEY_WOW64_32KEY);
+ KEY_WOW64_32KEY, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
- res = delete_key_portable(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\D8E760ECA1E276347B43E42BDBDA5656", access);
+ res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\D8E760ECA1E276347B43E42BDBDA5656", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
res = find_registry_key(HKEY_LOCAL_MACHINE,
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
- res = delete_key_portable(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products\\af054738b93a8cb43b12803b397f483b", access);
+ res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products\\af054738b93a8cb43b12803b397f483b", access, 0);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
/* Remove registry keys written by PublishProduct standard action */
/* Installer::InstallProduct and other tests that depend on our product being installed */
test_Installer_InstallProduct();
+ DeleteFileA(msifile);
}
START_TEST(automation)
CLSID clsid;
IUnknown *pUnk;
- init_functionpointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
- if (pIsWow64Process)
- pIsWow64Process(GetCurrentProcess(), &is_wow64);
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
GetSystemTimeAsFileTime(&systemtime);
}
OleUninitialize();
-
SetCurrentDirectoryA(prev_path);
}
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep testdll
+#endif
+
#include <stdarg.h>
#include <stdio.h>
#include <msiquery.h>
#include <msidefs.h>
+#ifdef __MINGW32__
+#define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
+#else
+#define __WINE_PRINTF_ATTR(fmt,args)
+#endif
+
static int todo_level, todo_do_loop;
-static void WINAPIV ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...)
+static void WINAPIV __WINE_PRINTF_ATTR(6,7) ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...)
{
static char buffer[2000];
MSIHANDLE record;
DWORD sz = sizeof(buffer);
UINT r = MsiGetPropertyA(hinst, prop, buffer, &sz);
ok(hinst, !r, "'%s': got %u\n", prop, r);
- ok(hinst, sz == strlen(buffer), "'%s': expected %u, got %u\n", prop, strlen(buffer), sz);
+ ok(hinst, sz == strlen(buffer), "'%s': expected %Iu, got %lu\n", prop, strlen(buffer), sz);
ok(hinst, !strcmp(buffer, expect), "expected '%s', got '%s'\n", expect, buffer);
}
sz = 0;
r = MsiGetPropertyA(hinst, "boo", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
sz = 0;
strcpy(buffer,"x");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
sz = 1;
strcpy(buffer,"x");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
/* set the property to something */
r = MsiSetPropertyA(hinst, NULL, NULL);
sz = 0;
r = MsiGetPropertyA(hinst, "boo", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 0;
strcpy(buffer,"q");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 1;
strcpy(buffer,"x");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 3;
strcpy(buffer,"x");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "xy"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 4;
strcpy(buffer,"x");
r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !strcmp(buffer, "xyz"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
r = MsiGetPropertyW(hinst, L"boo", NULL, NULL);
ok(hinst, !r, "got %u\n", r);
sz = 0;
r = MsiGetPropertyW(hinst, L"boo", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 0;
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"boo"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 1;
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 3;
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"xy"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 4;
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"xyz"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
r = MsiSetPropertyA(hinst, "boo", NULL);
ok(hinst, !r, "got %u\n", r);
sz = 0;
r = MsiGetPropertyA(hinst, "embednullprop", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 4;
memset(buffer, 0xcc, sizeof(buffer));
r = MsiGetPropertyA(hinst, "embednullprop", buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
ok(hinst, !memcmp(buffer, "a\0\0\0\xcc", 5), "wrong data\n");
}
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer);
/* Test MsiGetActiveDatabase + MsiDatabaseIsTablePersistent once again */
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "one"), "got '%s'\n", buffer);
r = MsiRecordGetInteger(rec2, 2);
- ok(hinst, r == 1, "got %d\n", r);
+ ok(hinst, r == 1, "got %u\n", r);
sz = sizeof(buffer);
r = MsiRecordReadStream(rec2, 3, buffer, &sz);
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer);
r = MsiRecordGetInteger(rec2, 2);
- ok(hinst, r == 2, "got %d\n", r);
+ ok(hinst, r == 2, "got %u\n", r);
sz = sizeof(buffer);
r = MsiRecordReadStream(rec2, 3, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
r = MsiViewModify(view, MSIMODIFY_REFRESH, rec2);
- ok(hinst, !r, "got %d\n", r);
+ ok(hinst, !r, "got %u\n", r);
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer);
r = MsiRecordGetInteger(rec2, 2);
- ok(hinst, r == 2, "got %d\n", r);
+ ok(hinst, r == 2, "got %u\n", r);
sz = sizeof(buffer);
r = MsiRecordReadStream(rec2, 3, buffer, &sz);
r = MsiViewFetch(view, &rec2);
ok(hinst, r == ERROR_NO_MORE_ITEMS, "got %u\n", r);
- ok(hinst, !rec2, "got %u\n", rec2);
+ ok(hinst, !rec2, "got %lu\n", rec2);
r = MsiViewClose(view);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !r, "got %u\n", r);
r = MsiRecordGetInteger(rec2, 2);
- ok(hinst, r == 1, "got %d\n", r);
+ ok(hinst, r == 1, "got %u\n", r);
r = MsiCloseHandle(rec2);
ok(hinst, !r, "got %u\n", r);
r = MsiViewFetch(view, &rec2);
ok(hinst, r == ERROR_NO_MORE_ITEMS, "got %u\n", r);
- ok(hinst, !rec2, "got %u\n", rec2);
+ ok(hinst, !rec2, "got %lu\n", rec2);
r = MsiCloseHandle(rec);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !r, "got %u\n", r);
r = MsiRecordGetFieldCount(rec);
- ok(hinst, r == 1, "got %d\n", r);
+ ok(hinst, r == 1, "got %u\n", r);
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec, 0, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "Test"), "got '%s'\n", buffer);
sz = sizeof(buffer);
r = MsiRecordGetStringA(rec, 1, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == strlen(buffer), "got size %u\n", sz);
+ ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer);
r = MsiCloseHandle(rec);
ok(hinst, int_value == 0, "%u: got %u\n", i, int_value);
if (i == PID_TEMPLATE)
{
- ok(hinst, sz == 5, "%u: got %u\n", i, sz);
+ ok(hinst, sz == 5, "%u: got %lu\n", i, sz);
ok(hinst, !lstrcmpA(buffer, ";1033"), "%u: got %s\n", i, buffer);
}
else if (i == PID_REVNUMBER)
{
- ok(hinst, sz == 76, "%u: got %u\n", i, sz);
+ ok(hinst, sz == 76, "%u: got %lu\n", i, sz);
ok(hinst, !lstrcmpA(buffer, "{004757CA"), "%u: got %s\n", i, buffer);
}
else
{
- ok(hinst, sz == sizeof(buffer), "%u: got %u\n", i, sz);
+ ok(hinst, sz == sizeof(buffer), "%u: got %lu\n", i, sz);
ok(hinst, !*buffer, "%u: got %s\n", i, buffer);
}
}
sz = 0;
r = MsiGetTargetPathA(hinst, "TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 0;
strcpy(buffer,"q");
r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 1;
strcpy(buffer,"x");
r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 3;
strcpy(buffer,"x");
r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "C:"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
sz = 4;
strcpy(buffer,"x");
r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !strcmp(buffer, "C:\\"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 0;
r = MsiGetTargetPathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 3;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
sz = 4;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"C:\\"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 3, "got size %u\n", sz);
+ ok(hinst, sz == 3, "got size %lu\n", sz);
r = MsiSetTargetPathA(hinst, NULL, "C:\\subdir");
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
sz = 0;
r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == srcsz * 2, "got size %u\n", sz);
+ ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
sz = 0;
strcpy(buffer,"q");
r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
- ok(hinst, sz == srcsz * 2, "got size %u\n", sz);
+ ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
sz = 1;
strcpy(buffer,"x");
r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == srcsz * 2, "got size %u\n", sz);
+ ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
sz = srcsz;
strcpy(buffer,"x");
r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, strlen(buffer) == srcsz - 1, "wrong buffer length %d\n", strlen(buffer));
- ok(hinst, sz == srcsz * 2, "got size %u\n", sz);
+ ok(hinst, strlen(buffer) == srcsz - 1, "wrong buffer length %Iu\n", strlen(buffer));
+ ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
sz = srcsz + 1;
strcpy(buffer,"x");
r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, strlen(buffer) == srcsz, "wrong buffer length %d\n", strlen(buffer));
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, strlen(buffer) == srcsz, "wrong buffer length %Iu\n", strlen(buffer));
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
sz = 0;
r = MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
sz = srcsz;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz - 1, "wrong buffer length %d\n", lstrlenW(bufferW));
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
sz = srcsz + 1;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz, "wrong buffer length %d\n", lstrlenW(bufferW));
- ok(hinst, sz == srcsz, "got size %u\n", sz);
+ ok(hinst, sz == srcsz, "got size %lu\n", sz);
}
static void test_misc(MSIHANDLE hinst)
sz = 0;
r = MsiFormatRecordA(hinst, rec, NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 14, "got size %u\n", sz);
+ ok(hinst, sz == 14, "got size %lu\n", sz);
sz = 0;
strcpy(buffer,"q");
r = MsiFormatRecordA(hinst, rec, buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 14, "got size %u\n", sz);
+ ok(hinst, sz == 14, "got size %lu\n", sz);
sz = 1;
strcpy(buffer,"x");
r = MsiFormatRecordA(hinst, rec, buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 14, "got size %u\n", sz);
+ ok(hinst, sz == 14, "got size %lu\n", sz);
sz = 7;
strcpy(buffer,"x");
r = MsiFormatRecordA(hinst, rec, buffer, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "foo 12"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 14, "got size %u\n", sz);
+ ok(hinst, sz == 14, "got size %lu\n", sz);
sz = 8;
strcpy(buffer,"x");
r = MsiFormatRecordA(hinst, rec, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !strcmp(buffer, "foo 123"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
r = MsiFormatRecordW(hinst, rec, NULL, NULL);
ok(hinst, !r, "got %u\n", r);
sz = 0;
r = MsiFormatRecordW(hinst, rec, NULL, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
sz = 7;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"foo 12"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
sz = 8;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"foo 123"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 7, "got size %u\n", sz);
+ ok(hinst, sz == 7, "got size %lu\n", sz);
/* check that properties work */
MsiSetPropertyA(hinst, "fmtprop", "foobar");
r = MsiFormatRecordA(hinst, rec, buffer, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !strcmp(buffer, "foobar"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 6, "got size %u\n", sz);
+ ok(hinst, sz == 6, "got size %lu\n", sz);
MsiCloseHandle(rec);
}
sz = cost = temp = 0xdead;
r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, NULL, &sz, &cost, &temp);
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
- ok(hinst, sz == 0xdead, "got size %d\n", sz);
+ ok(hinst, sz == 0xdead, "got size %lu\n", sz);
ok(hinst, cost == 0xdead, "got cost %d\n", cost);
ok(hinst, temp == 0xdead, "got temp %d\n", temp);
sz = temp = 0xdead;
r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, NULL, &temp);
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
- ok(hinst, sz == 0xdead, "got size %d\n", sz);
+ ok(hinst, sz == 0xdead, "got size %lu\n", sz);
ok(hinst, temp == 0xdead, "got temp %d\n", temp);
sz = cost = 0xdead;
r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, NULL);
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
- ok(hinst, sz == 0xdead, "got size %d\n", sz);
+ ok(hinst, sz == 0xdead, "got size %lu\n", sz);
ok(hinst, cost == 0xdead, "got cost %d\n", cost);
cost = temp = 0xdead;
sz = sizeof(buffer);
r = MsiEnumComponentCostsA(hinst, NULL, 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "C:"), "got '%s'\n", buffer);
ok(hinst, !cost, "got cost %d\n", cost);
ok(hinst, temp && temp != 0xdead, "got temp %d\n", temp);
sz = sizeof(buffer);
r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
ok(hinst, !strcmp(buffer, "C:"), "got '%s'\n", buffer);
ok(hinst, cost == 8, "got cost %d\n", cost);
ok(hinst, !temp, "got temp %d\n", temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
todo_wine
- ok(hinst, sz == 4, "got size %u\n", sz);
+ ok(hinst, sz == 4, "got size %lu\n", sz);
ok(hinst, cost == 8, "got cost %d\n", cost);
ok(hinst, !temp, "got temp %d\n", temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
todo_wine {
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 4, "got size %u\n", sz);
+ ok(hinst, sz == 4, "got size %lu\n", sz);
}
sz = 2;
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
todo_wine {
ok(hinst, !strcmp(buffer, "C"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 4, "got size %u\n", sz);
+ ok(hinst, sz == 4, "got size %lu\n", sz);
}
sz = 3;
r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !strcmp(buffer, "C:"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
sz = 2;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"C"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
sz = 3;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
- ok(hinst, sz == 2, "got size %u\n", sz);
+ ok(hinst, sz == 2, "got size %lu\n", sz);
}
static void test_invalid_functions(MSIHANDLE hinst)
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
r = MsiCreateTransformSummaryInfoA(db, db, "bogus.mst", 0, 0);
- todo_wine ok(hinst, r == ERROR_INSTALL_PACKAGE_OPEN_FAILED ||
- r == ERROR_INSTALL_PACKAGE_INVALID /* winxp */,
- "got %u\n", r);
+ todo_wine ok(hinst, r == ERROR_INSTALL_PACKAGE_OPEN_FAILED, "got %u\n", r);
GetCurrentDirectoryA(sizeof(path), path);
r = MsiDatabaseExportA(db, "Test", path, "bogus.idt");
sz = 0;
err = MsiViewGetErrorA(0, NULL, &sz);
todo_wine ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
err = MsiViewGetErrorA(view, NULL, NULL);
ok(hinst, err == MSIDBERROR_INVALIDARG, "got %d\n", err);
sz = 0;
err = MsiViewGetErrorA(view, NULL, &sz);
ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
sz = 0;
strcpy(buffer, "x");
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
sz = 1;
strcpy(buffer, "x");
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
rec = MsiCreateRecord(2);
MsiRecordSetInteger(rec, 1, 1);
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_DUPLICATEKEY, "got %d\n", err);
ok(hinst, !strcmp(buffer, "A"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 1, "got size %u\n", sz);
+ ok(hinst, sz == 1, "got size %lu\n", sz);
sz = 2;
strcpy(buffer, "x");
err = MsiViewGetErrorA(view, buffer, &sz);
todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
todo_wine ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- todo_wine ok(hinst, sz == 0, "got size %u\n", sz);
+ todo_wine ok(hinst, sz == 0, "got size %lu\n", sz);
r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec);
ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r);
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_MOREDATA, "got %d\n", err);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- ok(hinst, sz == 1, "got size %u\n", sz);
+ ok(hinst, sz == 1, "got size %lu\n", sz);
sz = 1;
strcpy(buffer, "x");
err = MsiViewGetErrorA(view, buffer, &sz);
todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
- todo_wine ok(hinst, sz == 0, "got size %u\n", sz);
+ todo_wine ok(hinst, sz == 0, "got size %lu\n", sz);
r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec);
ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r);
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
sz = 0;
strcpy(buffer, "x");
err = MsiViewGetErrorA(view, buffer, &sz);
ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
- ok(hinst, sz == 0, "got size %u\n", sz);
+ ok(hinst, sz == 0, "got size %lu\n", sz);
MsiCloseHandle(rec);
MsiCloseHandle(view);
/* Test for an MTA apartment */
hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
- ok(hinst, hr == S_OK, "CoCreateInstance failed with %08x\n", hr);
+ ok(hinst, hr == S_OK, "CoCreateInstance failed with %08lx\n", hr);
if (unk) IUnknown_Release(unk);
/* but ours is uninitialized */
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- ok(hinst, hr == S_OK, "got %#x\n", hr);
+ ok(hinst, hr == S_OK, "got %#lx\n", hr);
CoUninitialize();
test_props(hinst);
{
DWORD size;
HANDLE file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
- ok(hinst, file != INVALID_HANDLE_VALUE, "CreateFile failed, error %u\n", GetLastError());
+ ok(hinst, file != INVALID_HANDLE_VALUE, "CreateFile failed, error %lu\n", GetLastError());
SetFilePointer(file, 0, NULL, FILE_END);
WriteFile(file, text, strlen(text), &size, NULL);
{
char env[2] = {0};
DWORD r = GetEnvironmentVariableA("MSI_PROCESS_TEST", env, sizeof(env));
- ok(hinst, r == 1, "got %d, error %u\n", r, GetLastError());
+ ok(hinst, r == 1, "got %lu, error %lu\n", r, GetLastError());
ok(hinst, !strcmp(env, "1"), "got %s\n", env);
ok(hinst, !global_state, "got global_state %d\n", global_state);
return ERROR_SUCCESS;
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
- ok(hinst, !!service, "service absent: %u\n", GetLastError());
+ ok(hinst, !!service, "service absent: %lu\n", GetLastError());
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
SC_HANDLE manager, service;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "TestService", GENERIC_ALL);
- ok(hinst, !!service, "service absent: %u\n", GetLastError());
+ ok(hinst, !!service, "service absent: %lu\n", GetLastError());
CloseServiceHandle(service);
CloseServiceHandle(manager);
return ERROR_SUCCESS;
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
ret = QueryServiceStatus(service, &status);
- ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError());
- ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %u\n", status.dwCurrentState);
+ ok(hinst, ret, "QueryServiceStatus failed: %lu\n", GetLastError());
+ ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %lu\n", status.dwCurrentState);
CloseServiceHandle(service);
CloseServiceHandle(manager);
manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
ret = QueryServiceStatus(service, &status);
- ok(hinst, ret, "QueryServiceStatus failed: %u\n", GetLastError());
- ok(hinst, status.dwCurrentState == SERVICE_STOPPED, "got %u\n", status.dwCurrentState);
+ ok(hinst, ret, "QueryServiceStatus failed: %lu\n", GetLastError());
+ ok(hinst, status.dwCurrentState == SERVICE_STOPPED, "got %lu\n", status.dwCurrentState);
CloseServiceHandle(service);
CloseServiceHandle(manager);
res = RegQueryValueExA(key, name, NULL, NULL, (BYTE *)value, &sz);
if (expect)
{
- ok(hinst, !res, "failed to get value \"%s\": %d\n", name, res);
+ ok(hinst, !res, "failed to get value \"%s\": %ld\n", name, res);
ok(hinst, !strcmp(value, expect), "\"%s\": expected \"%s\", got \"%s\"\n",
name, expect, value);
}
else
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "\"%s\": expected missing, got %u\n",
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "\"%s\": expected missing, got %ld\n",
name, res);
}
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
- ok(hinst, !res, "got %d\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
RegCloseKey(key);
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, path_dotnet, &key);
- ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %d\n", res);
+ ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
if (!res)
{
check_reg_str(hinst, key, name_dotnet, NULL);
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, pub_key, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "feature", "");
check_reg_str(hinst, key, "montecristo", "");
RegCloseKey(key);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "feature", "VGtfp^p+,?82@JU1j_KE");
check_reg_str(hinst, key, "montecristo", "VGtfp^p+,?82@JU1j_KE");
RegCloseKey(key);
LONG res;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pf_classkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, pf_userkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pp_prodkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "ProductName", "MSITEST");
check_reg_str(hinst, key, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
check_reg_str(hinst, key, "Clients", ":");
LONG res;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, pp_prodkey, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
res = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, font_key, 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "msi test font", NULL);
RegCloseKey(key);
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, rp_key, 0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "DisplayName", "MSITEST");
RegCloseKey(key);
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, rp_key, 0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
0, KEY_READ | KEY_WOW64_32KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ru_key, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "ProductID", "none");
RegCloseKey(key);
LONG res;
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ru_key, 0, KEY_READ | KEY_WOW64_64KEY, &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
HRESULT hr;
hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
- ok(hinst, hr == S_OK, "got %#x\n", hr);
+ ok(hinst, hr == S_OK, "got %#lx\n", hr);
ITypeLib_Release(tlb);
return ERROR_SUCCESS;
HRESULT hr;
hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
- ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#x\n", hr);
+ ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#lx\n", hr);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
RegCloseKey(key);
return ERROR_SUCCESS;
LONG res;
res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
- ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "MSITESTVAR3", "1");
check_reg_str(hinst, key, "MSITESTVAR4", "1");
RegCloseKey(key);
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "MSITESTVAR3", NULL);
check_reg_str(hinst, key, "MSITESTVAR4", NULL);
RegCloseKey(key);
strcat(path, "\\msitest\\test.ini");
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
- ok(hinst, len == 6, "got %u\n", len);
+ ok(hinst, len == 6, "got %lu\n", len);
return ERROR_SUCCESS;
}
strcat(path, "\\msitest\\test.ini");
len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
- ok(hinst, !len, "got %u\n", len);
+ ok(hinst, !len, "got %lu\n", len);
return ERROR_SUCCESS;
}
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "sz", "string");
RegCloseKey(key);
LONG res;
res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
- ok(hinst, !res, "got %u\n", res);
+ ok(hinst, !res, "got %ld\n", res);
check_reg_str(hinst, key, "sz", NULL);
RegCloseKey(key);
#include <msiquery.h>
#include "wine/test.h"
+#include "utils.h"
static const char *msifile = "winetest-db.msi";
static const char *msifile2 = "winetst2-db.msi";
return ret;
}
-static UINT run_query( MSIHANDLE hdb, MSIHANDLE hrec, const char *query )
-{
- MSIHANDLE hview = 0;
- UINT r;
-
- r = MsiDatabaseOpenViewA(hdb, query, &hview);
- if( r != ERROR_SUCCESS )
- return r;
-
- r = MsiViewExecute(hview, hrec);
- if( r == ERROR_SUCCESS )
- r = MsiViewClose(hview);
- MsiCloseHandle(hview);
- return r;
-}
-
static UINT run_queryW( MSIHANDLE hdb, MSIHANDLE hrec, const WCHAR *query )
{
MSIHANDLE hview = 0;
DeleteFileA(msifile);
}
-static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
-{
- HANDLE file;
- DWORD written;
-
- file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if (file == INVALID_HANDLE_VALUE)
- return;
-
- WriteFile(file, data, strlen(data), &written, NULL);
- WriteFile(file, "\n", strlen("\n"), &written, NULL);
-
- if (size)
- {
- SetFilePointer(file, size, NULL, FILE_BEGIN);
- SetEndOfFile(file);
- }
-
- CloseHandle(file);
-}
-
-#define create_file(name) create_file_data(name, name, 0)
-
static void test_streamtable(void)
{
MSIHANDLE hdb = 0, rec, view, hsi;
MsiCloseHandle( view );
/* insert a file into the _Streams table */
- create_file( "test.txt" );
+ create_file( "test.txt", 0 );
rec = MsiCreateRecord( 2 );
MsiRecordSetStringA( rec, 1, "data" );
MsiCloseHandle( view );
/* insert another one */
- create_file( "test1.txt" );
+ create_file( "test1.txt", 0 );
rec = MsiCreateRecord( 2 );
MsiRecordSetStringA( rec, 1, "data1" );
MsiCloseHandle( view );
/* try again */
- create_file( "test1.txt" );
+ create_file( "test1.txt", 0 );
rec = MsiCreateRecord( 2 );
MsiRecordSetStringA( rec, 1, "data1" );
memset(buf, 0, MAX_PATH);
r = MsiRecordReadStream( rec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r);
- ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf);
+ ok( !lstrcmpA(buf, "test.txt"), "Expected 'test.txt', got %s\n", buf);
MsiCloseHandle( rec );
MsiViewClose( view );
memset(buf, 0, MAX_PATH);
r = MsiRecordReadStream( rec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r);
- ok( !lstrcmpA(buf, "test1.txt\n"), "Expected 'test1.txt\\n', got %s\n", buf);
+ ok( !lstrcmpA(buf, "test1.txt"), "Expected 'test1.txt', got %s\n", buf);
MsiCloseHandle( rec );
MsiViewClose( view );
MsiCloseHandle( view );
/* perform an update */
- create_file( "test2.txt" );
+ create_file( "test2.txt", 0 );
rec = MsiCreateRecord( 1 );
r = MsiRecordSetStreamA( rec, 1, "test2.txt" );
memset(buf, 0, MAX_PATH);
r = MsiRecordReadStream( rec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r);
- ok( !lstrcmpA(buf, "test2.txt\n"), "Expected 'test2.txt\\n', got %s\n", buf);
+ ok( !lstrcmpA(buf, "test2.txt"), "Expected 'test2.txt', got %s\n", buf);
MsiCloseHandle( rec );
MsiViewClose( view );
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATEDIRECT, &hdb);
ok(r == ERROR_SUCCESS, "Failed to create database\n");
ok( hdb, "failed to create db\n");
- create_file( "test.txt" );
+ create_file( "test.txt", 0 );
rec = MsiCreateRecord( 2 );
MsiRecordSetStringA( rec, 1, "data" );
r = MsiRecordSetStreamA( rec, 2, "test.txt" );
memset(buf, 0, MAX_PATH);
r = MsiRecordReadStream( rec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r);
- ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got '%s' (%lu)\n", buf, size);
+ ok( !lstrcmpA(buf, "test.txt"), "Expected 'test.txt', got '%s' (%lu)\n", buf, size);
MsiCloseHandle( rec );
/* open a handle to the "data" stream (and keep it open during removal) */
r = run_query( hdb, 0, query );
ok( r == ERROR_SUCCESS, "Cannot create Binary table: %d\n", r );
- create_file( "test.txt" );
+ create_file( "test.txt", 0 );
rec = MsiCreateRecord( 1 );
r = MsiRecordSetStreamA( rec, 1, "test.txt" );
ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r);
r = run_query( hdb, 0, query );
ok( r == ERROR_SUCCESS, "Cannot create Binary table: %d\n", r );
- create_file( "test.txt" );
+ create_file( "test.txt", 0 );
rec = MsiCreateRecord( 1 );
r = MsiRecordSetStreamA( rec, 1, "test.txt" );
ok( r == ERROR_SUCCESS, "Failed to add stream data to the record: %d\n", r );
memset( buf, 0, MAX_PATH );
r = MsiRecordReadStream( rec, 2, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r );
- ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf );
+ ok( !lstrcmpA(buf, "test.txt"), "Expected 'test.txt', got %s\n", buf );
r = MsiCloseHandle( rec );
ok( r == ERROR_SUCCESS , "Failed to close record handle\n" );
memset( buf, 0, MAX_PATH );
r = MsiRecordReadStream( rec, 3, buf, &size );
ok( r == ERROR_SUCCESS, "Failed to get stream: %d\n", r );
- ok( !lstrcmpA(buf, "test.txt\n"), "Expected 'test.txt\\n', got %s\n", buf );
+ ok( !lstrcmpA(buf, "test.txt"), "Expected 'test.txt', got %s\n", buf );
r = MsiCloseHandle( rec );
ok( r == ERROR_SUCCESS , "Failed to close record handle\n" );
DeleteFileA(msifile);
}
-static CHAR CURR_DIR[MAX_PATH];
-
static const CHAR test_data[] = "FirstPrimaryColumn\tSecondPrimaryColumn\tShortInt\tShortIntNullable\tLongInt\tLongIntNullable\tString\tLocalizableString\tLocalizableStringNullable\n"
"s255\ti2\ti2\tI2\ti4\tI4\tS255\tS0\ts0\n"
"TestTable\tFirstPrimaryColumn\n"
r = run_query(href, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- create_file("binary.dat");
+ create_file("binary.dat", 0);
hrec = MsiCreateRecord(1);
MsiRecordSetStreamA(hrec, 1, "binary.dat");
ZeroMemory(buf, MAX_PATH);
r = MsiRecordReadStream(hrec, 2, buf, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(buf, "binary.dat\n"),
- "Expected \"binary.dat\\n\", got \"%s\"\n", buf);
+ ok(!lstrcmpA(buf, "binary.dat"), "Expected \"binary.dat\", got \"%s\"\n", buf);
MsiCloseHandle(hrec);
"s72\tL0\n"
"Control\tDialog\n"
"LicenseAgreementDlg\ttext\x11\x19text\0text";
+ static const char export_expected[] =
+ "Dialog\tText\r\n"
+ "s72\tL0\r\n"
+ "Control\tDialog\r\n"
+ "LicenseAgreementDlg\ttext\x11\x19text\x19text";
+ /* newlines have alternate representation in idt files */
+ static const char control_table2[] =
+ "Dialog\tText\n"
+ "s72\tL0\n"
+ "Control\tDialog\n"
+ "LicenseAgreementDlg\ttext\x11\x19te\nxt\0text";
+ char data[1024];
UINT r;
DWORD sz;
MSIHANDLE hdb, hrec;
ok( r == ERROR_SUCCESS, "failed to get string %u\n", r );
ok( !memcmp( "text\r\ntext\ntext", buffer, sizeof("text\r\ntext\ntext") - 1 ), "wrong buffer contents \"%s\"\n", buffer );
+ r = MsiDatabaseExportA( hdb, "Control", CURR_DIR, "temp_file1");
+ ok( r == ERROR_SUCCESS, "failed to export table %u\n", r );
+ read_file_data( "temp_file1", data );
+ ok( !memcmp( data, export_expected, sizeof(export_expected) - 1), "expected: \"%s\" got: \"%s\"\n", export_expected, data );
+ DeleteFileA( "temp_file1" );
+
MsiCloseHandle( hrec );
MsiCloseHandle( hdb );
DeleteFileA( msifile );
+
+ r = MsiOpenDatabaseW( msifileW, MSIDBOPEN_CREATE, &hdb );
+ ok( r == ERROR_SUCCESS, "failed to open database %u\n", r );
+
+ GetCurrentDirectoryA( MAX_PATH, CURR_DIR );
+ write_file( "temp_file", control_table2, sizeof(control_table2) );
+ r = MsiDatabaseImportA( hdb, CURR_DIR, "temp_file" );
+ ok( r == ERROR_FUNCTION_FAILED, "failed to import table %u\n", r );
+ DeleteFileA( "temp_file" );
+
+ MsiCloseHandle( hdb );
+ DeleteFileA( msifile );
}
static void test_select_column_names(void)
#include <msi.h>
#include <fci.h>
#include <objidl.h>
-#include <srrestoreptapi.h>
#include <shlobj.h>
#include <winsvc.h>
#include <shellapi.h>
#include "wine/test.h"
#include "utils.h"
-static UINT (WINAPI *pMsiQueryComponentStateA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
-static UINT (WINAPI *pMsiSourceListEnumSourcesA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
-static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
- (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **);
-static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *);
-
-static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
-static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
-
static BOOL is_wow64;
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
return 0;
}
-static void init_functionpointers(void)
-{
- HMODULE hmsi = GetModuleHandleA("msi.dll");
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hsrclient = LoadLibraryA("srclient.dll");
-
-#define GET_PROC(mod, func) \
- p ## func = (void*)GetProcAddress(mod, #func); \
- if(!p ## func) \
- trace("GetProcAddress(%s) failed\n", #func);
-
- GET_PROC(hmsi, MsiQueryComponentStateA);
- GET_PROC(hmsi, MsiSourceListEnumSourcesA);
- GET_PROC(hmsi, MsiGetComponentPathExA);
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hkernel32, IsWow64Process)
- GET_PROC(hkernel32, Wow64DisableWow64FsRedirection);
- GET_PROC(hkernel32, Wow64RevertWow64FsRedirection);
-
- GET_PROC(hsrclient, SRRemoveRestorePoint);
- GET_PROC(hsrclient, SRSetRestorePointA);
-
-#undef GET_PROC
-}
-
-BOOL is_process_limited(void)
+BOOL is_process_elevated(void)
{
- SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
- PSID Group = NULL;
- BOOL IsInGroup;
HANDLE token;
+ TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
+ DWORD size;
+ BOOL ret;
- if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
- DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
- !CheckTokenMembership(NULL, Group, &IsInGroup))
- {
- trace("Could not check if the current user is an administrator\n");
- FreeSid(Group);
- return FALSE;
- }
- FreeSid(Group);
-
- if (!IsInGroup)
- {
- /* Only administrators have enough privileges for these tests */
- return TRUE;
- }
-
- if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
- {
- BOOL ret;
- TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
- DWORD size;
-
- ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
- CloseHandle(token);
- return (ret && type == TokenElevationTypeLimited);
- }
- return FALSE;
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) return FALSE;
+ ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
+ CloseHandle(token);
+ return (ret && type == TokenElevationTypeFull);
}
static BOOL check_record(MSIHANDLE rec, UINT field, LPCSTR val)
free( nameW );
}
-static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
-{
- RESTOREPOINTINFOA spec;
-
- spec.dwEventType = event_type;
- spec.dwRestorePtType = APPLICATION_INSTALL;
- spec.llSequenceNumber = status->llSequenceNumber;
- lstrcpyA(spec.szDescription, "msitest restore point");
-
- return pSRSetRestorePointA(&spec, status);
-}
-
-static void remove_restore_point(DWORD seq_number)
-{
- DWORD res;
-
- res = pSRRemoveRestorePoint(seq_number);
- if (res != ERROR_SUCCESS)
- trace("Failed to remove the restore point: %#lx\n", res);
-}
-
-static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
-
static void test_MsiInstallProduct(void)
{
UINT r;
DWORD num, size, type;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
- delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access);
+ RegDeleteKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access, 0);
/* not published, reinstall */
r = MsiInstallProductA(msifile, NULL);
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HANDLE file;
CHAR path[MAX_PATH];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
CHAR path[MAX_PATH];
CHAR buf[16];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
CHAR drive[MAX_PATH], path[MAX_PATH + 12];
LPSTR ptr;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
CHAR props[MAX_PATH + 18];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
HRESULT hr;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
static const char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}";
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
else
{
fileret = DeleteFileA(src);
- ok(fileret || broken(!fileret) /* win2k3 */, "Failed to delete file %s (%lu)\n", src, GetLastError());
+ ok(fileret, "Failed to delete file %s (%lu)\n", src, GetLastError());
}
}
HKEY hkey;
char path[MAX_PATH];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
HKEY hkey;
char path[MAX_PATH];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ok(!delete_pf("msitest\\preselected.txt", TRUE), "file not removed\n");
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access, 0);
error:
DeleteFileA("msitest\\override.txt");
CHAR path[MAX_PATH];
static const char prodcode[] = "{7DF88A49-996F-4EC8-A022-BF956F9B2CBB}";
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
char value[MAX_PATH];
DWORD size;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
- ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
+ ok(res == ERROR_FILE_NOT_FOUND, "32-bit component key not removed\n");
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
- ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
+ ok(res == ERROR_FILE_NOT_FOUND, "32-bit component key not removed\n");
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
DWORD type, size;
char buf[1];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip( "process is limited\n" );
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip( "process is limited\n" );
return;
return;
}
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
goto error;
}
- pWow64DisableWow64FsRedirection(&cookie);
+ Wow64DisableWow64FsRedirection(&cookie);
ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
ok(delete_pf_native("msitest\\filename", TRUE), "File not installed\n");
ok(delete_pf_native("msitest", FALSE), "Directory not created\n");
- pWow64RevertWow64FsRedirection(cookie);
+ Wow64RevertWow64FsRedirection(cookie);
error:
delete_test_files();
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip( "process is limited\n" );
return;
{
DWORD len;
char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
- STATEMGRSTATUS status;
- BOOL ret = FALSE;
- init_functionpointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
+
subtest("custom");
- if (pIsWow64Process)
- pIsWow64Process(GetCurrentProcess(), &is_wow64);
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
ok(get_system_dirs(), "failed to retrieve system dirs\n");
ok(get_user_dirs(), "failed to retrieve user dirs\n");
- /* Create a restore point ourselves so we circumvent the multitude of restore points
- * that would have been created by all the installation and removal tests.
- *
- * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
- * creation of restore points.
- */
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
- {
- memset(&status, 0, sizeof(status));
- ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
- }
-
/* Create only one log file and don't append. We have to pass something
* for the log mode for this to work. The logfile needs to have an absolute
* path otherwise we still end up with some extra logfiles as some tests
lstrcatA(log_file, "\\msitest.log");
MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
- if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */
- test_MsiInstallProduct();
+ test_MsiInstallProduct();
test_MsiSetComponentState();
test_packagecoltypes();
test_continuouscabs();
test_source_resolution();
DeleteFileA(customdll);
-
DeleteFileA(log_file);
-
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
- {
- ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
- if (ret)
- remove_restore_point(status.llSequenceNumber);
- }
-
SetCurrentDirectoryA(prev_path);
}
static const char msifile[] = "winetest.msi";
static const WCHAR msifileW[] = L"winetest.msi";
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-
-static INSTALLSTATE (WINAPI *pMsiGetComponentPathA)
- (LPCSTR, LPCSTR, LPSTR, DWORD*);
-static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
- (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static INSTALLSTATE (WINAPI *pMsiProvideComponentA)
- (LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD);
-static INSTALLSTATE (WINAPI *pMsiProvideComponentW)
- (LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPWSTR, LPDWORD);
-static UINT (WINAPI *pMsiGetFileHashA)
- (LPCSTR, DWORD, PMSIFILEHASHINFO);
-static UINT (WINAPI *pMsiGetProductInfoExA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiOpenPackageExA)
- (LPCSTR, DWORD, MSIHANDLE*);
-static UINT (WINAPI *pMsiOpenPackageExW)
- (LPCWSTR, DWORD, MSIHANDLE*);
-static UINT (WINAPI *pMsiEnumPatchesExA)
- (LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR, LPSTR,
- MSIINSTALLCONTEXT*, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiQueryComponentStateA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
-static INSTALLSTATE (WINAPI *pMsiUseFeatureExA)
- (LPCSTR, LPCSTR ,DWORD, DWORD);
-static UINT (WINAPI *pMsiGetPatchInfoExA)
- (LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, LPSTR, DWORD *);
-static UINT (WINAPI *pMsiEnumProductsExA)
- (LPCSTR, LPCSTR, DWORD, DWORD, CHAR[39], MSIINSTALLCONTEXT *, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiEnumComponentsExA)
- (LPCSTR, DWORD, DWORD, CHAR[39], MSIINSTALLCONTEXT *, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiSetExternalUIRecord)
- (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD);
-static UINT (WINAPI *pMsiSourceListGetInfoA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
-
-static void init_functionpointers(void)
-{
- HMODULE hmsi = GetModuleHandleA("msi.dll");
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
-
-#define GET_PROC(dll, func) \
- p ## func = (void *)GetProcAddress(dll, #func); \
- if(!p ## func) \
- trace("GetProcAddress(%s) failed\n", #func);
-
- GET_PROC(hmsi, MsiGetComponentPathA)
- GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hmsi, MsiProvideComponentA)
- GET_PROC(hmsi, MsiProvideComponentW)
- GET_PROC(hmsi, MsiGetFileHashA)
- GET_PROC(hmsi, MsiGetProductInfoExA)
- GET_PROC(hmsi, MsiOpenPackageExA)
- GET_PROC(hmsi, MsiOpenPackageExW)
- GET_PROC(hmsi, MsiEnumPatchesExA)
- GET_PROC(hmsi, MsiQueryComponentStateA)
- GET_PROC(hmsi, MsiSetExternalUIRecord)
- GET_PROC(hmsi, MsiUseFeatureExA)
- GET_PROC(hmsi, MsiGetPatchInfoExA)
- GET_PROC(hmsi, MsiEnumProductsExA)
- GET_PROC(hmsi, MsiEnumComponentsExA)
- GET_PROC(hmsi, MsiSourceListGetInfoA)
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hkernel32, IsWow64Process)
-
-#undef GET_PROC
-}
-
/* cabinet definitions */
/* make the max size large so there is only one cab file */
{
INSTALLSTATE r;
- if (!pMsiUseFeatureExA)
- {
- win_skip("MsiUseFeatureExA not implemented\n");
- return;
- }
-
r = MsiQueryFeatureStateA(NULL, NULL);
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
r = MsiQueryFeatureStateA("{9085040-6000-11d3-8cfe-0150048383c9}" ,NULL);
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA(NULL,NULL,0,0);
+ r = MsiUseFeatureExA(NULL,NULL,0,0);
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA(NULL, "WORDVIEWFiles", -2, 1 );
+ r = MsiUseFeatureExA(NULL, "WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
+ r = MsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
NULL, -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
+ r = MsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
+ r = MsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
+ r = MsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
}
-static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
-
static void test_null(void)
{
MSIHANDLE hpkg;
if (is_wow64)
access |= KEY_WOW64_64KEY;
- r = pMsiOpenPackageExW(NULL, 0, &hpkg);
+ r = MsiOpenPackageExW(NULL, 0, &hpkg);
ok( r == ERROR_INVALID_PARAMETER,"wrong error\n");
state = MsiQueryProductStateW(NULL);
r = RegCloseKey(hkey);
ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
- r = delete_key(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{F1C3AF50-8B56-4A69-A00C-00773FE42F30}",
- access & KEY_WOW64_64KEY);
+ r = RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{F1C3AF50-8B56-4A69-A00C-00773FE42F30}",
+ access & KEY_WOW64_64KEY, 0);
ok( r == ERROR_SUCCESS, "wrong error %d\n", r);
}
char buffer[0x100];
DWORD sz;
- if(!pMsiGetComponentPathA)
- return;
-
- r = pMsiGetComponentPathA( NULL, NULL, NULL, NULL );
+ r = MsiGetComponentPathA( NULL, NULL, NULL, NULL );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
- r = pMsiGetComponentPathA( "bogus", "bogus", NULL, NULL );
+ r = MsiGetComponentPathA( "bogus", "bogus", NULL, NULL );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
- r = pMsiGetComponentPathA( "bogus", "{00000000-0000-0000-000000000000}", NULL, NULL );
+ r = MsiGetComponentPathA( "bogus", "{00000000-0000-0000-000000000000}", NULL, NULL );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
sz = sizeof buffer;
buffer[0]=0;
- r = pMsiGetComponentPathA( "bogus", "{00000000-0000-0000-000000000000}", buffer, &sz );
+ r = MsiGetComponentPathA( "bogus", "{00000000-0000-0000-000000000000}", buffer, &sz );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
- r = pMsiGetComponentPathA( "{00000000-78E1-11D2-B60F-006097C998E7}",
+ r = MsiGetComponentPathA( "{00000000-78E1-11D2-B60F-006097C998E7}",
"{00000000-0000-0000-0000-000000000000}", buffer, &sz );
ok( r == INSTALLSTATE_UNKNOWN, "wrong return value\n");
- r = pMsiGetComponentPathA( "{00000409-78E1-11D2-B60F-006097C998E7}",
+ r = MsiGetComponentPathA( "{00000409-78E1-11D2-B60F-006097C998E7}",
"{00000000-0000-0000-0000-00000000}", buffer, &sz );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
- r = pMsiGetComponentPathA( "{00000409-78E1-11D2-B60F-006097C998E7}",
+ r = MsiGetComponentPathA( "{00000409-78E1-11D2-B60F-006097C998E7}",
"{029E403D-A86A-1D11-5B5B0006799C897E}", buffer, &sz );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return value\n");
- r = pMsiGetComponentPathA( "{00000000-78E1-11D2-B60F-006097C9987e}",
+ r = MsiGetComponentPathA( "{00000000-78E1-11D2-B60F-006097C9987e}",
"{00000000-A68A-11d1-5B5B-0006799C897E}", buffer, &sz );
ok( r == INSTALLSTATE_UNKNOWN, "wrong return value\n");
}
MSIFILEHASHINFO hash;
DWORD i;
- if (!pMsiGetFileHashA)
- {
- win_skip("MsiGetFileHash not implemented\n");
- return;
- }
-
hash.dwFileHashInfoSize = sizeof(MSIFILEHASHINFO);
/* szFilePath is NULL */
- r = pMsiGetFileHashA(NULL, 0, &hash);
+ r = MsiGetFileHashA(NULL, 0, &hash);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* szFilePath is empty */
- r = pMsiGetFileHashA("", 0, &hash);
+ r = MsiGetFileHashA("", 0, &hash);
ok(r == ERROR_PATH_NOT_FOUND || r == ERROR_BAD_PATHNAME,
"Expected ERROR_PATH_NOT_FOUND or ERROR_BAD_PATHNAME, got %d\n", r);
/* szFilePath is nonexistent */
- r = pMsiGetFileHashA(name, 0, &hash);
+ r = MsiGetFileHashA(name, 0, &hash);
ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", r);
/* dwOptions is non-zero */
- r = pMsiGetFileHashA(name, 1, &hash);
+ r = MsiGetFileHashA(name, 1, &hash);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* pHash.dwFileHashInfoSize is not correct */
hash.dwFileHashInfoSize = 0;
- r = pMsiGetFileHashA(name, 0, &hash);
+ r = MsiGetFileHashA(name, 0, &hash);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* pHash is NULL */
- r = pMsiGetFileHashA(name, 0, NULL);
+ r = MsiGetFileHashA(name, 0, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
for (i = 0; i < ARRAY_SIZE(hash_data); i++)
memset(&hash, 0, sizeof(MSIFILEHASHINFO));
hash.dwFileHashInfoSize = sizeof(MSIFILEHASHINFO);
- r = pMsiGetFileHashA(name, 0, &hash);
+ r = MsiGetFileHashA(name, 0, &hash);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ret = memcmp(&hash, &hash_data[i].hash, HASHSIZE);
ok(error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", error);
RegDeleteValueA(localkey, "WindowsInstaller");
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
lstrcatA(keypath, usersid);
SetLastError(0xdeadbeef);
state = MsiQueryProductStateA(prodcode);
error = GetLastError();
- if (state == INSTALLSTATE_ADVERTISED)
- {
- win_skip("broken result\n");
- RegDeleteValueA(props, "WindowsInstaller");
- delete_key(props, "", access & KEY_WOW64_64KEY);
- RegCloseKey(props);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
- RegCloseKey(localkey);
- RegDeleteKeyA(userkey, "");
- RegCloseKey(userkey);
- LocalFree(usersid);
- return;
- }
ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
ok(error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", error);
ok(error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %lu\n", error);
RegDeleteValueA(props, "WindowsInstaller");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(localkey);
RegDeleteKeyA(userkey, "");
RegCloseKey(userkey);
ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
RegDeleteValueA(props, "WindowsInstaller");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(localkey);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_MACHINE */
ok(state == INSTALLSTATE_DEFAULT, "Expected INSTALLSTATE_DEFAULT, got %d\n", state);
RegDeleteValueA(props, "WindowsInstaller");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(localkey);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
LocalFree(usersid);
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey2, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
- delete_key(compkey2, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(compkey2, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(localkey, "feature");
RegDeleteValueA(userkey, "feature");
RegDeleteKeyA(userkey, "");
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey2, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
- delete_key(compkey2, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(compkey2, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(localkey, "feature");
RegDeleteValueA(userkey, "feature");
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
RegCloseKey(compkey2);
RegCloseKey(localkey);
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey2, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
- delete_key(compkey2, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(compkey2, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(localkey, "feature");
RegDeleteValueA(userkey, "feature");
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
RegCloseKey(compkey2);
RegCloseKey(localkey);
static const INSTALLSTATE MAGIC_ERROR = 0xdeadbeef;
- if (!pMsiQueryComponentStateA)
- {
- win_skip("MsiQueryComponentStateA not implemented\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
compose_base85_guid(component, comp_base85, comp_squashed);
usersid = get_user_sid();
/* NULL szProductCode */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(NULL, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(NULL, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* empty szProductCode */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA("", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA("", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* random szProductCode */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA("random", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA("random", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* GUID-length szProductCode */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA("DJANE93KNDNAS-2KN2NR93KMN3LN13=L1N3KDE", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA("DJANE93KNDNAS-2KN2NR93KMN3LN13=L1N3KDE", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* GUID-length with brackets */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA("{JANE93KNDNAS-2KN2NR93KMN3LN13=L1N3KD}", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA("{JANE93KNDNAS-2KN2NR93KMN3LN13=L1N3KD}", NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* actual GUID */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
ok(error == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", error);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* create local system product key */
/* local system product key exists */
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
/* LocalPackage value exists */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
/* component key exists */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
/* component\product exists */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
error = GetLastError();
ok(state == INSTALLSTATE_NOTUSED || state == INSTALLSTATE_LOCAL,
/* NULL component, product exists */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &state);
error = GetLastError();
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected state not changed, got %d\n", state);
/* INSTALLSTATE_LOCAL */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
/* INSTALLSTATE_SOURCE */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
/* bad INSTALLSTATE_SOURCE */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
/* INSTALLSTATE_SOURCE */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_SOURCE, "Expected INSTALLSTATE_SOURCE, got %d\n", state);
/* registry component */
state = MAGIC_ERROR;
SetLastError(0xdeadbeef);
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, component, &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
ok(error == 0xdeadbeef, "expected 0xdeadbeef, got %lu\n", error);
RegDeleteValueA(prodkey, "LocalPackage");
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegCloseKey(compkey);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
RegCloseKey(prodkey);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
/* component key exists */
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
/* component\product exists */
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_NOTUSED || state == INSTALLSTATE_LOCAL,
"Expected INSTALLSTATE_NOTUSED or INSTALLSTATE_LOCAL, got %d\n", state);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, component, &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
/* MSIINSTALLCONTEXT_USERMANAGED */
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == MAGIC_ERROR, "Expected 0xdeadbeef, got %d\n", state);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
state = MAGIC_ERROR;
- r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
+ r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, component, &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
RegDeleteValueA(prodkey, "LocalPackage");
RegDeleteValueA(prodkey, "ManagedLocalPackage");
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegCloseKey(compkey);
LocalFree(usersid);
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(installprop, "WindowsInstaller");
- delete_key(installprop, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(installprop, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
RegCloseKey(installprop);
DeleteFileA("C:\\imapath");
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(installprop, "WindowsInstaller");
- delete_key(installprop, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(installprop, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
RegCloseKey(installprop);
DeleteFileA("C:\\imapath");
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(installprop, "WindowsInstaller");
- delete_key(installprop, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(installprop, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegCloseKey(compkey);
RegCloseKey(installprop);
RegDeleteValueA(compkey, prod_squashed);
RegDeleteKeyA(prodkey, "");
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegCloseKey(compkey);
DeleteFileA("C:\\imapath");
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(compkey, prod_squashed);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegCloseKey(compkey);
DeleteFileA("C:\\imapath");
REGSAM access = KEY_ALL_ACCESS;
LONG res;
- if (!pMsiGetComponentPathExA)
- {
- win_skip( "MsiGetComponentPathExA not present\n" );
- return;
- }
-
if (is_wow64) access |= KEY_WOW64_64KEY;
create_test_guid( prod, prod_squashed );
/* NULL product */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( NULL, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( NULL, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
todo_wine ok( !size, "got %lu\n", size );
/* NULL component */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, NULL, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, NULL, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
todo_wine ok( !size, "got %lu\n", size );
/* non-NULL usersid, MSIINSTALLCONTEXT_MACHINE */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, usersid, MSIINSTALLCONTEXT_MACHINE, path, &size);
+ state = MsiGetComponentPathExA( prod, comp, usersid, MSIINSTALLCONTEXT_MACHINE, path, &size);
ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
todo_wine ok( !size, "got %lu\n", size );
/* NULL buf */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, NULL, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok( size == MAX_PATH * 2, "got %lu\n", size );
/* NULL buflen */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, NULL );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, NULL );
ok( state == INSTALLSTATE_INVALIDARG, "got %d\n", state );
ok( size == MAX_PATH, "got %lu\n", size );
/* all params valid */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok( !size, "got %lu\n", size );
/* local system component key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
/* product value exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* install properties key exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* file exists */
path[0] = 0;
size = 0;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_MOREDATA, "got %d\n", state );
ok( !path[0], "got %s\n", path );
todo_wine ok( size == 40, "got %lu\n", size );
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
RegDeleteValueA( key_comp, prod_squashed );
- delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_comp, "", access & KEY_WOW64_64KEY, 0 );
RegDeleteValueA( key_installprop, "WindowsInstaller" );
- delete_key( key_installprop, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_installprop, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( key_comp );
RegCloseKey( key_installprop );
DeleteFileA( "c:\\testcomponentpath" );
/* user unmanaged product key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok(!size, "got %lu\n", size);
/* user unmanaged component key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok(!size, "got %lu\n", size);
/* product value exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* file exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, path, &size );
ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
RegDeleteValueA( key_comp, prod_squashed );
RegDeleteKeyA( key_prod, "" );
- delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_comp, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( key_prod );
RegCloseKey( key_comp );
DeleteFileA( "c:\\testcomponentpath" );
/* user managed product key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" );
/* user managed component key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
res = RegSetValueExA( key_comp, prod_squashed, 0, REG_SZ, (const BYTE *)"c:\\testcomponentpath", 20 );
/* product value exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* install properties key exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* file exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_USERMANAGED, path, &size );
ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
RegDeleteValueA( key_comp, prod_squashed );
- delete_key( key_prod, "", access & KEY_WOW64_64KEY );
- delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_prod, "", access & KEY_WOW64_64KEY, 0 );
+ RegDeleteKeyExA( key_comp, "", access & KEY_WOW64_64KEY, 0 );
RegDeleteValueA( key_installprop, "WindowsInstaller" );
- delete_key( key_installprop, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_installprop, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( key_prod );
RegCloseKey( key_comp );
RegCloseKey( key_installprop );
/* local classes product key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok(!size, "got %lu\n", size);
/* local user component key exists */
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state );
todo_wine ok(!size, "got %lu\n", size);
/* product value exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_ABSENT, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
/* file exists */
path[0] = 0;
size = MAX_PATH;
- state = pMsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
+ state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size );
ok( state == INSTALLSTATE_LOCAL, "got %d\n", state );
ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path );
ok( size == 20, "got %lu\n", size );
RegDeleteValueA( key_comp, prod_squashed );
- delete_key( key_prod, "", access & KEY_WOW64_64KEY );
- delete_key( key_comp, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( key_prod, "", access & KEY_WOW64_64KEY, 0 );
+ RegDeleteKeyExA( key_comp, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( key_prod );
RegCloseKey( key_comp );
DeleteFileA( "c:\\testcomponentpath" );
DWORD len, len2;
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
buf[0] = 0;
len = sizeof(buf);
- r = pMsiProvideComponentA("{90120000-0070-0000-0000-4000000FF1CE}",
- "{17961602-C4E2-482E-800A-DF6E627549CF}",
- "ProductFiles", INSTALLMODE_NODETECTION, buf, &len);
+ r = MsiProvideComponentA("{90120000-0070-0000-0000-4000000FF1CE}",
+ "{17961602-C4E2-482E-800A-DF6E627549CF}",
+ "ProductFiles", INSTALLMODE_NODETECTION, buf, &len);
ok(r == ERROR_INVALID_PARAMETER, "got %u\n", r);
r = MsiInstallProductA(msifile, NULL);
buf[0] = 0;
len = sizeof(buf);
- r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
- "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
- INSTALLMODE_NODETECTION, buf, &len);
+ r = MsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
+ "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
+ INSTALLMODE_NODETECTION, buf, &len);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(buf[0], "empty path\n");
ok(len == lstrlenA(buf), "got %lu\n", len);
len2 = 0;
- r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
- "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
- INSTALLMODE_NODETECTION, NULL, &len2);
+ r = MsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
+ "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
+ INSTALLMODE_NODETECTION, NULL, &len2);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(len2 == len, "got %lu\n", len2);
len2 = 0;
- r = pMsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
- "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
- INSTALLMODE_NODETECTION, buf, &len2);
+ r = MsiProvideComponentA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", "sourcedir",
+ "{DD422F92-3ED8-49B5-A0B7-F266F98357DF}",
+ INSTALLMODE_NODETECTION, buf, &len2);
ok(r == ERROR_MORE_DATA, "got %u\n", r);
ok(len2 == len, "got %lu\n", len2);
bufW[0] = 0;
len = sizeof(buf);
- r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
- L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len);
+ r = MsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(bufW[0], "empty path\n");
ok(len == lstrlenW(bufW), "got %lu\n", len);
len2 = 0;
- r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
- L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, NULL, &len2);
+ r = MsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, NULL, &len2);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(len2 == len, "got %lu\n", len2);
len2 = 0;
- r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
- L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len2);
+ r = MsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len2);
ok(r == ERROR_MORE_DATA, "got %u\n", r);
ok(len2 == len, "got %lu\n", len2);
HKEY hkey, hkey2, hkey3, hkey4, hkey5;
LONG res;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip( "process is limited\n" );
return;
DeleteFileA( "msitest\\text.txt" );
RemoveDirectoryA( "msitest" );
- delete_key( hkey5, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( hkey5, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( hkey5 );
- delete_key( hkey4, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( hkey4, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( hkey4 );
- delete_key( hkey3, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( hkey3, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( hkey3 );
- delete_key( hkey2, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( hkey2, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( hkey2 );
- delete_key( hkey, "", access & KEY_WOW64_64KEY );
+ RegDeleteKeyExA( hkey, "", access & KEY_WOW64_64KEY, 0 );
RegCloseKey( hkey );
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey, prod2_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey, prod2_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
LocalFree(usersid);
}
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey, prod2_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
lstrcatA(keypath, comp_squashed);
res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &compkey, NULL);
+ if (res == ERROR_ACCESS_DENIED)
+ {
+ skip("Not enough rights to perform tests\n");
+ LocalFree(usersid);
+ return;
+ }
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* user local component key exists */
RegDeleteValueA(compkey, prod_squashed);
RegDeleteValueA(compkey, prod2_squashed);
- delete_key(compkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(compkey);
LocalFree(usersid);
}
lstrcpyA(lang, "lang");
r = MsiGetFileVersionA(path, version, &versz, lang, &langsz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- if (langchecksz && !langsz)
- {
- win_skip("broken MsiGetFileVersionA detected\n");
- free(vercheck);
- free(langcheck);
- return;
- }
ok(versz == verchecksz, "Expected %lu, got %lu\n", verchecksz, versz);
ok(strstr(lang, langcheck) != NULL, "Expected \"%s\" in \"%s\"\n", langcheck, lang);
ok(!lstrcmpA(version, vercheck),
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "got %lu\n", sz);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
RegDeleteValueA(propkey, "IMadeThis");
RegDeleteValueA(propkey, "HelpLink");
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(propkey);
RegCloseKey(localkey);
RegCloseKey(prodkey);
ok(sz == 4, "Expected 4, got %lu\n", sz);
RegDeleteValueA(propkey, "HelpLink");
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteKeyA(prodkey, "");
RegCloseKey(propkey);
RegCloseKey(localkey);
ok(!lstrcmpA(buf, "apple"), "Expected \"apple\", got \"%s\"\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(propkey);
RegCloseKey(localkey);
RegDeleteValueA(propkey, "Version");
RegDeleteValueA(propkey, "ProductIcon");
RegDeleteValueA(propkey, "AuthorizedLUAApp");
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(prodkey, "InstanceType");
RegDeleteValueA(prodkey, "Transforms");
RegDeleteValueA(prodkey, "Language");
RegDeleteValueA(prodkey, "ProductIcon");
RegDeleteValueA(prodkey, "AuthorizedLUAApp");
RegDeleteValueA(source, "PackageName");
- delete_key(source, "", access & KEY_WOW64_64KEY);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(source, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(propkey);
RegCloseKey(localkey);
RegCloseKey(source);
DWORD sz;
REGSAM access = KEY_ALL_ACCESS;
- if (!pMsiGetProductInfoExA)
- {
- win_skip("MsiGetProductInfoExA is not available\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
create_test_guid(packcode, pack_squashed);
usersid = get_user_sid();
/* NULL szProductCode */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* empty szProductCode */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* garbage szProductCode */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* guid without brackets */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", usersid,
+ MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* guid with brackets */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", usersid,
+ MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* szValue is non-NULL while pcchValue is NULL */
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, NULL);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, NULL);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
/* dwContext is out of range */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid, 42,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, 42, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* szProperty is NULL */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- NULL, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, NULL, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* szProperty is empty */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- "", buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, "", buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* szProperty is not a valid property */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- "notvalid", buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, "notvalid", buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* same length as guid, but random */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* local user product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallProperties key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "5"), "Expected \"5\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* LocalPackage value must exist */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage exists, but HelpLink does not exist */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPLINKA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
ok(sz == 0, "Expected 0, got %lu\n", sz);
/* HelpLink value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPLINKA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "link"), "Expected \"link\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "phone"), "Expected \"phone\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* szValue and pcchValue are NULL */
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, NULL, NULL);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* pcchValue is exactly 5 */
sz = 5;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
- ok(r == ERROR_MORE_DATA,
- "Expected ERROR_MORE_DATA, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
+ ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(sz == 10, "Expected 10, got %lu\n", sz);
/* szValue is NULL, pcchValue is exactly 5 */
sz = 5;
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, NULL, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ NULL, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(sz == 10, "Expected 10, got %lu\n", sz);
/* szValue is NULL, pcchValue is MAX_PATH */
sz = MAX_PATH;
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, NULL, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ NULL, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(sz == 10, "Expected 10, got %lu\n", sz);
/* pcchValue is exactly 0 */
sz = 0;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
- ok(r == ERROR_MORE_DATA,
- "Expected ERROR_MORE_DATA, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
+ ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected \"apple\", got \"%s\"\n", buf);
ok(sz == 10, "Expected 10, got %lu\n", sz);
/* szProperty is not a valid property */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- "notvalid", buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, "notvalid", buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLDATEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "date"), "Expected \"date\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLLOCATIONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "loc"), "Expected \"loc\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLSOURCEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "source"), "Expected \"source\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "local"), "Expected \"local\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PUBLISHERA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "pub"), "Expected \"pub\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_URLINFOABOUTA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "about"), "Expected \"about\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_URLUPDATEINFOA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "update"), "Expected \"update\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONMINORA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "2"), "Expected \"2\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONMAJORA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3"), "Expected \"3\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONSTRINGA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3.2.1"), "Expected \"3.2.1\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTIDA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "id"), "Expected \"id\", got \"%s\"\n", buf);
ok(sz == 2, "Expected 2, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_REGCOMPANYA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "comp"), "Expected \"comp\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_REGOWNERA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "owner"), "Expected \"owner\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LANGUAGEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTNAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_ASSIGNMENTTYPEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PACKAGECODEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTICONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PACKAGENAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_AUTHORIZED_LUA_APPA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* user product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_SUCCESS || broken(r == ERROR_UNKNOWN_PRODUCT), "Expected ERROR_SUCCESS, got %d\n", r);
- if (r == ERROR_UNKNOWN_PRODUCT)
- {
- win_skip("skipping remaining tests for MsiGetProductInfoEx\n");
- delete_key(prodkey, "", access);
- RegCloseKey(prodkey);
- return;
- }
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "1"), "Expected \"1\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* HelpLink value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPLINKA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLDATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLLOCATIONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_INSTALLSOURCEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PUBLISHERA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_URLINFOABOUTA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_URLUPDATEINFOA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONMINORA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONMAJORA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONSTRINGA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTIDA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_REGCOMPANYA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_REGOWNERA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "trans"), "Expected \"trans\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LANGUAGEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "lang"), "Expected \"lang\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTNAMEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_ASSIGNMENTTYPEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
ok(sz == 0, "Expected 0, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PACKAGECODEA,
+ buf, &sz);
todo_wine
{
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "ver"), "Expected \"ver\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PRODUCTICONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "icon"), "Expected \"icon\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_PACKAGENAMEA,
+ buf, &sz);
todo_wine
{
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_AUTHORIZED_LUA_APPA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "auth"), "Expected \"auth\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
RegDeleteValueA(prodkey, "HelpTelephone");
RegDeleteValueA(prodkey, "HelpLink");
RegDeleteValueA(prodkey, "LocalPackage");
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_USERMANAGED */
/* local user product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallProperties key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ManagedLocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "5"), "Expected \"5\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* HelpLink value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_HELPLINKA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "link"), "Expected \"link\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "phone"), "Expected \"phone\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLDATEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "date"), "Expected \"date\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLLOCATIONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "loc"), "Expected \"loc\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLSOURCEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "source"), "Expected \"source\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "local"), "Expected \"local\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PUBLISHERA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "pub"), "Expected \"pub\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_URLINFOABOUTA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "about"), "Expected \"about\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_URLUPDATEINFOA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "update"), "Expected \"update\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONMINORA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "2"), "Expected \"2\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONMAJORA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3"), "Expected \"3\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONSTRINGA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3.2.1"), "Expected \"3.2.1\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTIDA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "id"), "Expected \"id\", got \"%s\"\n", buf);
ok(sz == 2, "Expected 2, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_REGCOMPANYA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "comp"), "Expected \"comp\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_REGOWNERA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "owner"), "Expected \"owner\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LANGUAGEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTNAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_ASSIGNMENTTYPEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PACKAGECODEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTICONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PACKAGENAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_AUTHORIZED_LUA_APPA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
RegDeleteValueA(propkey, "HelpTelephone");
RegDeleteValueA(propkey, "HelpLink");
RegDeleteValueA(propkey, "ManagedLocalPackage");
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(propkey);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(localkey);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\");
/* user product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "1"), "Expected \"1\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
/* current user product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTSTATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* HelpLink value exists, user product key does not exist */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_HELPLINKA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* HelpLink value exists, user product key does exist */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_HELPLINKA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_HELPTELEPHONEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLDATEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLLOCATIONA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLSOURCEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PUBLISHERA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_URLINFOABOUTA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_URLUPDATEINFOA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONMINORA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONMAJORA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONSTRINGA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTIDA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_REGCOMPANYA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_REGOWNERA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "trans"), "Expected \"trans\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LANGUAGEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "lang"), "Expected \"lang\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTNAMEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_ASSIGNMENTTYPEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
ok(sz == 0, "Expected 0, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PACKAGECODEA,
+ buf, &sz);
todo_wine
{
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_VERSIONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "ver"), "Expected \"ver\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PRODUCTICONA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "icon"), "Expected \"icon\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PACKAGENAMEA,
+ buf, &sz);
todo_wine
{
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_AUTHORIZED_LUA_APPA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "auth"), "Expected \"auth\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
RegDeleteValueA(userkey, "InstallDate");
RegDeleteValueA(userkey, "HelpTelephone");
RegDeleteValueA(userkey, "HelpLink");
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_MACHINE */
/* szUserSid is non-NULL */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, usersid,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, usersid, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* local system product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallProperties key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "5"), "Expected \"5\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* HelpLink value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_HELPLINKA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "link"), "Expected \"link\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "phone"), "Expected \"phone\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "date"), "Expected \"date\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "loc"), "Expected \"loc\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "source"), "Expected \"source\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "local"), "Expected \"local\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PUBLISHERA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "pub"), "Expected \"pub\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "about"), "Expected \"about\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "update"), "Expected \"update\", got \"%s\"\n", buf);
ok(sz == 6, "Expected 6, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "2"), "Expected \"2\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3"), "Expected \"3\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "3.2.1"), "Expected \"3.2.1\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "id"), "Expected \"id\", got \"%s\"\n", buf);
ok(sz == 2, "Expected 2, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "comp"), "Expected \"comp\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_REGOWNERA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "owner"), "Expected \"owner\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LANGUAGEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
RegDeleteValueA(propkey, "HelpTelephone");
RegDeleteValueA(propkey, "HelpLink");
RegDeleteValueA(propkey, "LocalPackage");
- delete_key(propkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(propkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(propkey);
- delete_key(localkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(localkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(localkey);
lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
/* local classes product key exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTSTATEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "1"), "Expected \"1\", got \"%s\"\n", buf);
ok(sz == 1, "Expected 1, got %lu\n", sz);
/* HelpLink value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_HELPLINKA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_HELPLINKA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* HelpTelephone value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_HELPTELEPHONEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallDate value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLDATEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEA,
+ buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallLocation value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLLOCATIONA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* InstallSource value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_INSTALLSOURCEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* LocalPackage value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Publisher value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PUBLISHERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PUBLISHERA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLInfoAbout value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_URLINFOABOUTA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* URLUpdateInfo value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_URLUPDATEINFOA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMinor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONMINORA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* VersionMajor value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONMAJORA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* DisplayVersion value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONSTRINGA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* ProductID value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTIDA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegCompany value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_REGCOMPANYA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* RegOwner value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_REGOWNERA, buf, &sz);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_REGOWNERA, buf, &sz);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
/* Transforms value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_TRANSFORMSA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "trans"), "Expected \"trans\", got \"%s\"\n", buf);
ok(sz == 5, "Expected 5, got %lu\n", sz);
/* Language value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LANGUAGEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LANGUAGEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "lang"), "Expected \"lang\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* ProductName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTNAMEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "name"), "Expected \"name\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* AssignmentType value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_ASSIGNMENTTYPEA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, ""), "Expected \"\", got \"%s\"\n", buf);
ok(sz == 0, "Expected 0, got %lu\n", sz);
/* PackageCode value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PACKAGECODEA, buf, &sz);
todo_wine
{
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* Version value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_VERSIONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_VERSIONA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "ver"), "Expected \"ver\", got \"%s\"\n", buf);
ok(sz == 3, "Expected 3, got %lu\n", sz);
/* ProductIcon value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PRODUCTICONA, buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "icon"), "Expected \"icon\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
/* PackageName value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_PACKAGENAMEA, buf, &sz);
todo_wine
{
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(buf, "apple"), "Expected buf to be unchanged, got %s\n", buf);
ok(sz == MAX_PATH, "Expected MAX_PATH, got %lu\n", sz);
}
/* AuthorizedLUAApp value exists */
sz = MAX_PATH;
lstrcpyA(buf, "apple");
- r = pMsiGetProductInfoExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_AUTHORIZED_LUA_APPA, buf, &sz);
+ r = MsiGetProductInfoExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_AUTHORIZED_LUA_APPA,
+ buf, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(buf, "auth"), "Expected \"auth\", got \"%s\"\n", buf);
ok(sz == 4, "Expected 4, got %lu\n", sz);
RegDeleteValueA(prodkey, "InstallDate");
RegDeleteValueA(prodkey, "HelpTelephone");
RegDeleteValueA(prodkey, "HelpLink");
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
LocalFree(usersid);
}
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userprod);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userprod);
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userprod);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
LocalFree(usersid);
}
MsiCloseHandle(hprod);
RegDeleteValueA(props, "ManagedLocalPackage");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
MsiCloseHandle(hprod);
RegDeleteValueA(props, "LocalPackage");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
ok(hprod == 0xdeadbeef, "Expected hprod to be unchanged\n");
RegDeleteValueA(props, "LocalPackage");
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
DeleteFileA(msifile);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
+ &context, targetsid, &size);
if (r == ERROR_ACCESS_DENIED)
{
skip("Not enough rights to perform tests\n");
return;
}
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(prodkey, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = '\0';
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* increase the index */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 1, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 1, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* increase again */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 2, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 2, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szPatchCode is NULL */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, NULL, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, NULL, targetprod, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* szTargetProductCode is NULL */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, NULL,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, NULL, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* pdwTargetProductContext is NULL */
lstrcpyA(patchcode, "apple");
lstrcpyA(targetprod, "banana");
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- NULL, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, NULL, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* szTargetUserSid is NULL */
lstrcpyA(patchcode, "apple");
lstrcpyA(targetprod, "banana");
context = 0xdeadbeef;
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, NULL, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, NULL, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(size == lstrlenA(expectedsid) * sizeof(WCHAR),
- "Expected %d*sizeof(WCHAR), got %lu\n", lstrlenA(expectedsid), size);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(size == lstrlenA(expectedsid) * sizeof(WCHAR), "Expected %d*sizeof(WCHAR), got %lu\n", lstrlenA(expectedsid), size);
/* pcchTargetUserSid is exactly the length of szTargetUserSid */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = lstrlenA(expectedsid);
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!strncmp(targetsid, expectedsid, lstrlenA(expectedsid) - 1),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid) * sizeof(WCHAR),
- "Expected %d*sizeof(WCHAR), got %lu\n", lstrlenA(expectedsid), size);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!strncmp(targetsid, expectedsid, lstrlenA(expectedsid) - 1), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid) * sizeof(WCHAR), "Expected %d*sizeof(WCHAR), got %lu\n", lstrlenA(expectedsid), size);
/* pcchTargetUserSid has enough room for NULL terminator */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = lstrlenA(expectedsid) + 1;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* both szTargetuserSid and pcchTargetUserSid are NULL */
lstrcpyA(patchcode, "apple");
lstrcpyA(targetprod, "banana");
context = 0xdeadbeef;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, NULL, NULL);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
/* MSIPATCHSTATE_SUPERSEDED */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &udpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udpatch, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_SUPERSEDED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* MSIPATCHSTATE_OBSOLETED */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_OBSOLETED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* MSIPATCHSTATE_REGISTERED */
/* FIXME */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERMANAGED,
- "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERMANAGED, "Expected MSIINSTALLCONTEXT_USERMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* same patch in multiple places, only one is enumerated */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
- MSIPATCHSTATE_ALL, 1, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_ALL,
+ 1, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
RegDeleteValueA(hpatch, "State");
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
RegDeleteValueA(patches, "Patches");
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
}
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyA(prodkey, "Patches", &patches);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = 0;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_BAD_CONFIGURATION), /* Windows Installer 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_BAD_CONFIGURATION), /* Windows Installer 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERUNMANAGED,
- "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERUNMANAGED, "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* MSIPATCHSTATE_SUPERSEDED */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &udpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udpatch, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_SUPERSEDED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERUNMANAGED,
- "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERUNMANAGED, "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* MSIPATCHSTATE_OBSOLETED */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_OBSOLETED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERUNMANAGED,
- "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERUNMANAGED, "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* MSIPATCHSTATE_REGISTERED */
/* FIXME */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_USERUNMANAGED,
- "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
- ok(!lstrcmpA(targetsid, expectedsid),
- "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
- ok(size == lstrlenA(expectedsid),
- "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_USERUNMANAGED, "Expected MSIINSTALLCONTEXT_USERUNMANAGED, got %d\n", context);
+ ok(!lstrcmpA(targetsid, expectedsid), "Expected \"%s\", got \"%s\"\n", expectedsid, targetsid);
+ ok(size == lstrlenA(expectedsid), "Expected %d, got %lu\n", lstrlenA(expectedsid), size);
/* same patch in multiple places, only one is enumerated */
lstrcpyA(patchcode, "apple");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL, 1, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 1, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
RegDeleteValueA(hpatch, "State");
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
RegDeleteValueA(patches, patch_squashed);
RegDeleteValueA(patches, "Patches");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(prodkey, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = '\0';
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
- ok(!lstrcmpA(targetsid, ""),
- "Expected \"\", got \"%s\"\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &udpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
- ok(!lstrcmpA(targetsid, ""),
- "Expected \"\", got \"%s\"\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
res = RegCreateKeyExA(udpatch, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_APPLIED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_APPLIED, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
- ok(!lstrcmpA(targetsid, ""),
- "Expected \"\", got \"%s\"\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
/* MSIPATCHSTATE_SUPERSEDED */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_SUPERSEDED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_SUPERSEDED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_SUPERSEDED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_OBSOLETED;
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_OBSOLETED, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_OBSOLETED,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patchcode, patch),
- "Expected \"%s\", got \"%s\"\n", patch, patchcode);
- ok(!lstrcmpA(targetprod, prodcode),
- "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
- ok(context == MSIINSTALLCONTEXT_MACHINE,
- "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
+ ok(!lstrcmpA(patchcode, patch), "Expected \"%s\", got \"%s\"\n", patch, patchcode);
+ ok(!lstrcmpA(targetprod, prodcode), "Expected \"%s\", got \"%s\"\n", prodcode, targetprod);
+ ok(context == MSIINSTALLCONTEXT_MACHINE, "Expected MSIINSTALLCONTEXT_MACHINE, got %d\n", context);
ok(!lstrcmpA(targetsid, ""), "Expected \"\", got \"%s\"\n", targetsid);
ok(size == 0, "Expected 0, got %lu\n", size);
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_ALL, 1, patchcode, targetprod,
- &context, targetsid, &size);
+ r = MsiEnumPatchesExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_ALL,
+ 1, patchcode, targetprod, &context, targetsid, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegDeleteValueA(hpatch, "State");
RegCloseKey(hpatch);
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
done:
RegDeleteValueA(patches, patch_squashed);
RegDeleteValueA(patches, "Patches");
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
}
DWORD size;
UINT r;
- if (!pMsiEnumPatchesExA)
- {
- win_skip("MsiEnumPatchesExA not implemented\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
usersid = get_user_sid();
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod, &context,
- targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* garbage szProductCode */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod, &context,
- targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid without brackets */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
- 0, patchcode, targetprod, &context,
- targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSIPATCHSTATE_ALL, 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid with brackets */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA("{6700E8CF-95AB-4D9C-BC2C-15840DDA7A5D}", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
- 0, patchcode, targetprod, &context,
- targetsid, &size);
- ok(r == ERROR_NO_MORE_ITEMS,
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA("{6700E8CF-95AB-4D9C-BC2C-15840DDA7A5D}", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSIPATCHSTATE_ALL, 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szUserSid is S-1-5-18 */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, "S-1-5-18",
- MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
- 0, patchcode, targetprod, &context,
- targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, "S-1-5-18", MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is MSIINSTALLCONTEXT_MACHINE, but szUserSid is non-NULL */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_MACHINE,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is out of bounds */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, 0,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, 0, MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
+ &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is out of bounds */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_ALL + 1,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_ALL + 1, MSIPATCHSTATE_ALL, 0, patchcode,
+ targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwFilter is out of bounds */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_INVALID, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_INVALID,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwFilter is out of bounds */
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
size = MAX_PATH;
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL + 1, 0, patchcode, targetprod,
- &context, targetsid, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL + 1,
+ 0, patchcode, targetprod, &context, targetsid, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* pcchTargetUserSid is NULL while szTargetUserSid is non-NULL */
lstrcpyA(targetprod, "banana");
context = 0xdeadbeef;
lstrcpyA(targetsid, "kiwi");
- r = pMsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSIPATCHSTATE_ALL, 0, patchcode, targetprod,
- &context, targetsid, NULL);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patchcode, "apple"),
- "Expected patchcode to be unchanged, got %s\n", patchcode);
- ok(!lstrcmpA(targetprod, "banana"),
- "Expected targetprod to be unchanged, got %s\n", targetprod);
- ok(context == 0xdeadbeef,
- "Expected context to be unchanged, got %d\n", context);
- ok(!lstrcmpA(targetsid, "kiwi"),
- "Expected targetsid to be unchanged, got %s\n", targetsid);
+ r = MsiEnumPatchesExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_ALL,
+ 0, patchcode, targetprod, &context, targetsid, NULL);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patchcode, "apple"), "Expected patchcode to be unchanged, got %s\n", patchcode);
+ ok(!lstrcmpA(targetprod, "banana"), "Expected targetprod to be unchanged, got %s\n", targetprod);
+ ok(context == 0xdeadbeef, "Expected context to be unchanged, got %d\n", context);
+ ok(!lstrcmpA(targetsid, "kiwi"), "Expected targetsid to be unchanged, got %s\n", targetsid);
test_MsiEnumPatchesEx_usermanaged(usersid, usersid);
test_MsiEnumPatchesEx_usermanaged(NULL, usersid);
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 1);
+ res = RegSetValueExA(patches, "Patches", 0, REG_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not REG_MULTI_SZ */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION ||
- broken(r == ERROR_SUCCESS), /* Windows Installer < 3.0 */
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)"a\0b\0c\0\0", 7);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)"a\0b\0c\0\0", 7);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not a squashed guid */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = '\0';
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 2);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 2);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple") ||
- broken(!lstrcmpA(patch, patchcode)), /* Windows Installer < 3.0 */
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
- (const BYTE *)"whatever", 9);
+ res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ, (const BYTE *)"whatever", 9);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* patch squashed value exists */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
/* lpPatchBuf is NULL */
size = MAX_PATH;
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, NULL, transforms, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* lpTransformsBuf is NULL, pcchTransformsBuf is not */
size = MAX_PATH;
lstrcpyA(patch, "apple");
r = MsiEnumPatchesA(prodcode, 0, patch, NULL, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* pcchTransformsBuf is NULL, lpTransformsBuf is not */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, NULL);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
/* pcchTransformsBuf is too small */
size = 6;
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whate") ||
- broken(!lstrcmpA(transforms, "banana")), /* Windows Installer < 3.0 */
- "Expected \"whate\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whate"), "Expected \"whate\", got \"%s\"\n", transforms);
ok(size == 8 || size == 16, "Expected 8 or 16, got %lu\n", size);
/* increase the index */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 1, patch, transforms, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* increase again */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 2, patch, transforms, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
RegDeleteValueA(patches, "Patches");
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyA(prodkey, "Patches", &patches);
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 1);
+ res = RegSetValueExA(patches, "Patches", 0, REG_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not REG_MULTI_SZ */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION ||
- broken(r == ERROR_SUCCESS), /* Windows Installer < 3.0 */
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)"a\0b\0c\0\0", 7);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)"a\0b\0c\0\0", 7);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not a squashed guid */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = '\0';
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 2);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 2);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple") ||
- broken(!lstrcmpA(patch, patchcode)), /* Windows Installer < 3.0 */
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
- (const BYTE *)"whatever", 9);
+ res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ, (const BYTE *)"whatever", 9);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* patch code value exists */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_SUCCESS), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple") ||
- broken(!lstrcmpA(patch, patchcode)), /* Windows Installer < 3.0 */
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana") ||
- broken(!lstrcmpA(transforms, "whatever")), /* Windows Installer < 3.0 */
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
lstrcatA(keypath, patch_squashed);
res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &userkey, NULL);
+ if (res == ERROR_ACCESS_DENIED)
+ {
+ skip("Not enough rights to perform tests\n");
+ LocalFree(usersid);
+ return;
+ }
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* userdata patch key exists */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
- delete_key(userkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(userkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(userkey);
RegDeleteValueA(patches, patch_squashed);
RegDeleteValueA(patches, "Patches");
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(prodkey, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 1);
+ res = RegSetValueExA(patches, "Patches", 0, REG_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not REG_MULTI_SZ */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION ||
- broken(r == ERROR_SUCCESS), /* Windows Installer < 3.0 */
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)"a\0b\0c\0\0", 7);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)"a\0b\0c\0\0", 7);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists, is not a squashed guid */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
- ok(!lstrcmpA(patch, "apple"),
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
patch_squashed[lstrlenA(patch_squashed) + 1] = '\0';
- res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ,
- (const BYTE *)patch_squashed,
- lstrlenA(patch_squashed) + 2);
+ res = RegSetValueExA(patches, "Patches", 0, REG_MULTI_SZ, (const BYTE *)patch_squashed, lstrlenA(patch_squashed) + 2);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Patches value exists */
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_FILE_NOT_FOUND), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple") ||
- broken(!lstrcmpA(patch, patchcode)), /* Windows Installer < 3.0 */
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana"),
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ,
- (const BYTE *)"whatever", 9);
+ res = RegSetValueExA(patches, patch_squashed, 0, REG_SZ, (const BYTE *)"whatever", 9);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* patch code value exists */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &udpatch, NULL);
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
res = RegCreateKeyExA(udpatch, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
lstrcpyA(patch, "apple");
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
- ok(r == ERROR_NO_MORE_ITEMS ||
- broken(r == ERROR_SUCCESS), /* Windows Installer < 3.0 */
- "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
- ok(!lstrcmpA(patch, "apple") ||
- broken(!lstrcmpA(patch, patchcode)), /* Windows Installer < 3.0 */
- "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
- ok(!lstrcmpA(transforms, "banana") ||
- broken(!lstrcmpA(transforms, "whatever")), /* Windows Installer < 3.0 */
- "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
+ ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
+ ok(!lstrcmpA(patch, "apple"), "Expected lpPatchBuf to be unchanged, got \"%s\"\n", patch);
+ ok(!lstrcmpA(transforms, "banana"), "Expected lpTransformsBuf to be unchanged, got \"%s\"\n", transforms);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
data = MSIPATCHSTATE_APPLIED;
- res = RegSetValueExA(hpatch, "State", 0, REG_DWORD,
- (const BYTE *)&data, sizeof(DWORD));
+ res = RegSetValueExA(hpatch, "State", 0, REG_DWORD, (const BYTE *)&data, sizeof(DWORD));
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* State value exists */
lstrcpyA(transforms, "banana");
r = MsiEnumPatchesA(prodcode, 0, patch, transforms, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
/* now duplicate some of the tests for the W version */
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
WideCharToMultiByte( CP_ACP, 0, patchW, -1, patch, MAX_PATH, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, transformsW, -1, transforms, MAX_PATH, NULL, NULL );
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whate") ||
- broken(!lstrcmpA(transforms, "banana")), /* Windows Installer < 3.0 */
- "Expected \"whate\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whate"), "Expected \"whate\", got \"%s\"\n", transforms);
ok(size == 8, "Expected 8, got %lu\n", size);
/* patch code value exists */
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
WideCharToMultiByte( CP_ACP, 0, patchW, -1, patch, MAX_PATH, NULL, NULL );
WideCharToMultiByte( CP_ACP, 0, transformsW, -1, transforms, MAX_PATH, NULL, NULL );
- ok(!lstrcmpA(patch, patchcode),
- "Expected \"%s\", got \"%s\"\n", patchcode, patch);
- ok(!lstrcmpA(transforms, "whatever"),
- "Expected \"whatever\", got \"%s\"\n", transforms);
+ ok(!lstrcmpA(patch, patchcode), "Expected \"%s\", got \"%s\"\n", patchcode, patch);
+ ok(!lstrcmpA(transforms, "whatever"), "Expected \"whatever\", got \"%s\"\n", transforms);
ok(size == 8 || size == MAX_PATH, "Expected 8 or MAX_PATH, got %lu\n", size);
RegDeleteValueA(patches, patch_squashed);
RegDeleteValueA(patches, "Patches");
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
RegDeleteValueA(hpatch, "State");
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
LocalFree(usersid);
}
UINT r;
REGSAM access = KEY_ALL_ACCESS;
- if (!pMsiGetPatchInfoExA)
- {
- win_skip("MsiGetPatchInfoEx not implemented\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
create_test_guid(patchcode, patch_squashed);
usersid = get_user_sid();
/* NULL szPatchCode */
lstrcpyA(val, "apple");
size = MAX_PATH;
- r = pMsiGetPatchInfoExA(NULL, prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(NULL, prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* empty szPatchCode */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA("", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA("", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* garbage szPatchCode */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA("garbage", prodcode, NULL,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA("garbage", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid without brackets */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", prodcode,
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid with brackets */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", prodcode,
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA("{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* same length as guid, but random */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", prodcode,
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* NULL szProductCode */
lstrcpyA(val, "apple");
size = MAX_PATH;
- r = pMsiGetPatchInfoExA(patchcode, NULL, NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, NULL, NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* empty szProductCode */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, "", NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, "", NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* garbage szProductCode */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, "garbage", NULL,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, "garbage", NULL, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid without brackets */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, "6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D",
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, "6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* guid with brackets */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, "{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}",
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, "{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}", NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* same length as guid, but random */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, "A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93",
- NULL, MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, "A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szUserSid cannot be S-1-5-18 for MSIINSTALLCONTEXT_USERMANAGED */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18",
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18", MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szUserSid cannot be S-1-5-18 for MSIINSTALLCONTEXT_USERUNMANAGED */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18",
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18", MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szUserSid cannot be S-1-5-18 for MSIINSTALLCONTEXT_MACHINE */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18",
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, "S-1-5-18", MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* szUserSid must be NULL for MSIINSTALLCONTEXT_MACHINE */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is out of range */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_NONE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_NONE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is out of range */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_ALL,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_ALL, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* dwContext is invalid */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid, 3,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, 3, INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
/* MSIINSTALLCONTEXT_USERMANAGED */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
/* local UserData product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
/* InstallProperties key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCHA, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(patches, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\");
/* managed product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(prodkey, "Patches", 0, NULL, 0, access, NULL, &prodpatches, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
- res = RegSetValueExA(prodpatches, patch_squashed, 0, REG_SZ,
- (const BYTE *)"transforms", 11);
+ res = RegSetValueExA(prodpatches, patch_squashed, 0, REG_SZ, (const BYTE *)"transforms", 11);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* specific patch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
/* UserData Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
ok(size == 0, "Expected 0, got %lu\n", size);
- res = RegSetValueExA(udpatch, "ManagedLocalPackage", 0, REG_SZ,
- (const BYTE *)"pack", 5);
+ res = RegSetValueExA(udpatch, "ManagedLocalPackage", 0, REG_SZ, (const BYTE *)"pack", 5);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* ManagedLocalPatch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "transforms"), "Expected \"transforms\", got \"%s\"\n", val);
ok(size == 10, "Expected 10, got %lu\n", size);
- res = RegSetValueExA(hpatch, "Installed", 0, REG_SZ,
- (const BYTE *)"mydate", 7);
+ res = RegSetValueExA(hpatch, "Installed", 0, REG_SZ, (const BYTE *)"mydate", 7);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Installed value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_INSTALLDATEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_INSTALLDATEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "mydate"), "Expected \"mydate\", got \"%s\"\n", val);
ok(size == 6, "Expected 6, got %lu\n", size);
- res = RegSetValueExA(hpatch, "Uninstallable", 0, REG_SZ,
- (const BYTE *)"yes", 4);
+ res = RegSetValueExA(hpatch, "Uninstallable", 0, REG_SZ, (const BYTE *)"yes", 4);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Uninstallable value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_UNINSTALLABLEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_UNINSTALLABLEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "yes"), "Expected \"yes\", got \"%s\"\n", val);
ok(size == 3, "Expected 3, got %lu\n", size);
- res = RegSetValueExA(hpatch, "State", 0, REG_SZ,
- (const BYTE *)"good", 5);
+ res = RegSetValueExA(hpatch, "State", 0, REG_SZ, (const BYTE *)"good", 5);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* State value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PATCHSTATEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PATCHSTATEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "good"), "Expected \"good\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
size = 1;
- res = RegSetValueExA(hpatch, "State", 0, REG_DWORD,
- (const BYTE *)&size, sizeof(DWORD));
+ res = RegSetValueExA(hpatch, "State", 0, REG_DWORD, (const BYTE *)&size, sizeof(DWORD));
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* State value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_PATCHSTATEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_PATCHSTATEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "1"), "Expected \"1\", got \"%s\"\n", val);
ok(size == 1, "Expected 1, got %lu\n", size);
size = 1;
- res = RegSetValueExA(hpatch, "Uninstallable", 0, REG_DWORD,
- (const BYTE *)&size, sizeof(DWORD));
+ res = RegSetValueExA(hpatch, "Uninstallable", 0, REG_DWORD, (const BYTE *)&size, sizeof(DWORD));
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Uninstallable value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_UNINSTALLABLEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_UNINSTALLABLEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "1"), "Expected \"1\", got \"%s\"\n", val);
ok(size == 1, "Expected 1, got %lu\n", size);
- res = RegSetValueExA(hpatch, "DisplayName", 0, REG_SZ,
- (const BYTE *)"display", 8);
+ res = RegSetValueExA(hpatch, "DisplayName", 0, REG_SZ, (const BYTE *)"display", 8);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* DisplayName value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_DISPLAYNAMEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_DISPLAYNAMEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "display"), "Expected \"display\", got \"%s\"\n", val);
ok(size == 7, "Expected 7, got %lu\n", size);
- res = RegSetValueExA(hpatch, "MoreInfoURL", 0, REG_SZ,
- (const BYTE *)"moreinfo", 9);
+ res = RegSetValueExA(hpatch, "MoreInfoURL", 0, REG_SZ, (const BYTE *)"moreinfo", 9);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* MoreInfoURL value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "moreinfo"), "Expected \"moreinfo\", got \"%s\"\n", val);
ok(size == 8, "Expected 8, got %lu\n", size);
/* szProperty is invalid */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- "IDontExist", val, &size);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, "IDontExist", val, &size);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(!lstrcmpA(val, "apple"), "Expected \"apple\", got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* lpValue is NULL, while pcchValue is non-NULL */
size = MAX_PATH;
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, NULL, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ NULL, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 16, "Expected 16, got %lu\n", size);
/* pcchValue is NULL, while lpValue is non-NULL */
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, val, NULL);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ val, NULL);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(val, "apple"), "Expected \"apple\", got \"%s\"\n", val);
/* both lpValue and pcchValue are NULL */
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, NULL, NULL);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* pcchValue doesn't have enough room for NULL terminator */
size = 8;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ val, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
- ok(!lstrcmpA(val, "moreinf"),
- "Expected \"moreinf\", got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "moreinf"), "Expected \"moreinf\", got \"%s\"\n", val);
ok(size == 16, "Expected 16, got %lu\n", size);
/* pcchValue has exactly enough room for NULL terminator */
size = 9;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(val, "moreinfo"),
- "Expected \"moreinfo\", got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "moreinfo"), "Expected \"moreinfo\", got \"%s\"\n", val);
ok(size == 8, "Expected 8, got %lu\n", size);
/* pcchValue is too small, lpValue is NULL */
size = 0;
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_MOREINFOURLA, NULL, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_MOREINFOURLA,
+ NULL, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 16, "Expected 16, got %lu\n", size);
RegDeleteValueA(prodpatches, patch_squashed);
- delete_key(prodpatches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodpatches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodpatches);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* UserData is sufficient for all properties
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
ok(!lstrcmpA(val, "apple"), "Expected \"apple\", got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
RegDeleteValueA(hpatch, "Uninstallable");
RegDeleteValueA(hpatch, "Installed");
RegDeleteValueA(udpatch, "ManagedLocalPackage");
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
/* local UserData product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
/* InstallProperties key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(patches, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Installer\\Products\\");
/* current user product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyA(prodkey, "Patches", &prodpatches);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(prodpatches, patch_squashed, 0, REG_SZ,
/* specific patch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\");
/* UserData Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
ok(size == 0, "Expected 0, got %lu\n", size);
/* LocalPatch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "transforms"), "Expected \"transforms\", got \"%s\"\n", val);
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(prodpatches, patch_squashed);
- delete_key(prodpatches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodpatches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodpatches);
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
ok(!lstrcmpA(val, "apple"), "Expected \"apple\", got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
RegDeleteValueA(udpatch, "LocalPackage");
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
/* MSIINSTALLCONTEXT_MACHINE */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer");
/* local UserData product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "InstallProperties", 0, NULL, 0, access, NULL, &props, NULL);
/* InstallProperties key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(udprod, "Patches", 0, NULL, 0, access, NULL, &patches, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(patches, patch_squashed, 0, NULL, 0, access, NULL, &hpatch, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
/* local product key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegCreateKeyExA(prodkey, "Patches", 0, NULL, 0, access, NULL, &prodpatches, NULL);
/* Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
res = RegSetValueExA(prodpatches, patch_squashed, 0, REG_SZ,
/* specific patch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
- ok(!lstrcmpA(val, "apple"),
- "Expected val to be unchanged, got \"%s\"\n", val);
+ ok(!lstrcmpA(val, "apple"), "Expected val to be unchanged, got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size);
lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer");
/* UserData Patches key exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, ""), "Expected \"\", got \"%s\"\n", val);
ok(size == 0, "Expected 0, got %lu\n", size);
- res = RegSetValueExA(udpatch, "LocalPackage", 0, REG_SZ,
- (const BYTE *)"pack", 5);
+ res = RegSetValueExA(udpatch, "LocalPackage", 0, REG_SZ, (const BYTE *)"pack", 5);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* LocalPatch value exists */
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "transforms"), "Expected \"transforms\", got \"%s\"\n", val);
ok(size == 10, "Expected 10, got %lu\n", size);
RegDeleteValueA(prodpatches, patch_squashed);
- delete_key(prodpatches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodpatches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodpatches);
- delete_key(prodkey, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(prodkey, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(prodkey);
/* UserData is sufficient for all properties
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_LOCALPACKAGEA,
+ val, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(val, "pack"), "Expected \"pack\", got \"%s\"\n", val);
ok(size == 4, "Expected 4, got %lu\n", size);
*/
size = MAX_PATH;
lstrcpyA(val, "apple");
- r = pMsiGetPatchInfoExA(patchcode, prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_TRANSFORMSA, val, &size);
+ r = MsiGetPatchInfoExA(patchcode, prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, INSTALLPROPERTY_TRANSFORMSA,
+ val, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
ok(!lstrcmpA(val, "apple"), "Expected \"apple\", got \"%s\"\n", val);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
RegDeleteValueA(udpatch, "LocalPackage");
- delete_key(udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udpatch);
- delete_key(hpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hpatch);
- delete_key(patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(patches);
- delete_key(props, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(props, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(props);
- delete_key(udprod, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(udprod, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(udprod);
LocalFree(usersid);
}
ok(valW[0], "expected > 0 got %u\n", valW[0]);
ok(size == 11, "expected 11 got %lu\n", size);
- delete_key(hkey_udproductpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udproductpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udproductpatch);
- delete_key(hkey_udproductpatches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udproductpatches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udproductpatches);
- delete_key(hkey_udpatch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udpatch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udpatch);
- delete_key(hkey_udpatches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udpatches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udpatches);
- delete_key(hkey_udprops, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udprops, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udprops);
- delete_key(hkey_udproduct, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_udproduct, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_udproduct);
done:
- delete_key(hkey_patches, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_patches, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_patches);
- delete_key(hkey_product, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_product, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_product);
- delete_key(hkey_patch, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(hkey_patch, "", access & KEY_WOW64_64KEY, 0);
RegCloseKey(hkey_patch);
}
HKEY key1, key2, key3;
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip( "process is limited\n" );
return;
ros_skip_flaky
ok(found3, "product3 not found\n");
- delete_key(key1, "", access & KEY_WOW64_64KEY);
- delete_key(key2, "", access & KEY_WOW64_64KEY);
+ RegDeleteKeyExA(key1, "", access & KEY_WOW64_64KEY, 0);
+ RegDeleteKeyExA(key2, "", access & KEY_WOW64_64KEY, 0);
RegDeleteKeyA(key3, "");
RegCloseKey(key1);
RegCloseKey(key2);
char *usersid = get_user_sid();
BOOL found1, found2, found3;
- if (!pMsiEnumProductsExA)
- {
- win_skip("MsiEnumProductsExA not implemented\n");
- return;
- }
-
create_test_guid( product0, NULL );
create_test_guid( product1, product_squashed1 );
create_test_guid( product2, product_squashed2 );
r = RegCreateKeyExA( HKEY_USERS, keypath3, 0, NULL, 0, access, NULL, &key3, NULL );
ok( r == ERROR_SUCCESS, "got %u\n", r );
- r = pMsiEnumProductsExA( NULL, NULL, 0, 0, NULL, NULL, NULL, NULL );
+ r = MsiEnumProductsExA( NULL, NULL, 0, 0, NULL, NULL, NULL, NULL );
ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r );
len = sizeof(sid);
- r = pMsiEnumProductsExA( NULL, NULL, 0, 0, NULL, NULL, NULL, &len );
+ r = MsiEnumProductsExA( NULL, NULL, 0, 0, NULL, NULL, NULL, &len );
ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r );
ok( len == sizeof(sid), "got %lu\n", len );
- r = pMsiEnumProductsExA( NULL, NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, NULL, NULL );
+ r = MsiEnumProductsExA( NULL, NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, NULL, NULL );
ok( r == ERROR_SUCCESS, "got %u\n", r );
sid[0] = 0;
len = sizeof(sid);
- r = pMsiEnumProductsExA( product0, NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, &len );
+ r = MsiEnumProductsExA( product0, NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, &len );
ok( r == ERROR_NO_MORE_ITEMS, "got %u\n", r );
ok( len == sizeof(sid), "got %lu\n", len );
ok( !sid[0], "got %s\n", sid );
sid[0] = 0;
len = sizeof(sid);
- r = pMsiEnumProductsExA( product0, usersid, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, &len );
+ r = MsiEnumProductsExA( product0, usersid, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, &len );
ok( r == ERROR_NO_MORE_ITEMS, "got %u\n", r );
ok( len == sizeof(sid), "got %lu\n", len );
ok( !sid[0], "got %s\n", sid );
sid[0] = 0;
len = 0;
- r = pMsiEnumProductsExA( NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, 0, NULL, NULL, sid, &len );
+ r = MsiEnumProductsExA( NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, 0, NULL, NULL, sid, &len );
ok( r == ERROR_MORE_DATA, "got %u\n", r );
ok( len, "length unchanged\n" );
ok( !sid[0], "got %s\n", sid );
context = 0xdeadbeef;
sid[0] = 0;
len = sizeof(sid);
- r = pMsiEnumProductsExA( NULL, NULL, MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
+ r = MsiEnumProductsExA( NULL, NULL, MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
ok( r == ERROR_SUCCESS, "got %u\n", r );
ok( guid[0], "empty guid\n" );
ok( context != 0xdeadbeef, "context unchanged\n" );
context = 0xdeadbeef;
sid[0] = 0;
len = sizeof(sid);
- r = pMsiEnumProductsExA( NULL, usersid, MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
+ r = MsiEnumProductsExA( NULL, usersid, MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
ok( r == ERROR_SUCCESS, "got %u\n", r );
ok( guid[0], "empty guid\n" );
ok( context != 0xdeadbeef, "context unchanged\n" );
context = 0xdeadbeef;
sid[0] = 0;
len = sizeof(sid);
- r = pMsiEnumProductsExA( NULL, "S-1-1-0", MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
+ r = MsiEnumProductsExA( NULL, "S-1-1-0", MSIINSTALLCONTEXT_ALL, 0, guid, &context, sid, &len );
if (r == ERROR_ACCESS_DENIED)
{
skip( "insufficient rights\n" );
sid[0] = 0;
len = sizeof(sid);
found1 = found2 = found3 = FALSE;
- while (!pMsiEnumProductsExA( NULL, "S-1-1-0", MSIINSTALLCONTEXT_ALL, index, guid, &context, sid, &len ))
+ while (!MsiEnumProductsExA( NULL, "S-1-1-0", MSIINSTALLCONTEXT_ALL, index, guid, &context, sid, &len ))
{
if (!strcmp( product1, guid ))
{
ok(found3, "product3 not found\n");
done:
- delete_key( key1, "", access );
- delete_key( key2, "", access );
- delete_key( key3, "", access );
+ RegDeleteKeyExA( key1, "", access, 0 );
+ RegDeleteKeyExA( key2, "", access, 0 );
+ RegDeleteKeyExA( key3, "", access, 0 );
RegCloseKey( key1 );
RegCloseKey( key2 );
RegCloseKey( key3 );
char *usersid = get_user_sid();
HKEY key1 = NULL, key2 = NULL;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ok( found2, "comp2 not found\n" );
done:
- delete_key( key1, "", access );
- delete_key( key2, "", access );
+ RegDeleteKeyExA( key1, "", access, 0 );
+ RegDeleteKeyExA( key2, "", access, 0 );
RegCloseKey( key1 );
RegCloseKey( key2 );
LocalFree( usersid );
REGSAM access = KEY_ALL_ACCESS;
char *usersid = get_user_sid();
- if (!pMsiEnumComponentsExA)
- {
- win_skip( "MsiEnumComponentsExA not implemented\n" );
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
sid[0] = 0;
len = sizeof(sid);
found1 = found2 = FALSE;
- while (!pMsiEnumComponentsExA( "S-1-1-0", MSIINSTALLCONTEXT_ALL, index, guid, &context, sid, &len ))
+ while (!MsiEnumComponentsExA( "S-1-1-0", MSIINSTALLCONTEXT_ALL, index, guid, &context, sid, &len ))
{
if (!strcmp( comp1, guid ))
{
ok( found1, "comp1 not found\n" );
ok( found2, "comp2 not found\n" );
- r = pMsiEnumComponentsExA( NULL, 0, 0, NULL, NULL, NULL, NULL );
+ r = MsiEnumComponentsExA( NULL, 0, 0, NULL, NULL, NULL, NULL );
ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r );
- r = pMsiEnumComponentsExA( NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, NULL );
+ r = MsiEnumComponentsExA( NULL, MSIINSTALLCONTEXT_ALL, 0, NULL, NULL, sid, NULL );
ok( r == ERROR_INVALID_PARAMETER, "got %u\n", r );
done:
RegDeleteValueA( key2, comp_squashed2 );
- delete_key( key1, "", access );
- delete_key( key2, "", access );
+ RegDeleteKeyExA( key1, "", access, 0 );
+ RegDeleteKeyExA( key2, "", access, 0 );
RegCloseKey( key1 );
RegCloseKey( key2 );
LocalFree( usersid );
CHAR keypath[MAX_PATH * 2], localpackage[MAX_PATH], packagename[MAX_PATH];
REGSAM access = KEY_ALL_ACCESS;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
char path[MAX_PATH];
MSIHANDLE package;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
char title[32], help[32], path[MAX_PATH];
DWORD attrs, title_len, help_len;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
ret_a = MsiSetExternalUIA(NULL, 0, NULL);
ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a);
- /* Not present before Installer 3.1 */
- if (!pMsiSetExternalUIRecord) {
- win_skip("MsiSetExternalUIRecord is not available\n");
- return;
- }
-
- error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
+ error = MsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
ok(prev == NULL, "expected NULL, got %p\n", prev);
prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
- error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev);
+ error = MsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
- error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
+ error = MsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
ok(prev == NULL, "expected NULL, got %p\n", prev);
ok(ret_w == NULL, "expected NULL, got %p\n", ret_w);
prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef;
- error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev);
+ error = MsiSetExternalUIRecord(NULL, 0, NULL, &prev);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev);
- error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL);
+ error = MsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
- error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL);
+ error = MsiSetExternalUIRecord(NULL, 0, NULL, NULL);
ok(!error, "MsiSetExternalUIRecord failed %u\n", error);
}
DWORD size;
UINT r;
- if (!pMsiSourceListGetInfoA)
- {
- win_skip("MsiSourceListGetInfoA is not available\n");
- return;
- }
-
CreateDirectoryA("msitest", NULL);
create_file("maximus", 500);
create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
ok(!lstrcmpA(value, "aaa"), "expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
ok(!lstrcmpA(value, path), "expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
ok(!lstrcmpA(value, "aaa"), "expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
ok(!lstrcmpA(value, path), "expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
ok(!lstrcmpA(value, "aaa"), "expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r);
ok(!lstrcmpA(value, path), "expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
+ r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r);
ok(!lstrcmpA(value, "aaa"), "expected \"aaa\", got \"%s\"\n", value);
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
{
UINT r;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
CHAR path[MAX_PATH];
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
UINT r;
const char *cmd;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
}
#endif
- init_functionpointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
- if (pIsWow64Process)
- pIsWow64Process(GetCurrentProcess(), &is_wow64);
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
test_lastusedsource();
test_setpropertyfolder();
test_sourcedir_props();
- if (pMsiGetComponentPathExA)
- test_concurrentinstall();
+ test_concurrentinstall();
test_command_line_parsing();
test_MsiProvideQualifiedComponentEx();
#include <sddl.h>
#include "wine/test.h"
+#include "utils.h"
static BOOL is_wow64;
static const char msifile[] = "winetest-package.msi";
static const WCHAR msifileW[] = L"winetest-package.msi";
-static char CURR_DIR[MAX_PATH];
-
-static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
-static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
-
-static void init_functionpointers(void)
-{
- HMODULE hmsi = GetModuleHandleA("msi.dll");
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hsrclient = LoadLibraryA("srclient.dll");
-
-#define GET_PROC(mod, func) \
- p ## func = (void*)GetProcAddress(mod, #func);
-
- GET_PROC(hmsi, MsiGetComponentPathExA);
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hadvapi32, RegDeleteKeyExW)
- GET_PROC(hkernel32, IsWow64Process)
-
- GET_PROC(hsrclient, SRRemoveRestorePoint);
- GET_PROC(hsrclient, SRSetRestorePointA);
-
-#undef GET_PROC
-}
-
-static BOOL is_process_limited(void)
-{
- SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
- PSID Group = NULL;
- BOOL IsInGroup;
- HANDLE token;
-
- if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
- DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
- !CheckTokenMembership(NULL, Group, &IsInGroup))
- {
- trace("Could not check if the current user is an administrator\n");
- FreeSid(Group);
- return FALSE;
- }
- FreeSid(Group);
-
- if (!IsInGroup)
- {
- if (!AllocateAndInitializeSid(&NtAuthority, 2,
- SECURITY_BUILTIN_DOMAIN_RID,
- DOMAIN_ALIAS_RID_POWER_USERS,
- 0, 0, 0, 0, 0, 0, &Group) ||
- !CheckTokenMembership(NULL, Group, &IsInGroup))
- {
- trace("Could not check if the current user is a power user\n");
- return FALSE;
- }
- if (!IsInGroup)
- {
- /* Only administrators and power users can be powerful */
- return TRUE;
- }
- }
-
- if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
- {
- BOOL ret;
- TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
- DWORD size;
-
- ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
- CloseHandle(token);
- return (ret && type == TokenElevationTypeLimited);
- }
- return FALSE;
-}
-
-static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
static char *get_user_sid(void)
{
}
if (lpszSubKey)
- {
- if (pRegDeleteKeyExW)
- ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
- else
- ret = RegDeleteKeyW(hKey, lpszSubKey);
- }
+ ret = RegDeleteKeyExW(hKey, lpszSubKey, access, 0);
else
while (TRUE)
{
return ret;
}
-static UINT run_query( MSIHANDLE hdb, const char *query )
-{
- MSIHANDLE hview = 0;
- UINT r;
-
- r = MsiDatabaseOpenViewA(hdb, query, &hview);
- if( r != ERROR_SUCCESS )
- return r;
-
- r = MsiViewExecute(hview, 0);
- if( r == ERROR_SUCCESS )
- r = MsiViewClose(hview);
- MsiCloseHandle(hview);
- return r;
-}
-
static UINT create_component_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Component` ( "
"`Component` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38), "
static UINT create_feature_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Feature` ( "
"`Feature` CHAR(38) NOT NULL, "
"`Feature_Parent` CHAR(38), "
static UINT create_feature_components_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `FeatureComponents` ( "
"`Feature_` CHAR(38) NOT NULL, "
"`Component_` CHAR(72) NOT NULL "
static UINT create_file_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `File` ("
"`File` CHAR(72) NOT NULL, "
"`Component_` CHAR(72) NOT NULL, "
static UINT create_remove_file_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `RemoveFile` ("
"`FileKey` CHAR(72) NOT NULL, "
"`Component_` CHAR(72) NOT NULL, "
static UINT create_appsearch_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `AppSearch` ("
"`Property` CHAR(72) NOT NULL, "
"`Signature_` CHAR(72) NOT NULL "
static UINT create_reglocator_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `RegLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`Root` SHORT NOT NULL, "
static UINT create_signature_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Signature` ("
"`Signature` CHAR(72) NOT NULL, "
"`FileName` CHAR(255) NOT NULL, "
static UINT create_launchcondition_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `LaunchCondition` ("
"`Condition` CHAR(255) NOT NULL, "
"`Description` CHAR(255) NOT NULL "
static UINT create_property_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Property` ("
"`Property` CHAR(72) NOT NULL, "
"`Value` CHAR(0) "
static UINT create_install_execute_sequence_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `InstallExecuteSequence` ("
"`Action` CHAR(72) NOT NULL, "
"`Condition` CHAR(255), "
static UINT create_install_ui_sequence_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `InstallUISequence` ("
"`Action` CHAR(72) NOT NULL, "
"`Condition` CHAR(255), "
static UINT create_media_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Media` ("
"`DiskId` SHORT NOT NULL, "
"`LastSequence` SHORT NOT NULL, "
static UINT create_ccpsearch_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `CCPSearch` ("
"`Signature_` CHAR(72) NOT NULL "
"PRIMARY KEY `Signature_`)" );
static UINT create_drlocator_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `DrLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`Parent` CHAR(72), "
static UINT create_complocator_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `CompLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38) NOT NULL, "
static UINT create_inilocator_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `IniLocator` ("
"`Signature_` CHAR(72) NOT NULL, "
"`FileName` CHAR(255) NOT NULL, "
static UINT create_custom_action_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `CustomAction` ("
"`Action` CHAR(72) NOT NULL, "
"`Type` SHORT NOT NULL, "
static UINT create_dialog_table( MSIHANDLE hdb )
{
- UINT r = run_query(hdb,
+ UINT r = run_query(hdb, 0,
"CREATE TABLE `Dialog` ("
"`Dialog` CHAR(72) NOT NULL, "
"`HCentering` SHORT NOT NULL, "
static UINT create_control_table( MSIHANDLE hdb )
{
- UINT r = run_query(hdb,
+ UINT r = run_query(hdb, 0,
"CREATE TABLE `Control` ("
"`Dialog_` CHAR(72) NOT NULL, "
"`Control` CHAR(50) NOT NULL, "
static UINT create_controlevent_table( MSIHANDLE hdb )
{
- UINT r = run_query(hdb,
+ UINT r = run_query(hdb, 0,
"CREATE TABLE `ControlEvent` ("
"`Dialog_` CHAR(72) NOT NULL, "
"`Control_` CHAR(50) NOT NULL, "
static UINT create_actiontext_table( MSIHANDLE hdb )
{
- UINT r = run_query(hdb,
+ UINT r = run_query(hdb, 0,
"CREATE TABLE `ActionText` ("
"`Action` CHAR(72) NOT NULL, "
"`Description` CHAR(64) LOCALIZABLE, "
static UINT create_upgrade_table( MSIHANDLE hdb )
{
- UINT r = run_query( hdb,
+ UINT r = run_query( hdb, 0,
"CREATE TABLE `Upgrade` ("
"`UpgradeCode` CHAR(38) NOT NULL, "
"`VersionMin` CHAR(20), "
sz = strlen(values) + strlen(insert) + 1;
query = malloc(sz);
sprintf(query, insert, values);
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
free(query);
ok_(file, line)(r == ERROR_SUCCESS, "failed to insert into %s table: %u\n", type, r);
return r;
sz = strlen( sig ) + 10 + strlen( path ) + strlen( name ) + 10 + sizeof( insert );
query = malloc( sz );
sprintf( query, insert, sig, root, path, name, type );
- r = run_query( hdb, query );
+ r = run_query( hdb, 0, query );
free( query );
ok(r == ERROR_SUCCESS, "failed to insert into reglocator table: %u\n", r); \
return r;
res = set_summary_info(hdb);
ok( res == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", res);
- res = run_query( hdb,
+ res = run_query( hdb, 0,
"CREATE TABLE `Directory` ( "
"`Directory` CHAR(255) NOT NULL, "
"`Directory_Parent` CHAR(255), "
return ERROR_SUCCESS;
}
-static void create_file_data(LPCSTR name, LPCSTR data)
-{
- HANDLE file;
- DWORD written;
-
- file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
- if (file == INVALID_HANDLE_VALUE)
- return;
-
- WriteFile(file, data, strlen(data), &written, NULL);
- WriteFile(file, "\n", strlen("\n"), &written, NULL);
-
- CloseHandle(file);
-}
-
static void create_test_file(const CHAR *name)
{
- create_file_data(name, name);
+ create_file_data(name, name, strlen(name));
}
typedef struct _tagVS_VERSIONINFO
return ret;
}
-static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
-{
- RESTOREPOINTINFOA spec;
-
- spec.dwEventType = event_type;
- spec.dwRestorePtType = APPLICATION_INSTALL;
- spec.llSequenceNumber = status->llSequenceNumber;
- lstrcpyA(spec.szDescription, "msitest restore point");
-
- return pSRSetRestorePointA(&spec, status);
-}
-
-static void remove_restore_point(DWORD seq_number)
-{
- DWORD res;
-
- res = pSRRemoveRestorePoint(seq_number);
- if (res != ERROR_SUCCESS)
- trace("Failed to remove the restore point: %#lx\n", res);
-}
-
static BOOL is_root(const char *path)
{
return (isalpha(path[0]) && path[1] == ':' && path[2] == '\\' && !path[3]);
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<\"\xe5\"");
- ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
- "wrong return val (%d)\n", r);
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\">\"\xe5\"");
- ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
- "wrong return val (%d)\n", r);
+ ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<>\"\xe5\"");
- ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
- "wrong return val (%d)\n", r);
+ ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"=\"\xe5\"");
- ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
- "wrong return val (%d)\n", r);
+ ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
MsiCloseHandle( hpkg );
DeleteFileA(msifile);
}
-static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case)
+static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int match_case, int todo_value)
{
char buffer[MAX_PATH] = "x";
DWORD sz = sizeof(buffer);
ok(!r, "'%s': got %u\n", prop, r);
ok(sz == lstrlenA(buffer), "'%s': expected %u, got %lu\n", prop, lstrlenA(buffer), sz);
if (match_case)
- ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
+ todo_wine_if (todo_value) ok(!strcmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
else
- ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
+ todo_wine_if (todo_value) ok(!_stricmp(buffer, expect), "'%s': expected '%s', got '%s'\n", prop, expect, buffer);
}
static void test_props(void)
r = MsiSetPropertyA( hpkg, "=", "asdf" );
ok(!r, "got %u\n", r);
- check_prop(hpkg, "=", "asdf", 1);
+ check_prop(hpkg, "=", "asdf", 1, 0);
r = MsiSetPropertyA( hpkg, " ", "asdf" );
ok(!r, "got %u\n", r);
- check_prop(hpkg, " ", "asdf", 1);
+ check_prop(hpkg, " ", "asdf", 1, 0);
r = MsiSetPropertyA( hpkg, "'", "asdf" );
ok(!r, "got %u\n", r);
- check_prop(hpkg, "'", "asdf", 1);
+ check_prop(hpkg, "'", "asdf", 1, 0);
/* set empty values */
r = MsiSetPropertyA( hpkg, "boo", NULL );
ok(!r, "got %u\n", r);
- check_prop(hpkg, "boo", "", 1);
+ check_prop(hpkg, "boo", "", 1, 0);
r = MsiSetPropertyA( hpkg, "boo", "" );
ok(!r, "got %u\n", r);
- check_prop(hpkg, "boo", "", 1);
+ check_prop(hpkg, "boo", "", 1, 0);
/* set a non-empty value */
r = MsiSetPropertyA( hpkg, "boo", "xyz" );
ok(!r, "got %u\n", r);
- check_prop(hpkg, "boo", "xyz", 1);
+ check_prop(hpkg, "boo", "xyz", 1, 0);
r = MsiGetPropertyA(hpkg, "boo", NULL, NULL);
ok(!r, "got %u\n", r);
ok(sz == 3, "got size %lu\n", sz);
/* properties are case-sensitive */
- check_prop(hpkg, "BOO", "", 1);
+ check_prop(hpkg, "BOO", "", 1, 0);
/* properties set in Property table should work */
- check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1);
+ check_prop(hpkg, "MetadataCompName", "Photoshop.dll", 1, 0);
MsiCloseHandle( hpkg );
DeleteFileA(msifile);
query = "CREATE TABLE `_Property` ( "
"`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
MsiCloseHandle(hdb);
query = "CREATE TABLE `_Property` ( "
"`foo` INT NOT NULL, `bar` INT LOCALIZABLE PRIMARY KEY `foo`)";
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to create table\n");
query = "ALTER `_Property` ADD `foo` INTEGER";
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
query = "ALTER TABLE `_Property` ADD `foo` INTEGER";
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to add column\n");
query = "ALTER TABLE `_Property` ADD `extra` INTEGER";
- r = run_query(hdb, query);
+ r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to add column\n");
sprintf(package, "#%lu", hdb);
MSIHANDLE hpkg, hprod;
UINT r;
MSIHANDLE hdb;
- BOOL is_broken;
char value[MAX_PATH];
DWORD size;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
/* reinstall the product */
r = MsiInstallProductA(msifile3, "REINSTALL=ALL");
- is_broken = (r == ERROR_INSTALL_FAILURE);
- ok(r == ERROR_SUCCESS || broken(is_broken) /* win2k3 */, "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "five");
ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
MsiCloseHandle( hpkg );
r = MsiInstallProductA(msifile, "");
- ok(r == ERROR_SUCCESS || (is_broken && r == ERROR_INSTALL_FAILURE) /* win2k3 */,
- "Expected ERROR_SUCCESS, got %d\n", r);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "one");
ok(state == INSTALLSTATE_SOURCE, "state = %d\n", state);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "two");
MsiCloseHandle( hpkg );
DeleteFileA(msifile);
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Winetest_msi");
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_32KEY);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_64KEY);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_32KEY, 0);
+ RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_64KEY, 0);
}
static void test_appsearch_complocator(void)
if (!(usersid = get_user_sid()))
return;
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
users = 0;
res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
- ok(res == ERROR_SUCCESS ||
- broken(res == ERROR_INVALID_PARAMETER),
- "Expected ERROR_SUCCESS, got %ld\n", res);
+ ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
if (res == ERROR_SUCCESS)
{
memset(&si, 0, sizeof(si));
GetNativeSystemInfo(&si);
- if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{
size = ExpandEnvironmentStringsA("%PATH%", NULL, 0);
pathvar = malloc(size);
}
ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r);
+ MsiCloseHandle( hdb );
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiDoActionA(hpkg, "AppSearch");
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
+ if (!prop[0])
+ {
+ win_skip("broken result\n");
+ MsiCloseHandle(hpkg);
+ goto error;
+ }
ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop);
size = MAX_PATH;
CHAR path[MAX_PATH], buf[MAX_PATH];
DWORD size, type;
LANGID langid;
- HKEY hkey1, hkey2, pathkey;
+ HKEY hkey1, hkey2, pathkey = NULL;
int res;
UINT r;
REGSAM access = KEY_ALL_ACCESS;
ok( !lstrcmpA(buf, path), "Expected %s, got %s\n", path, buf);
RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1);
- RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
+ res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2);
+ if (res == ERROR_ACCESS_DENIED)
+ {
+ win_skip("no access\n");
+ goto done;
+ }
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &pathkey);
GetNativeSystemInfo(&si);
sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
- check_prop(hpkg, "VersionNT", buf, 1);
+ check_prop(hpkg, "VersionNT", buf, 1, 1);
- if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
{
sprintf(buf, "%d", si.wProcessorLevel);
- check_prop(hpkg, "Intel", buf, 1);
- check_prop(hpkg, "MsiAMD64", buf, 1);
- check_prop(hpkg, "Msix64", buf, 1);
+ check_prop(hpkg, "Intel", buf, 1, 0);
+ check_prop(hpkg, "MsiAMD64", buf, 1, 0);
+ check_prop(hpkg, "Msix64", buf, 1, 0);
sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion())));
- check_prop(hpkg, "VersionNT64", buf, 1);
+ check_prop(hpkg, "VersionNT64", buf, 1, 1);
GetSystemDirectoryA(path, MAX_PATH);
strcat(path, "\\");
- check_prop(hpkg, "System64Folder", path, 0);
+ check_prop(hpkg, "System64Folder", path, 0, 0);
GetSystemWow64DirectoryA(path, MAX_PATH);
strcat(path, "\\");
- check_prop(hpkg, "SystemFolder", path, 0);
+ check_prop(hpkg, "SystemFolder", path, 0, 0);
size = MAX_PATH;
r = RegQueryValueExA(pathkey, "ProgramFilesDir (x86)", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "ProgramFilesFolder", path, 0);
+ check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
size = MAX_PATH;
RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "ProgramFiles64Folder", path, 0);
+ check_prop(hpkg, "ProgramFiles64Folder", path, 0, 0);
size = MAX_PATH;
RegQueryValueExA(pathkey, "CommonFilesDir (x86)", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "CommonFilesFolder", path, 0);
+ check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
size = MAX_PATH;
RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "CommonFiles64Folder", path, 0);
+ check_prop(hpkg, "CommonFiles64Folder", path, 0, 0);
}
- else if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{
sprintf(buf, "%d", si.wProcessorLevel);
- check_prop(hpkg, "Intel", buf, 1);
+ check_prop(hpkg, "Intel", buf, 1, 0);
GetSystemDirectoryA(path, MAX_PATH);
strcat(path, "\\");
- check_prop(hpkg, "SystemFolder", path, 0);
+ check_prop(hpkg, "SystemFolder", path, 0, 0);
size = MAX_PATH;
RegQueryValueExA(pathkey, "ProgramFilesDir", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "ProgramFilesFolder", path, 0);
+ check_prop(hpkg, "ProgramFilesFolder", path, 0, 0);
size = MAX_PATH;
RegQueryValueExA(pathkey, "CommonFilesDir", 0, &type, (BYTE *)path, &size);
strcat(path, "\\");
- check_prop(hpkg, "CommonFilesFolder", path, 0);
-
- check_prop(hpkg, "MsiAMD64", "", 1);
- check_prop(hpkg, "Msix64", "", 1);
- check_prop(hpkg, "VersionNT64", "", 1);
- check_prop(hpkg, "System64Folder", "", 0);
- check_prop(hpkg, "ProgramFiles64Dir", "", 0);
- check_prop(hpkg, "CommonFiles64Dir", "", 0);
+ check_prop(hpkg, "CommonFilesFolder", path, 0, 0);
+
+ check_prop(hpkg, "MsiAMD64", "", 1, 0);
+ check_prop(hpkg, "Msix64", "", 1, 0);
+ check_prop(hpkg, "VersionNT64", "", 1, 0);
+ check_prop(hpkg, "System64Folder", "", 0, 0);
+ check_prop(hpkg, "ProgramFiles64Dir", "", 0, 0);
+ check_prop(hpkg, "CommonFiles64Dir", "", 0, 0);
}
+done:
CloseHandle(hkey1);
CloseHandle(hkey2);
RegCloseKey(pathkey);
r = set_summary_info(hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = run_query(hdb,
+ r = run_query(hdb, 0,
"CREATE TABLE `Directory` ( "
"`Directory` CHAR(255) NOT NULL, "
"`Directory_Parent` CHAR(255), "
skip("Not enough rights to perform tests\n");
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
+ DeleteFileA(msifile);
return;
}
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
lstrcpyA(val, path);
lstrcatA(val, "\\");
lstrcatA(val, msifile);
- res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
- (const BYTE *)val, lstrlenA(val) + 1);
+ res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, (const BYTE *)val, lstrlenA(val) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
hprod = 0xdeadbeef;
r = MsiOpenProductA(prodcode, &hprod);
+ if (r == ERROR_UNKNOWN_PRODUCT)
+ {
+ win_skip("broken result, skipping tests\n");
+ goto done;
+ }
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
"Expected %d, got %lu\n", lstrlenW(prodcodeW), size);
MsiCloseHandle(hprod);
-
+done:
RegDeleteValueA(props, "LocalPackage");
- delete_key(props, "", access);
+ RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
- delete_key(userkey, "", access);
+ RegDeleteKeyExA(userkey, "", access, 0);
RegCloseKey(userkey);
- delete_key(prodkey, "", access);
+ RegDeleteKeyExA(prodkey, "", access, 0);
RegCloseKey(prodkey);
DeleteFileA(msifile);
}
add_media_entry( hdb, "'1', '2', 'cabinet', '', '', ''");
create_file_table( hdb );
- add_file_entry( hdb, "'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1" );
+ add_file_entry( hdb, "'a.txt', 'one', 'a.txt', 2048000000, '', '', 8192, 1" );
+ add_file_entry( hdb, "'b.txt', 'one', 'b.txt', 2048000000, '', '', 8192, 1" );
+ add_file_entry( hdb, "'c.txt', 'one', 'c.txt', 2048000000, '', '', 8192, 1" );
+ add_file_entry( hdb, "'d.txt', 'one', 'd.txt', 4097, '', '', 8192, 1" );
+ add_file_entry( hdb, "'e.txt', 'one', 'e.txt', 1, '', '', 8192, 1" );
create_component_table( hdb );
- add_component_entry( hdb, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'" );
+ add_component_entry( hdb, "'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'a.txt'" );
add_component_entry( hdb, "'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', ''" );
create_feature_table( hdb );
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
ok( len == 2, "expected len == 2, got %lu\n", len );
ok( drive[0], "expected a drive\n" );
- ok( cost && cost != 0xdead, "expected cost > 0, got %d\n", cost );
+ ok( cost == 12000024, "got %d\n", cost );
ok( !temp, "expected temp == 0, got %d\n", temp );
len = sizeof(drive);
ok( len == 2, "expected len == 2, got %lu\n", len );
ok( drive[0], "expected a drive\n" );
ok( !cost, "expected cost == 0, got %d\n", cost );
- ok( temp && temp != 0xdead, "expected temp > 0, got %d\n", temp );
+ todo_wine ok( temp && temp != 0xdead, "expected temp > 0, got %d\n", temp );
/* increased index */
len = sizeof(drive);
cost = 0xdead;
r = MsiGetFeatureCostA( hpkg, "one", MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &cost );
ok( !r, "got %u\n", r);
- ok( cost == 8, "got %d\n", cost );
+ ok( cost == 12000024, "got %d\n", cost );
MsiCloseHandle( hpkg );
error:
hdb = create_package_db();
ok(hdb, "failed to create database\n");
- create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n");
+ create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n", sizeof("\r\n\r\n1252\t_ForceCodepage\r\n") - 1);
r = MsiDatabaseImportA(hdb, CURR_DIR, "forcecodepage.idt");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = run_query(hdb, "CREATE TABLE `Error` (`Error` SHORT NOT NULL, `Message` CHAR(0) PRIMARY KEY `Error`)");
+ r = run_query(hdb, 0, "CREATE TABLE `Error` (`Error` SHORT NOT NULL, `Message` CHAR(0) PRIMARY KEY `Error`)");
ok(r == ERROR_SUCCESS, "Failed to create Error table: %u\n", r);
- r = run_query(hdb, "INSERT INTO `Error` (`Error`, `Message`) VALUES (5, 'internal error')");
+ r = run_query(hdb, 0, "INSERT INTO `Error` (`Error`, `Message`) VALUES (5, 'internal error')");
ok(r == ERROR_SUCCESS, "Failed to insert into Error table: %u\n", r);
create_actiontext_table(hdb);
hdb = create_package_db();
ok(hdb, "failed to create database\n");
- create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n");
+ create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n", sizeof("\r\n\r\n1252\t_ForceCodepage\r\n") - 1);
r = MsiDatabaseImportA(hdb, CURR_DIR, "forcecodepage.idt");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
hdb = create_package_db();
ok(hdb, "failed to create database\n");
- create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n");
+ create_file_data("forcecodepage.idt", "\r\n\r\n1252\t_ForceCodepage\r\n", sizeof("\r\n\r\n1252\t_ForceCodepage\r\n") -1 );
r = MsiDatabaseImportA(hdb, CURR_DIR, "forcecodepage.idt");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
START_TEST(package)
{
char temp_path[MAX_PATH], prev_path[MAX_PATH];
- STATEMGRSTATUS status;
- BOOL ret = FALSE;
DWORD len;
- init_functionpointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
- if (pIsWow64Process)
- pIsWow64Process(GetCurrentProcess(), &is_wow64);
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
if (len && (CURR_DIR[len - 1] == '\\'))
CURR_DIR[len - 1] = 0;
- /* Create a restore point ourselves so we circumvent the multitude of restore points
- * that would have been created by all the installation and removal tests.
- *
- * This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
- * creation of restore points.
- */
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
- {
- memset(&status, 0, sizeof(status));
- ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
- }
-
test_createpackage();
test_doaction();
test_gettargetpath_bad();
test_controlevent();
test_top_level_action();
- if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
- {
- ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
- if (ret)
- remove_restore_point(status.llSequenceNumber);
- }
-
SetCurrentDirectoryA(prev_path);
}
#include <wtypes.h>
#include "wine/test.h"
-
-static UINT (WINAPI *pMsiApplyPatchA)( LPCSTR, LPCSTR, INSTALLTYPE, LPCSTR );
-static UINT (WINAPI *pMsiGetPatchInfoExA)( LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT,
- LPCSTR, LPSTR, DWORD * );
-static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR,
- LPSTR, MSIINSTALLCONTEXT *, LPSTR, LPDWORD );
+#include "utils.h"
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
static const WCHAR msifileW[] = L"winetest-patch.msi";
static const WCHAR mspfileW[] = L"winetest-patch.msp";
-static char CURR_DIR[MAX_PATH];
-static char PROG_FILES_DIR[MAX_PATH];
-static char COMMON_FILES_DIR[MAX_PATH];
-
/* msi database data */
static const char property_dat[] =
int size;
};
-#define ADD_TABLE( x ) { #x".idt", x##_dat, sizeof(x##_dat) }
-
static const struct msi_table tables[] =
{
ADD_TABLE( directory ),
ADD_TABLE( condition )
};
-static void init_function_pointers( void )
-{
- HMODULE hmsi = GetModuleHandleA( "msi.dll" );
-
-#define GET_PROC( mod, func ) \
- p ## func = (void *)GetProcAddress( mod, #func ); \
- if (!p ## func) \
- trace( "GetProcAddress(%s) failed\n", #func );
-
- GET_PROC( hmsi, MsiApplyPatchA );
- GET_PROC( hmsi, MsiGetPatchInfoExA );
- GET_PROC( hmsi, MsiEnumPatchesExA );
-
-#undef GET_PROC
-}
-
-static BOOL is_process_limited(void)
-{
- HANDLE token;
-
- if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
- {
- BOOL ret;
- TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
- DWORD size;
-
- ret = GetTokenInformation(token, TokenElevationType, &type, sizeof(type), &size);
- CloseHandle(token);
- return (ret && type == TokenElevationTypeLimited);
- }
- return FALSE;
-}
-
static BOOL get_program_files_dir( char *buf, char *buf2 )
{
HKEY hkey;
return TRUE;
}
-static void create_file_data( const char *filename, const char *data, DWORD size )
-{
- HANDLE file;
- DWORD written;
-
- file = CreateFileA( filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL );
- if (file == INVALID_HANDLE_VALUE)
- return;
-
- WriteFile( file, data, strlen( data ), &written, NULL );
- if (size)
- {
- SetFilePointer( file, size, NULL, FILE_BEGIN );
- SetEndOfFile( file );
- }
- CloseHandle( file );
-}
-
-#define create_file( name, size ) create_file_data( name, name, size )
-
-static BOOL delete_pf( const char *rel_path, BOOL is_file )
-{
- char path[MAX_PATH];
-
- strcpy( path, PROG_FILES_DIR );
- strcat( path, "\\" );
- strcat( path, rel_path );
-
- if (is_file)
- return DeleteFileA( path );
- else
- return RemoveDirectoryA( path );
-}
-
static DWORD get_pf_file_size( const char *filename )
{
char path[MAX_PATH];
ok( r == ERROR_SUCCESS, "failed to close database %u\n", r );
}
-static void create_database( const char *filename, const struct msi_table *tables, UINT num_tables )
+static void create_database_suminfo( const char *filename, const struct msi_table *tables, UINT num_tables )
{
MSIHANDLE hdb;
UINT r, i;
WCHAR pathW[MAX_PATH];
MSIHANDLE hpackage, hdb, hview, hrec;
- if (!pMsiApplyPatchA)
- {
- win_skip("MsiApplyPatchA is not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, ARRAY_SIZE(tables) );
+ create_database_suminfo( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
MsiCloseHandle( hpackage );
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
- ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
- "expected ERROR_SUCCESS, got %u\n", r );
-
- if (r == ERROR_PATCH_PACKAGE_INVALID)
- {
- win_skip("Windows Installer < 3.0 detected\n");
- goto uninstall;
- }
+ ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
size = get_pf_file_size( "msitest\\patch.txt" );
ok( size == 1002, "expected 1002, got %lu\n", size );
MsiCloseHandle( hview );
MsiCloseHandle( hdb );
-uninstall:
size = sizeof(path);
r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
"InstallSource", path, &size );
MsiCloseHandle( hdb );
DeleteFileA( mspfile );
- create_database( msifile, tables, ARRAY_SIZE(tables) );
+ create_database_suminfo( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
r = MsiOpenDatabaseW( msifileW, MSIDBOPEN_READONLY + MSIDBOPEN_PATCHFILE, &hdb );
const char *query;
MSIHANDLE hproduct, hdb, hview, hrec;
- if (!pMsiApplyPatchA)
- {
- win_skip("MsiApplyPatchA is not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, ARRAY_SIZE(tables) );
+ create_database_suminfo( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
MsiCloseHandle( hproduct );
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
- ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
- "expected ERROR_SUCCESS, got %u\n", r );
-
- if (r == ERROR_PATCH_PACKAGE_INVALID)
- {
- win_skip("Windows Installer < 3.0 detected\n");
- goto uninstall;
- }
+ ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
r = MsiOpenProductA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}", &hproduct );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
MsiCloseHandle( hdb );
MsiCloseHandle( hproduct );
-uninstall:
r = MsiInstallProductA( msifile, "REMOVE=ALL" );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
DWORD size;
char buffer[MAX_PATH], patch_code[39];
- if (!pMsiApplyPatchA || !pMsiGetPatchInfoExA || !pMsiEnumPatchesExA)
- {
- win_skip("required functions not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, ARRAY_SIZE(tables) );
+ create_database_suminfo( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
}
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
- ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
- "expected ERROR_SUCCESS, got %u\n", r );
-
- if (r == ERROR_PATCH_PACKAGE_INVALID)
- {
- win_skip("Windows Installer < 3.0 detected\n");
- goto uninstall;
- }
+ ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
- r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
- "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
+ r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
+ "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( buffer[0], "buffer empty\n" );
buffer[0] = 0;
size = sizeof(buffer);
- r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
- "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_MACHINE,
- INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
+ r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
+ "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_MACHINE,
+ INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
- r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
- "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
+ "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( !buffer[0], "got %s\n", buffer );
- r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
- 0, patch_code, NULL, NULL, NULL, NULL );
+ r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( !strcmp( patch_code, "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}" ), "wrong patch code\n" );
- r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
- 0, patch_code, NULL, NULL, NULL, NULL );
+ r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
+ 0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
- r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
- 0, patch_code, NULL, NULL, NULL, NULL );
+ r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
+ 0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
-uninstall:
r = MsiInstallProductA( msifile, "REMOVE=ALL" );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
- r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
- "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
- NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
- INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
+ r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
+ "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
+ NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
cleanup:
DWORD len;
char temp_path[MAX_PATH], prev_path[MAX_PATH];
- init_function_pointers();
+ if (!is_process_elevated()) restart_as_admin_elevated();
GetCurrentDirectoryA( MAX_PATH, prev_path );
GetTempPathA( MAX_PATH, temp_path );
i = MsiRecordSetStringA(h,0,"42");
ok(i == ERROR_SUCCESS, "Failed to set string at 0\n");
i = MsiRecordGetInteger(h, 0);
- ok(i == 42, "should get invalid integer\n");
+ ok(i == 42, "should get 42\n");
i = MsiRecordSetStringA(h,0,"-42");
ok(i == ERROR_SUCCESS, "Failed to set string at 0\n");
i = MsiRecordGetInteger(h, 0);
- ok(i == -42, "should get invalid integer\n");
+ ok(i == -42, "should get -42\n");
i = MsiRecordSetStringA(h,0," 42");
ok(i == ERROR_SUCCESS, "Failed to set string at 0\n");
i = MsiRecordGetInteger(h, 0);
ok(r == ERROR_SUCCESS, "failed to add stream to record\n");
r = MsiRecordReadStream(h, 1, buf, NULL);
ok(r == ERROR_INVALID_PARAMETER, "should return error\n");
- DeleteFileA(filename); /* Windows 98 doesn't like this at all, so don't check return. */
+ DeleteFileA(filename);
r = MsiRecordReadStream(h, 1, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "should return error\n");
sz = sizeof buf;
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep testdll
+#endif
+
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
static BOOL is_wow64;
-static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-
-static UINT (WINAPI *pMsiSourceListAddMediaDiskA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPCSTR, LPCSTR);
-static UINT (WINAPI *pMsiSourceListAddSourceExA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, DWORD);
-static UINT (WINAPI *pMsiSourceListEnumMediaDisksA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPDWORD, LPSTR,
- LPDWORD, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiSourceListEnumSourcesA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiSourceListGetInfoA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
-static UINT (WINAPI *pMsiSourceListGetInfoW)
- (LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, DWORD, LPCWSTR, LPWSTR, LPDWORD);
-static UINT (WINAPI *pMsiSourceListSetInfoA)
- (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD,LPCSTR, LPCSTR);
-static UINT (WINAPI *pMsiSourceListAddSourceA)
- (LPCSTR, LPCSTR, DWORD, LPCSTR);
-
-static void init_functionpointers(void)
-{
- HMODULE hmsi = GetModuleHandleA("msi.dll");
- HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
- HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
-
-#define GET_PROC(dll, func) \
- p ## func = (void *)GetProcAddress(dll, #func); \
- if(!p ## func) \
- trace("GetProcAddress(%s) failed\n", #func);
-
- GET_PROC(hmsi, MsiSourceListAddMediaDiskA)
- GET_PROC(hmsi, MsiSourceListAddSourceExA)
- GET_PROC(hmsi, MsiSourceListEnumMediaDisksA)
- GET_PROC(hmsi, MsiSourceListEnumSourcesA)
- GET_PROC(hmsi, MsiSourceListGetInfoA)
- GET_PROC(hmsi, MsiSourceListGetInfoW)
- GET_PROC(hmsi, MsiSourceListSetInfoA)
- GET_PROC(hmsi, MsiSourceListAddSourceA)
-
- GET_PROC(hadvapi32, RegDeleteKeyExA)
- GET_PROC(hkernel32, IsWow64Process)
-
-#undef GET_PROC
-}
-
/* copied from dlls/msi/registry.c */
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
{
HKEY userkey, hkey, media;
DWORD size;
- if (!pMsiSourceListGetInfoA)
- {
- win_skip("Skipping MsiSourceListGetInfoA tests\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
if (!(usersid = get_user_sid()))
{
}
/* NULL szProductCodeOrPatchCode */
- r = pMsiSourceListGetInfoA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty szProductCodeOrPatchCode */
- r = pMsiSourceListGetInfoA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* garbage szProductCodeOrPatchCode */
- r = pMsiSourceListGetInfoA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid without brackets */
- r = pMsiSourceListGetInfoA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid with brackets */
- r = pMsiSourceListGetInfoA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* same length as guid, but random */
- r = pMsiSourceListGetInfoA("ADKD-2KSDFF2-DKK1KNFJASD9GLKWME-1I3KAD", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA("ADKD-2KSDFF2-DKK1KNFJASD9GLKWME-1I3KAD", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* invalid context */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_NONE,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_NONE,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* another invalid context */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_ALLUSERMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_ALLUSERMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* yet another invalid context */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_ALL,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_ALL,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* mix two valid contexts */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* invalid option */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
4, INSTALLPROPERTY_PACKAGENAMEA, NULL, NULL);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* NULL property */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, NULL, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty property */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, "", NULL, NULL);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* value is non-NULL while size is NULL */
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* size is non-NULL while value is NULL */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, &size);
ok(r == ERROR_UNKNOWN_PRODUCT || r == ERROR_INVALID_PARAMETER,
"Expected ERROR_UNKNOWN_PRODUCT or ERROR_INVALID_PARAMETER, got %d\n", r);
/* user product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 0, "Expected 0, got %lu\n", size);
/* PackageName value exists */
size = 0xdeadbeef;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, NULL, &size);
ok(r == ERROR_SUCCESS || r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r);
+ "Expected ERROR_SUCCESS or ERROR_INVALID_PARAMETER, got %d\n", r);
ok(size == 11 || r != ERROR_SUCCESS, "Expected 11, got %lu\n", size);
/* read the value, don't change size */
- size = 11;
+ size = 11;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected 'aaa', got %s\n", value);
/* read the value, fix size */
size++;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
/* empty property now that product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, "", value, &size);
ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(size == MAX_PATH, "Expected %d, got %lu\n", MAX_PATH, size);
/* nonexistent property now that product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, "nonexistent", value, &size);
ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(size == MAX_PATH, "Expected %d, got %lu\n", MAX_PATH, size);
/* nonexistent property now that nonexistent value exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, "nonexistent", value, &size);
ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
ok(size == MAX_PATH, "Expected %d, got %lu\n", MAX_PATH, size);
/* invalid option now that product key exists */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
4, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 11, "Expected 11, got %lu\n", size);
/* INSTALLPROPERTY_MEDIAPACKAGEPATH, media key does not exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
/* INSTALLPROPERTY_MEDIAPACKAGEPATH */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "path"), "Expected \"path\", got \"%s\"\n", value);
ok(size == 4, "Expected 4, got %lu\n", size);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "prompt"), "Expected \"prompt\", got \"%s\"\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
RegDeleteValueA(hkey, "LastUsedSource");
size = MAX_PATH;
memset(value, 0x55, sizeof(value));
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
usersidW = strdupAW(usersid);
prodcodeW = strdupAW(prodcode);
memset(valueW, 0x55, sizeof(valueW));
- r = pMsiSourceListGetInfoW(prodcodeW, usersidW, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEW,
- valueW, &size);
+ r = MsiSourceListGetInfoW(prodcodeW, usersidW, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEW, valueW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!valueW[0], "Expected \"\"");
ok(size == 0, "Expected 0, got %lu\n", size);
/* INSTALLPROPERTY_LASTUSEDSOURCE, source is empty */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
/* INSTALLPROPERTY_LASTUSEDSOURCE */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "source"), "Expected \"source\", got \"%s\"\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
/* INSTALLPROPERTY_LASTUSEDSOURCE, size is too short */
size = 4;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got \"%s\"\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
/* INSTALLPROPERTY_LASTUSEDSOURCE, size is exactly 6 */
size = 6;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got \"%s\"\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
data = "a;source";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDSOURCE, one semi-colon */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "source"), "Expected \"source\", got \"%s\"\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
data = "a:source";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDSOURCE, one colon */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "a:source"), "Expected \"a:source\", got \"%s\"\n", value);
ok(size == 8, "Expected 8, got %lu\n", size);
/* INSTALLPROPERTY_LASTUSEDTYPE, invalid source format */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
data = "x;y;z";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDTYPE, invalid source format */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
data = "n;y;z";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDTYPE */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
data = "negatory";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDTYPE */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
data = "megatron";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDTYPE */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "m"), "Expected \"m\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
data = "useless";
- res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ,
- (const BYTE *)data, lstrlenA(data) + 1);
+ res = RegSetValueExA(hkey, "LastUsedSource", 0, REG_SZ, (const BYTE *)data, lstrlenA(data) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* INSTALLPROPERTY_LASTUSEDTYPE */
size = MAX_PATH;
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA,
- value, &size);
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "u"), "Expected \"u\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
/* try a patch */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
ok(size == MAX_PATH, "Expected %d, got %lu\n", MAX_PATH, size);
*/
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(size == MAX_PATH, "Expected %d, got %lu\n", MAX_PATH, size);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListGetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PATCH, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
LocalFree(usersid);
}
-static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
-{
- if (pRegDeleteKeyExA)
- return pRegDeleteKeyExA( key, subkey, access, 0 );
- return RegDeleteKeyA( key, subkey );
-}
-
static void test_MsiSourceListAddSourceEx(void)
{
CHAR prodcode[MAX_PATH];
DWORD size;
REGSAM access = KEY_ALL_ACCESS;
- if (!pMsiSourceListAddSourceExA)
- {
- win_skip("Skipping MsiSourceListAddSourceExA tests\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
/* GetLastError is not set by the function */
/* NULL szProductCodeOrPatchCode */
- r = pMsiSourceListAddSourceExA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty szProductCodeOrPatchCode */
- r = pMsiSourceListAddSourceExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* garbage szProductCodeOrPatchCode */
- r = pMsiSourceListAddSourceExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid without brackets */
- r = pMsiSourceListAddSourceExA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA", usersid,
+ r = MsiSourceListAddSourceExA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA", usersid,
MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid with brackets */
- r = pMsiSourceListAddSourceExA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}", usersid,
+ r = MsiSourceListAddSourceExA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}", usersid,
MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* user product key exists */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
RegCloseKey(url);
/* SourceList key exists */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 11, "Expected 11, got %lu\n", size);
/* add another source, index 0 */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "another", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 9, "Expected 9, got %lu\n", size);
/* add another source, index 1 */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "third/", 1);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 9, "Expected 9, got %lu\n", size);
/* add another source, index > N */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "last/", 5);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 6, "Expected 6, got %lu\n", size);
/* just MSISOURCETYPE_NETWORK */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSISOURCETYPE_NETWORK, "source", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 8, "Expected 8, got %lu\n", size);
/* just MSISOURCETYPE_URL */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSISOURCETYPE_URL, "source", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 8, "Expected 8, got %lu\n", size);
/* NULL szUserSid */
- r = pMsiSourceListAddSourceExA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSISOURCETYPE_NETWORK, "nousersid", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == 11, "Expected 11, got %lu\n", size);
/* invalid options, must have source type */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, "source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PATCH, "source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* NULL szSource */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSISOURCETYPE_URL, NULL, 1);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty szSource */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
MSISOURCETYPE_URL, "", 1);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* MSIINSTALLCONTEXT_USERMANAGED, non-NULL szUserSid */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
}
/* product key exists */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
RegCloseKey(hkey);
/* SourceList exists */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* MSIINSTALLCONTEXT_USERMANAGED, NULL szUserSid */
- r = pMsiSourceListAddSourceExA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERMANAGED,
+ r = MsiSourceListAddSourceExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "another", 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
machine_tests:
/* szUserSid must be NULL for MSIINSTALLCONTEXT_MACHINE */
- r = pMsiSourceListAddSourceExA(prodcode, usersid,
- MSIINSTALLCONTEXT_MACHINE,
+ r = MsiSourceListAddSourceExA(prodcode, usersid, MSIINSTALLCONTEXT_MACHINE,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- r = pMsiSourceListAddSourceExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
+ r = MsiSourceListAddSourceExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
}
/* product key exists */
- r = pMsiSourceListAddSourceExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
+ r = MsiSourceListAddSourceExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
RegCloseKey(hkey);
/* SourceList exists */
- r = pMsiSourceListAddSourceExA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
+ r = MsiSourceListAddSourceExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
MSICODE_PRODUCT | MSISOURCETYPE_URL, "C:\\source", 0);
if (r == ERROR_ACCESS_DENIED)
skip("MsiSourceListAddSourceEx (insufficient privileges)\n");
DWORD size;
REGSAM access = KEY_ALL_ACCESS;
- if (!pMsiSourceListEnumSourcesA)
- {
- win_skip("MsiSourceListEnumSourcesA is not available\n");
- return;
- }
-
create_test_guid(prodcode, prod_squashed);
if (!(usersid = get_user_sid()))
{
/* NULL szProductCodeOrPatchCode */
size = 0xdeadbeef;
- r = pMsiSourceListEnumSourcesA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", size);
/* empty szProductCodeOrPatchCode */
size = 0xdeadbeef;
- r = pMsiSourceListEnumSourcesA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", size);
/* garbage szProductCodeOrPatchCode */
size = 0xdeadbeef;
- r = pMsiSourceListEnumSourcesA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", size);
/* guid without brackets */
size = 0xdeadbeef;
- r = pMsiSourceListEnumSourcesA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA",
- usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA",
+ usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", size);
/* guid with brackets */
size = 0xdeadbeef;
- r = pMsiSourceListEnumSourcesA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}",
- usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}",
+ usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* user product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* URL key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* try index 0 again */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* both szSource and pcchSource are NULL, index 0 */
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, NULL);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* both szSource and pcchSource are NULL, index 1 */
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, NULL, NULL);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, NULL, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* size is exactly 5 */
size = 5;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* szSource is non-NULL while pcchSource is NULL */
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, NULL);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got %s\n", value);
/* try index 1 after failure */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* reset the enumeration */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* try index 1 */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "second"), "Expected \"second\", got %s\n", value);
ok(size == 6, "Expected 6, got %lu\n", size);
/* try index 1 again */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 1, value, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* try index 2 */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 2, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 2, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* try index < 0 */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, -1, value, &size);
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, -1, value, &size);
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* NULL szUserSid */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* invalid dwOptions, must be one of MSICODE_ and MSISOURCETYPE_ */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* invalid dwOptions, must be one of MSICODE_ and MSISOURCETYPE_ */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PATCH, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PATCH, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* invalid dwOptions, must be one of MSICODE_ and MSISOURCETYPE_ */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSICODE_PATCH | MSISOURCETYPE_URL,
- 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSICODE_PATCH | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* invalid dwOptions, must be one of MSICODE_ and MSISOURCETYPE_ */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL,
- 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* Net key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* user product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* URL key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* NULL szUserSid */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
RegDeleteValueA(url, "1");
- delete_key(url, "", access);
+ RegDeleteKeyExA(url, "", access, 0);
RegCloseKey(url);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* Net key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
RegDeleteValueA(net, "1");
- delete_key(net, "", access);
+ RegDeleteKeyExA(net, "", access, 0);
RegCloseKey(net);
- delete_key(source, "", access);
+ RegDeleteKeyExA(source, "", access, 0);
RegCloseKey(source);
- delete_key(userkey, "", access);
+ RegDeleteKeyExA(userkey, "", access, 0);
RegCloseKey(userkey);
/* MSIINSTALLCONTEXT_MACHINE */
/* szUserSid is non-NULL */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, usersid,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, usersid, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* szUserSid is NULL */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* user product key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* URL key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
/* NULL szUserSid */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
RegDeleteValueA(url, "1");
- delete_key(url, "", access);
+ RegDeleteKeyExA(url, "", access, 0);
RegCloseKey(url);
/* SourceList key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* Net key exists */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
/* sources exist */
size = MAX_PATH;
lstrcpyA(value, "aaa");
- r = pMsiSourceListEnumSourcesA(prodcode, NULL,
- MSIINSTALLCONTEXT_MACHINE,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
+ r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "first"), "Expected \"first\", got %s\n", value);
ok(size == 5, "Expected 5, got %lu\n", size);
RegDeleteValueA(net, "1");
- delete_key(net, "", access);
+ RegDeleteKeyExA(net, "", access, 0);
RegCloseKey(net);
- delete_key(source, "", access);
+ RegDeleteKeyExA(source, "", access, 0);
RegCloseKey(source);
- delete_key(prodkey, "", access);
+ RegDeleteKeyExA(prodkey, "", access, 0);
RegCloseKey(prodkey);
LocalFree(usersid);
}
UINT r;
REGSAM access = KEY_ALL_ACCESS;
- if (!pMsiSourceListSetInfoA)
- {
- win_skip("MsiSourceListSetInfoA is not available\n");
- return;
- }
- if (is_process_limited())
+ if (!is_process_elevated())
{
skip("process is limited\n");
return;
/* GetLastError is not set by the function */
/* NULL szProductCodeOrPatchCode */
- r = pMsiSourceListSetInfoA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListSetInfoA(NULL, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty szProductCodeOrPatchCode */
- r = pMsiSourceListSetInfoA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListSetInfoA("", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* garbage szProductCodeOrPatchCode */
- r = pMsiSourceListSetInfoA("garbage", usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListSetInfoA("garbage", usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid without brackets */
- r = pMsiSourceListSetInfoA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA",
- usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListSetInfoA("51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA",
+ usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* guid with brackets */
- r = pMsiSourceListSetInfoA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}",
- usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiSourceListSetInfoA("{51CD2AD5-0482-4C46-8DDD-0ED1022AA1AA}",
+ usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* dwOptions is MSICODE_PRODUCT */
- r = pMsiSourceListSetInfoA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* dwOptions is MSICODE_PATCH */
- r = pMsiSourceListSetInfoA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PATCH,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ r = MsiSourceListSetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PATCH,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
/* dwOptions is both MSICODE_PRODUCT and MSICODE_PATCH */
- r = pMsiSourceListSetInfoA(prodcode, usersid,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSICODE_PATCH | MSISOURCETYPE_URL,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ r = MsiSourceListSetInfoA(prodcode, usersid, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSICODE_PATCH | MSISOURCETYPE_URL,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
ok(r == ERROR_UNKNOWN_PATCH, "Expected ERROR_UNKNOWN_PATCH, got %d\n", r);
/* dwOptions has both MSISOURCETYPE_NETWORK and MSISOURCETYPE_URL */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* LastUsedSource and dwOptions has both
* MSISOURCETYPE_NETWORK and MSISOURCETYPE_URL
*/
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,
- MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL,
- INSTALLPROPERTY_LASTUSEDSOURCEA, "path");
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
+ MSICODE_PRODUCT | MSISOURCETYPE_NETWORK | MSISOURCETYPE_URL,
+ INSTALLPROPERTY_LASTUSEDSOURCEA, "path");
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* LastUsedSource and dwOptions has no source type */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_LASTUSEDSOURCEA, "path");
- ok(r == ERROR_UNKNOWN_PRODUCT,
- "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_LASTUSEDSOURCEA, "path");
+ ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* user product key exists */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
- ok(r == ERROR_BAD_CONFIGURATION,
- "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ ok(r == ERROR_BAD_CONFIGURATION, "Expected ERROR_BAD_CONFIGURATION, got %d\n", r);
res = RegCreateKeyA(userkey, "SourceList", &source);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* SourceList key exists, no source type */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* Media key is created by MsiSourceListSetInfo */
CHECK_REG_STR(media, "MediaPackage", "path");
/* set the info again */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path2");
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "path2");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
CHECK_REG_STR(media, "MediaPackage", "path2");
/* NULL szProperty */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- NULL, "path");
- ok(r == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ NULL, "path");
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* empty szProperty */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- "", "path");
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ "", "path");
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
/* NULL szValue */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, NULL);
- ok(r == ERROR_UNKNOWN_PROPERTY,
- "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, NULL);
+ ok(r == ERROR_UNKNOWN_PROPERTY, "Expected ERROR_UNKNOWN_PROPERTY, got %d\n", r);
/* empty szValue */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
- INSTALLPROPERTY_MEDIAPACKAGEPATHA, "");
+ r = MsiSourceListSetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSICODE_PRODUCT,
+ INSTALLPROPERTY_MEDIAPACKAGEPATHA, "");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
CHECK_REG_STR(media, "MediaPackage", "");
/* INSTALLPROPERTY_MEDIAPACKAGEPATH, MSISOURCETYPE_NETWORK */
- r = pMsiSourceListSetInfoA(prodcode, NULL,
- MSIINSTALLCONTEXT_USERUNMANAGED,