Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
October 2020
- 82 participants
- 799 discussions
[PATCH v2 1/2] ntdll: Allow renaming a file/directory to a different casing of itself.
by Gabriel Ivăncescu 28 Oct '20
by Gabriel Ivăncescu 28 Oct '20
28 Oct '20
Renaming a file or directory from e.g. foobar to FooBar (or any other casing
change) should work, like on Windows, instead of being a no-op.
Clobbering an existing file must also respect the new casing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46203
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
v2: Handle clobbering existing file with different casing.
The implementation I came up with is 100% compatible with what was before,
and is very straightforward to decode. We just append the casing filename
(without path) to the wineserver data, and add an extra (optional) field
`casing_len` which is the length of this appended data. If there's no casing
appended, this is zero and the behavior is identical to before.
Note that we *only* send the different casing (and thus casing_len != 0) if
it's actually different. This is important to preserve atomicity of rename()
in wineserver in all cases that don't require this special casing. The only
extra time rename() is not atomic is when an existing file is clobbered
with a different casing now, since we have to unlink the old file, then
rename the new file into the new casing.
dlls/ntdll/unix/file.c | 47 +++++++++++++++++++---
server/fd.c | 88 +++++++++++++++++++++++++++++-------------
server/protocol.def | 3 +-
3 files changed, 105 insertions(+), 33 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index d12a3ff..361930c 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -4328,6 +4328,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
if (len >= sizeof(FILE_RENAME_INFORMATION))
{
FILE_RENAME_INFORMATION *info = ptr;
+ size_t unix_len, casing_len = 0;
UNICODE_STRING name_str;
OBJECT_ATTRIBUTES attr;
char *unix_name;
@@ -4345,13 +4346,49 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
if (io->u.Status != STATUS_SUCCESS && io->u.Status != STATUS_NO_SUCH_FILE)
break;
+ unix_len = strlen(unix_name);
+
+ /* Append the casing of the last component if target exists */
+ if (io->u.Status != STATUS_NO_SUCH_FILE)
+ {
+ size_t nt_filename_len, pathlen;
+ const WCHAR *nt_filename;
+ char *tmp;
+
+ /* name_str is not NUL terminated; look for last \ character */
+ for (pathlen = name_str.Length / sizeof(WCHAR); pathlen; pathlen--)
+ if (name_str.Buffer[pathlen - 1] == '\\')
+ break;
+
+ nt_filename = name_str.Buffer + pathlen;
+ nt_filename_len = name_str.Length / sizeof(WCHAR) - pathlen;
+
+ tmp = realloc(unix_name, unix_len + nt_filename_len * 3);
+ if (tmp)
+ {
+ unix_name = tmp;
+ casing_len = ntdll_wcstoumbs(nt_filename, nt_filename_len, unix_name + unix_len,
+ nt_filename_len * 3, TRUE);
+
+ /* Only send it if the casing is actually different */
+ tmp = strrchr(unix_name, '/');
+ tmp = tmp ? tmp + 1 : unix_name;
+ if (unix_name + unix_len - tmp == casing_len &&
+ !memcmp(tmp, unix_name + unix_len, casing_len))
+ casing_len = 0;
+
+ unix_len += casing_len;
+ }
+ }
+
SERVER_START_REQ( set_fd_name_info )
{
- req->handle = wine_server_obj_handle( handle );
- req->rootdir = wine_server_obj_handle( attr.RootDirectory );
- req->link = FALSE;
- req->replace = info->ReplaceIfExists;
- wine_server_add_data( req, unix_name, strlen(unix_name) );
+ req->handle = wine_server_obj_handle( handle );
+ req->rootdir = wine_server_obj_handle( attr.RootDirectory );
+ req->link = FALSE;
+ req->replace = info->ReplaceIfExists;
+ req->casing_len = casing_len;
+ wine_server_add_data( req, unix_name, unix_len );
io->u.Status = wine_server_call( req );
}
SERVER_END_REQ;
diff --git a/server/fd.c b/server/fd.c
index edb59b0..060e713 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2448,7 +2448,8 @@ static void set_fd_disposition( struct fd *fd, int unlink )
/* set new name for the fd */
static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr,
- data_size_t len, int create_link, int replace )
+ data_size_t len, unsigned int casing_len, int create_link,
+ int replace )
{
struct inode *inode;
struct stat st, st2;
@@ -2498,45 +2499,77 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr,
if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev)
{
if (create_link && !replace) set_error( STATUS_OBJECT_NAME_COLLISION );
- free( name );
- return;
- }
-
- if (!replace)
- {
- set_error( STATUS_OBJECT_NAME_COLLISION );
- goto failed;
+ if (!casing_len)
+ {
+ free( name );
+ return;
+ }
}
-
- /* can't replace directories or special files */
- if (!S_ISREG( st.st_mode ))
+ else
{
- set_error( STATUS_ACCESS_DENIED );
- goto failed;
- }
+ if (!replace)
+ {
+ set_error( STATUS_OBJECT_NAME_COLLISION );
+ goto failed;
+ }
- /* can't replace an opened file */
- if ((inode = get_inode( st.st_dev, st.st_ino, -1 )))
- {
- int is_empty = list_empty( &inode->open );
- release_object( inode );
- if (!is_empty)
+ /* can't replace directories or special files */
+ if (!S_ISREG( st.st_mode ))
{
set_error( STATUS_ACCESS_DENIED );
goto failed;
}
+
+ /* can't replace an opened file */
+ if ((inode = get_inode( st.st_dev, st.st_ino, -1 )))
+ {
+ int is_empty = list_empty( &inode->open );
+ release_object( inode );
+ if (!is_empty)
+ {
+ set_error( STATUS_ACCESS_DENIED );
+ goto failed;
+ }
+ }
+
+ /* link() expects that the target doesn't exist */
+ /* rename() cannot replace files with directories */
+ /* we also have to unlink it if target has different casing */
+ if (create_link || S_ISDIR( st2.st_mode ) || casing_len)
+ {
+ if (unlink( name ))
+ {
+ file_set_error();
+ goto failed;
+ }
+ }
}
+ }
+
+ /* replace the last component with its actual casing */
+ if (casing_len)
+ {
+ char *p = strrchr( name, '/' );
+ size_t orig_len, path_len;
+
+ p = p ? p + 1 : name;
+ path_len = p - name;
+ orig_len = strlen(p);
- /* link() expects that the target doesn't exist */
- /* rename() cannot replace files with directories */
- if (create_link || S_ISDIR( st2.st_mode ))
+ if (orig_len < casing_len)
{
- if (unlink( name ))
+ char *new_name = mem_alloc( path_len + casing_len + 1 );
+ if (!new_name)
{
- file_set_error();
+ set_error( STATUS_NO_MEMORY );
goto failed;
}
+ memcpy( new_name, name, path_len );
+ free( name );
+ name = new_name;
}
+ memcpy(name + path_len, nameptr + len, casing_len);
+ name[path_len + casing_len] = 0;
}
if (create_link)
@@ -2847,7 +2880,8 @@ DECL_HANDLER(set_fd_name_info)
if ((fd = get_handle_fd_obj( current->process, req->handle, 0 )))
{
- set_fd_name( fd, root_fd, get_req_data(), get_req_data_size(), req->link, req->replace );
+ set_fd_name( fd, root_fd, get_req_data(), get_req_data_size() - req->casing_len,
+ req->casing_len, req->link, req->replace );
release_object( fd );
}
if (root_fd) release_object( root_fd );
diff --git a/server/protocol.def b/server/protocol.def
index 846d2e1..a5a7168 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3499,7 +3499,8 @@ struct handle_info
obj_handle_t rootdir; /* root directory */
int link; /* link instead of renaming */
int replace; /* replace an existing file? */
- VARARG(filename,string); /* new file name */
+ unsigned int casing_len; /* optional length of filename with actual casing (w/o path) */
+ VARARG(filename,string); /* new file name; casing_len chars are appended to this, if any */
@END
--
2.21.0
1
1
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/dbs.idl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/dbs.idl b/include/dbs.idl
index 63617c88c00..113479437e2 100644
--- a/include/dbs.idl
+++ b/include/dbs.idl
@@ -500,6 +500,8 @@ cpp_quote(" EXTERN_C const GUID name DECLSPEC_HIDDEN")
cpp_quote("#endif")
cpp_quote("DEFINE_DBGUID(DB_NULLGUID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);")
+cpp_quote("DEFINE_DBGUID(DBGUID_SQL 0xc8b522d7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
+cpp_quote("DEFINE_DBGUID(DBGUID_DEFAULT, 0xc8b521fb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_SESSION, 0xc8b522f5, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROWSET, 0xc8b522f6, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROW, 0xc8b522f7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
--
2.28.0
2
1
[PATCH 4/4] user32: Remove code that queries monitor information from SetupAPI device properties.
by Zhiyi Zhang 28 Oct '20
by Zhiyi Zhang 28 Oct '20
28 Oct '20
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/user32/sysparams.c | 156 ++--------------------------------------
1 file changed, 4 insertions(+), 152 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 227d57b0e5c..a264d863de4 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -102,25 +102,10 @@ DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_OUTPUT_ID, 0xca085853, 0x16ce, 0x48aa, 0xb1
/* Wine specific monitor properties */
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_STATEFLAGS, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 2);
-DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCMONITOR, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 3);
-DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCWORK, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 4);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
#define NULLDRV_DEFAULT_HMONITOR ((HMONITOR)(UINT_PTR)(0x10000 + 1))
-/* Cached monitor information */
-static MONITORINFOEXW *monitors;
-static UINT monitor_count;
-static FILETIME last_query_monitors_time;
-static CRITICAL_SECTION monitors_section;
-static CRITICAL_SECTION_DEBUG monitors_critsect_debug =
-{
- 0, 0, &monitors_section,
- { &monitors_critsect_debug.ProcessLocksList, &monitors_critsect_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": monitors_section") }
-};
-static CRITICAL_SECTION monitors_section = { &monitors_critsect_debug, -1 , 0, 0, 0, 0 };
-
static HDC display_dc;
static CRITICAL_SECTION display_dc_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
@@ -144,7 +129,6 @@ static DPI_AWARENESS dpi_awareness;
static DPI_AWARENESS default_awareness = DPI_AWARENESS_UNAWARE;
static HKEY volatile_base_key;
-static HKEY video_key;
union sysparam_all_entry;
@@ -3765,100 +3749,8 @@ HMONITOR WINAPI MonitorFromWindow(HWND hWnd, DWORD dwFlags)
return MonitorFromRect( &rect, dwFlags );
}
-/* Return FALSE on failure and TRUE on success */
-static BOOL update_monitor_cache(void)
-{
- SP_DEVINFO_DATA device_data = {sizeof(device_data)};
- HDEVINFO devinfo = INVALID_HANDLE_VALUE;
- MONITORINFOEXW *monitor_array;
- FILETIME filetime = {0};
- DWORD device_count = 0;
- HANDLE mutex = NULL;
- DWORD state_flags;
- BOOL ret = FALSE;
- BOOL is_replica;
- DWORD i = 0, j;
- DWORD type;
-
- /* Update monitor cache from SetupAPI if it's outdated */
- if (!video_key && RegOpenKeyW( HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\VIDEO", &video_key ))
- return FALSE;
- if (RegQueryInfoKeyW( video_key, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &filetime ))
- return FALSE;
- if (CompareFileTime( &filetime, &last_query_monitors_time ) < 1)
- return TRUE;
-
- mutex = get_display_device_init_mutex();
- EnterCriticalSection( &monitors_section );
- devinfo = SetupDiGetClassDevsW( &GUID_DEVCLASS_MONITOR, L"DISPLAY", NULL, DIGCF_PRESENT );
-
- while (SetupDiEnumDeviceInfo( devinfo, i++, &device_data ))
- {
- /* Inactive monitors don't get enumerated */
- if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_STATEFLAGS, &type,
- (BYTE *)&state_flags, sizeof(DWORD), NULL, 0 ))
- goto fail;
- if (state_flags & DISPLAY_DEVICE_ACTIVE)
- device_count++;
- }
-
- if (device_count && monitor_count < device_count)
- {
- monitor_array = heap_alloc( device_count * sizeof(*monitor_array) );
- if (!monitor_array)
- goto fail;
- heap_free( monitors );
- monitors = monitor_array;
- }
-
- for (i = 0, monitor_count = 0; SetupDiEnumDeviceInfo( devinfo, i, &device_data ); i++)
- {
- if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_STATEFLAGS, &type,
- (BYTE *)&state_flags, sizeof(DWORD), NULL, 0 ))
- goto fail;
- if (!(state_flags & DISPLAY_DEVICE_ACTIVE))
- continue;
- if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCMONITOR, &type,
- (BYTE *)&monitors[monitor_count].rcMonitor, sizeof(RECT), NULL, 0 ))
- goto fail;
-
- /* Replicas in mirroring monitor sets don't get enumerated */
- is_replica = FALSE;
- for (j = 0; j < monitor_count; j++)
- {
- if (EqualRect(&monitors[j].rcMonitor, &monitors[monitor_count].rcMonitor))
- {
- is_replica = TRUE;
- break;
- }
- }
- if (is_replica)
- continue;
-
- if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCWORK, &type,
- (BYTE *)&monitors[monitor_count].rcWork, sizeof(RECT), NULL, 0 ))
- goto fail;
- if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, &type,
- (BYTE *)monitors[monitor_count].szDevice, CCHDEVICENAME * sizeof(WCHAR), NULL, 0))
- goto fail;
- monitors[monitor_count].dwFlags =
- !wcscmp( L"\\\\.\\DISPLAY1", monitors[monitor_count].szDevice ) ? MONITORINFOF_PRIMARY : 0;
-
- monitor_count++;
- }
-
- last_query_monitors_time = filetime;
- ret = TRUE;
-fail:
- SetupDiDestroyDeviceInfoList( devinfo );
- LeaveCriticalSection( &monitors_section );
- release_display_device_init_mutex( mutex );
- return ret;
-}
-
BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, MONITORINFO *info )
{
- UINT index = (UINT_PTR)handle - 1;
WCHAR adapter_name[CCHDEVICENAME];
TRACE("(%p, %p)\n", handle, info);
@@ -3896,29 +3788,8 @@ BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, MONITORINFO *info )
return TRUE;
}
- if (!update_monitor_cache())
- {
- SetLastError( ERROR_INVALID_MONITOR_HANDLE );
- return FALSE;
- }
-
- EnterCriticalSection( &monitors_section );
- if (index < monitor_count)
- {
- info->rcMonitor = monitors[index].rcMonitor;
- info->rcWork = monitors[index].rcWork;
- info->dwFlags = monitors[index].dwFlags;
- if (info->cbSize >= sizeof(MONITORINFOEXW))
- lstrcpyW( ((MONITORINFOEXW *)info)->szDevice, monitors[index].szDevice );
- LeaveCriticalSection( &monitors_section );
- return TRUE;
- }
- else
- {
- LeaveCriticalSection( &monitors_section );
- SetLastError( ERROR_INVALID_MONITOR_HANDLE );
- return FALSE;
- }
+ SetLastError( ERROR_INVALID_MONITOR_HANDLE );
+ return FALSE;
}
/***********************************************************************
@@ -4053,27 +3924,8 @@ BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC pro
if (i)
return TRUE;
- if (update_monitor_cache())
- {
- while (TRUE)
- {
- EnterCriticalSection( &monitors_section );
- if (i >= monitor_count)
- {
- LeaveCriticalSection( &monitors_section );
- return TRUE;
- }
- monitor_rect = monitors[i].rcMonitor;
- LeaveCriticalSection( &monitors_section );
-
- if (!proc( (HMONITOR)(UINT_PTR)(i + 1), hdc, &monitor_rect, lp ))
- return FALSE;
-
- ++i;
- }
- }
-
- /* Fallback to report one monitor if using SetupAPI failed */
+ /* Fallback to report one monitor if wineserver calls failed */
+ ERR("Failed to enumerate monitors, reporting a 640x480 monitor.\n");
SetRect( &monitor_rect, 0, 0, 640, 480 );
if (!proc( NULLDRV_DEFAULT_HMONITOR, hdc, &monitor_rect, lp ))
return FALSE;
--
2.27.0
2
1
28 Oct '20
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/classes.c | 266 +++++++++++++++++----------------------------
1 file changed, 100 insertions(+), 166 deletions(-)
diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c
index 4e0c1a68098..52a91b306f1 100644
--- a/dlls/msi/classes.c
+++ b/dlls/msi/classes.c
@@ -52,7 +52,7 @@ static MSIAPPID *load_appid( MSIPACKAGE* package, MSIRECORD *row )
appid = msi_alloc_zero( sizeof(MSIAPPID) );
if (!appid)
return NULL;
-
+
appid->AppID = msi_dup_record_field( row, 1 );
TRACE("loading appid %s\n", debugstr_w( appid->AppID ));
@@ -67,16 +67,12 @@ static MSIAPPID *load_appid( MSIPACKAGE* package, MSIRECORD *row )
appid->RunAsInteractiveUser = !MSI_RecordIsNull(row,7);
list_add_tail( &package->appids, &appid->entry );
-
+
return appid;
}
static MSIAPPID *load_given_appid( MSIPACKAGE *package, LPCWSTR name )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','A','p','p','I','d','`',' ','W','H','E','R','E',' ',
- '`','A','p','p','I','d','`',' ','=',' ','\'','%','s','\'',0};
MSIRECORD *row;
MSIAPPID *appid;
@@ -92,8 +88,8 @@ static MSIAPPID *load_given_appid( MSIPACKAGE *package, LPCWSTR name )
return appid;
}
}
-
- row = MSI_QueryGetRecord(package->db, query, name);
+
+ row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `AppId` WHERE `AppId` = '%s'", name);
if (!row)
return NULL;
@@ -135,17 +131,14 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
if (!MSI_RecordIsNull(row,6))
{
- INT icon_index = MSI_RecordGetInteger(row,6);
+ INT icon_index = MSI_RecordGetInteger(row,6);
LPCWSTR FileName = MSI_RecordGetString(row,5);
LPWSTR FilePath;
- static const WCHAR fmt[] = {'%','s',',','%','i',0};
FilePath = msi_build_icon_path(package, FileName);
-
- progid->IconPath = msi_alloc( (lstrlenW(FilePath)+10)* sizeof(WCHAR) );
-
- swprintf(progid->IconPath,lstrlenW(FilePath)+10,fmt,FilePath,icon_index);
+ progid->IconPath = msi_alloc( (lstrlenW(FilePath) + 10) * sizeof(WCHAR) );
+ swprintf( progid->IconPath, lstrlenW(FilePath) + 10, L"%s,%d", FilePath, icon_index );
msi_free(FilePath);
}
else
@@ -171,16 +164,12 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row )
progid->CurVer = parent;
parent->VersionInd = progid;
}
-
+
return progid;
}
static MSIPROGID *load_given_progid(MSIPACKAGE *package, LPCWSTR name)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','P','r','o','g','I','d','`',' ','W','H','E','R','E',' ',
- '`','P','r','o','g','I','d','`',' ','=',' ','\'','%','s','\'',0};
MSIPROGID *progid;
MSIRECORD *row;
@@ -196,8 +185,8 @@ static MSIPROGID *load_given_progid(MSIPACKAGE *package, LPCWSTR name)
return progid;
}
}
-
- row = MSI_QueryGetRecord( package->db, query, name );
+
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `ProgId` WHERE `ProgId` = '%s'", name );
if (!row)
return NULL;
@@ -240,17 +229,14 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
if (!MSI_RecordIsNull(row,9))
{
- INT icon_index = MSI_RecordGetInteger(row,9);
+ INT icon_index = MSI_RecordGetInteger(row,9);
LPCWSTR FileName = MSI_RecordGetString(row,8);
LPWSTR FilePath;
- static const WCHAR fmt[] = {'%','s',',','%','i',0};
FilePath = msi_build_icon_path(package, FileName);
-
- cls->IconPath = msi_alloc( (lstrlenW(FilePath)+5)* sizeof(WCHAR) );
-
- swprintf(cls->IconPath,lstrlenW(FilePath)+5,fmt,FilePath,icon_index);
+ cls->IconPath = msi_alloc( (lstrlenW(FilePath) + 5) * sizeof(WCHAR) );
+ swprintf( cls->IconPath, lstrlenW(FilePath) + 5, L"%s,%d", FilePath, icon_index );
msi_free(FilePath);
}
else
@@ -265,20 +251,17 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
i = MSI_RecordGetInteger(row,10);
if (i != MSI_NULL_INTEGER && i > 0 && i < 4)
{
- static const WCHAR ole2[] = {'o','l','e','2','.','d','l','l',0};
- static const WCHAR ole32[] = {'o','l','e','3','2','.','d','l','l',0};
-
switch(i)
{
case 1:
- cls->DefInprocHandler = strdupW(ole2);
+ cls->DefInprocHandler = strdupW(L"ole2.dll");
break;
case 2:
- cls->DefInprocHandler32 = strdupW(ole32);
+ cls->DefInprocHandler32 = strdupW(L"ole32.dll");
break;
case 3:
- cls->DefInprocHandler = strdupW(ole2);
- cls->DefInprocHandler32 = strdupW(ole32);
+ cls->DefInprocHandler = strdupW(L"ole2.dll");
+ cls->DefInprocHandler32 = strdupW(L"ole32.dll");
break;
}
}
@@ -300,23 +283,19 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row )
}
/*
- * the Class table has 3 primary keys. Generally it is only
+ * the Class table has 3 primary keys. Generally it is only
* referenced through the first CLSID key. However when loading
* all of the classes we need to make sure we do not ignore rows
- * with other Context and ComponentIndexs
+ * with other Context and ComponentIndexs
*/
static MSICLASS *load_given_class(MSIPACKAGE *package, LPCWSTR classid)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','C','l','a','s','s','`',' ','W','H','E','R','E',' ',
- '`','C','L','S','I','D','`',' ','=',' ','\'','%','s','\'',0};
MSICLASS *cls;
MSIRECORD *row;
if (!classid)
return NULL;
-
+
/* check for classes already loaded */
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
{
@@ -327,7 +306,7 @@ static MSICLASS *load_given_class(MSIPACKAGE *package, LPCWSTR classid)
}
}
- row = MSI_QueryGetRecord(package->db, query, classid);
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Class` WHERE `CLSID` = '%s'", classid );
if (!row)
return NULL;
@@ -349,7 +328,7 @@ static MSIMIME *load_mime( MSIPACKAGE* package, MSIRECORD *row )
if (!mt)
return mt;
- mt->ContentType = msi_dup_record_field( row, 1 );
+ mt->ContentType = msi_dup_record_field( row, 1 );
TRACE("loading mime %s\n", debugstr_w(mt->ContentType));
extension = MSI_RecordGetString( row, 2 );
@@ -366,16 +345,12 @@ static MSIMIME *load_mime( MSIPACKAGE* package, MSIRECORD *row )
static MSIMIME *load_given_mime( MSIPACKAGE *package, LPCWSTR mime )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','M','I','M','E','`',' ','W','H','E','R','E',' ',
- '`','C','o','n','t','e','n','t','T','y','p','e','`',' ','=',' ','\'','%','s','\'',0};
MSIRECORD *row;
MSIMIME *mt;
if (!mime)
return NULL;
-
+
/* check for mime already loaded */
LIST_FOR_EACH_ENTRY( mt, &package->mimes, MSIMIME, entry )
{
@@ -385,8 +360,8 @@ static MSIMIME *load_given_mime( MSIPACKAGE *package, LPCWSTR mime )
return mt;
}
}
-
- row = MSI_QueryGetRecord(package->db, query, mime);
+
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `MIME` WHERE `ContentType` = '%s'", mime );
if (!row)
return NULL;
@@ -434,10 +409,6 @@ static MSIEXTENSION *load_extension( MSIPACKAGE* package, MSIRECORD *row )
*/
static MSIEXTENSION *load_given_extension( MSIPACKAGE *package, LPCWSTR name )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','E','x','t','e','n','s','i','o','n','`',' ','W','H','E','R','E',' ',
- '`','E','x','t','e','n','s','i','o','n','`',' ','=',' ','\'','%','s','\'',0};
MSIEXTENSION *ext;
MSIRECORD *row;
@@ -456,8 +427,8 @@ static MSIEXTENSION *load_given_extension( MSIPACKAGE *package, LPCWSTR name )
return ext;
}
}
-
- row = MSI_QueryGetRecord( package->db, query, name );
+
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Extension` WHERE `Extension` = '%s'", name );
if (!row)
return NULL;
@@ -499,7 +470,7 @@ static UINT iterate_load_verb(MSIRECORD *row, LPVOID param)
/* associate the verb with the correct extension */
list_add_tail( &extension->verbs, &verb->entry );
-
+
return ERROR_SUCCESS;
}
@@ -530,7 +501,7 @@ static UINT iterate_all_classes(MSIRECORD *rec, LPVOID param)
break;
}
}
-
+
if (!match)
load_class(package, rec);
@@ -539,12 +510,10 @@ static UINT iterate_all_classes(MSIRECORD *rec, LPVOID param)
static UINT load_all_classes( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ','`','C','l','a','s','s','`',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Class`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -585,12 +554,10 @@ static UINT iterate_all_extensions(MSIRECORD *rec, LPVOID param)
static UINT load_all_extensions( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','E','x','t','e','n','s','i','o','n','`',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW( package->db, query, &view );
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Extension`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -611,13 +578,10 @@ static UINT iterate_all_progids(MSIRECORD *rec, LPVOID param)
static UINT load_all_progids( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','`','P','r','o','g','I','d','`',' ','F','R','O','M',' ',
- '`','P','r','o','g','I','d','`',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT `ProgId` FROM `ProgId`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -628,12 +592,10 @@ static UINT load_all_progids( MSIPACKAGE *package )
static UINT load_all_verbs( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','V','e','r','b','`',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Verb`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -654,13 +616,10 @@ static UINT iterate_all_mimes(MSIRECORD *rec, LPVOID param)
static UINT load_all_mimes( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','`','C','o','n','t','e','n','t','T','y','p','e','`',' ',
- 'F','R','O','M',' ','`','M','I','M','E','`',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT `ContentType` FROM `MIME`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -699,45 +658,30 @@ static UINT load_classes_and_such( MSIPACKAGE *package )
static UINT register_appid(const MSIAPPID *appid, LPCWSTR app )
{
- static const WCHAR szRemoteServerName[] =
- {'R','e','m','o','t','e','S','e','r','v','e','r','N','a','m','e',0};
- static const WCHAR szLocalService[] =
- {'L','o','c','a','l','S','e','r','v','i','c','e',0};
- static const WCHAR szService[] =
- {'S','e','r','v','i','c','e','P','a','r','a','m','e','t','e','r','s',0};
- static const WCHAR szDLL[] =
- {'D','l','l','S','u','r','r','o','g','a','t','e',0};
- static const WCHAR szActivate[] =
- {'A','c','t','i','v','a','t','e','A','s','S','t','o','r','a','g','e',0};
- static const WCHAR szY[] = {'Y',0};
- static const WCHAR szRunAs[] = {'R','u','n','A','s',0};
- static const WCHAR szUser[] =
- {'I','n','t','e','r','a','c','t','i','v','e',' ','U','s','e','r',0};
-
- HKEY hkey2,hkey3;
-
- RegCreateKeyW(HKEY_CLASSES_ROOT,szAppID,&hkey2);
+ HKEY hkey2, hkey3;
+
+ RegCreateKeyW( HKEY_CLASSES_ROOT, L"AppID", &hkey2 );
RegCreateKeyW( hkey2, appid->AppID, &hkey3 );
RegCloseKey(hkey2);
msi_reg_set_val_str( hkey3, NULL, app );
if (appid->RemoteServerName)
- msi_reg_set_val_str( hkey3, szRemoteServerName, appid->RemoteServerName );
+ msi_reg_set_val_str( hkey3, L"RemoteServerName", appid->RemoteServerName );
if (appid->LocalServer)
- msi_reg_set_val_str( hkey3, szLocalService, appid->LocalServer );
+ msi_reg_set_val_str( hkey3, L"LocalService", appid->LocalServer );
if (appid->ServiceParameters)
- msi_reg_set_val_str( hkey3, szService, appid->ServiceParameters );
+ msi_reg_set_val_str( hkey3, L"ServiceParameters", appid->ServiceParameters );
if (appid->DllSurrogate)
- msi_reg_set_val_str( hkey3, szDLL, appid->DllSurrogate );
+ msi_reg_set_val_str( hkey3, L"DllSurrogate", appid->DllSurrogate );
if (appid->ActivateAtStorage)
- msi_reg_set_val_str( hkey3, szActivate, szY );
+ msi_reg_set_val_str( hkey3, L"ActivateAtStorage", L"Y" );
if (appid->RunAsInteractiveUser)
- msi_reg_set_val_str( hkey3, szRunAs, szUser );
+ msi_reg_set_val_str( hkey3, L"RunAs", L"Interactive User" );
RegCloseKey(hkey3);
return ERROR_SUCCESS;
@@ -745,7 +689,6 @@ static UINT register_appid(const MSIAPPID *appid, LPCWSTR app )
UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
{
- static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
REGSAM access = KEY_ALL_ACCESS;
MSIRECORD *uirow;
HKEY hkey, hkey2, hkey3;
@@ -753,7 +696,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterClassInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterClassInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -764,7 +707,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
else
access |= KEY_WOW64_64KEY;
- if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL ))
+ if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
@@ -830,7 +773,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (cls->Argument)
{
- lstrcatW( argument, szSpace );
+ lstrcatW( argument, L" " );
lstrcatW( argument, cls->Argument );
}
@@ -848,11 +791,11 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
else
progid = cls->ProgIDText;
- msi_reg_set_subkey_val( hkey2, szProgID, NULL, progid );
+ msi_reg_set_subkey_val( hkey2, L"ProgID", NULL, progid );
if (cls->ProgID && cls->ProgID->VersionInd)
{
- msi_reg_set_subkey_val( hkey2, szVIProgID, NULL,
+ msi_reg_set_subkey_val( hkey2, L"VersionIndependentProgID", NULL,
cls->ProgID->VersionInd->ProgID );
}
}
@@ -860,18 +803,18 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (cls->AppID)
{
MSIAPPID *appid = cls->AppID;
- msi_reg_set_val_str( hkey2, szAppID, appid->AppID );
+ msi_reg_set_val_str( hkey2, L"AppID", appid->AppID );
register_appid( appid, cls->Description );
}
if (cls->IconPath)
- msi_reg_set_subkey_val( hkey2, szDefaultIcon, NULL, cls->IconPath );
+ msi_reg_set_subkey_val( hkey2, L"DefaultIcon", NULL, cls->IconPath );
if (cls->DefInprocHandler)
- msi_reg_set_subkey_val( hkey2, szInprocHandler, NULL, cls->DefInprocHandler );
+ msi_reg_set_subkey_val( hkey2, L"InprocHandler", NULL, cls->DefInprocHandler );
if (cls->DefInprocHandler32)
- msi_reg_set_subkey_val( hkey2, szInprocHandler32, NULL, cls->DefInprocHandler32 );
+ msi_reg_set_subkey_val( hkey2, L"InprocHandler32", NULL, cls->DefInprocHandler32 );
RegCloseKey(hkey2);
/* if there is a FileTypeMask, register the FileType */
@@ -886,9 +829,9 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
ptr2 = wcschr(ptr,';');
if (ptr2)
*ptr2 = 0;
- keyname = msi_alloc( (lstrlenW(szFileType_fmt) + lstrlenW(cls->clsid) + 4) * sizeof(WCHAR));
- swprintf( keyname, lstrlenW(szFileType_fmt) + lstrlenW(cls->clsid) + 4,
- szFileType_fmt, cls->clsid, index );
+ keyname = msi_alloc( (lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4) * 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);
@@ -913,7 +856,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
{
- static const WCHAR szFileType[] = {'F','i','l','e','T','y','p','e','\\',0};
REGSAM access = KEY_ALL_ACCESS;
MSIRECORD *uirow;
MSICLASS *cls;
@@ -921,7 +863,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterClassInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterClassInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -932,7 +874,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
else
access |= KEY_WOW64_64KEY;
- if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL ))
+ if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
@@ -973,7 +915,7 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
if (cls->AppID)
{
- res = RegOpenKeyW( HKEY_CLASSES_ROOT, szAppID, &hkey2 );
+ res = RegOpenKeyW( HKEY_CLASSES_ROOT, L"AppID", &hkey2 );
if (res == ERROR_SUCCESS)
{
res = RegDeleteKeyW( hkey2, cls->AppID->AppID );
@@ -984,10 +926,10 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
}
if (cls->FileTypeMask)
{
- filetype = msi_alloc( (lstrlenW( szFileType ) + lstrlenW( cls->clsid ) + 1) * sizeof(WCHAR) );
+ filetype = msi_alloc( (lstrlenW( L"FileType\\" ) + lstrlenW( cls->clsid ) + 1) * sizeof(WCHAR) );
if (filetype)
{
- lstrcpyW( filetype, szFileType );
+ lstrcpyW( filetype, L"FileType\\" );
lstrcatW( filetype, cls->clsid );
res = RegDeleteTreeW( HKEY_CLASSES_ROOT, filetype );
msi_free( filetype );
@@ -1021,7 +963,6 @@ static LPCWSTR get_clsid_of_progid( const MSIPROGID *progid )
static UINT register_progid( const MSIPROGID* progid )
{
- static const WCHAR szCurVer[] = {'C','u','r','V','e','r',0};
HKEY hkey = 0;
UINT rc;
@@ -1031,7 +972,7 @@ static UINT register_progid( const MSIPROGID* progid )
LPCWSTR clsid = get_clsid_of_progid( progid );
if (clsid)
- msi_reg_set_subkey_val( hkey, szCLSID, NULL, clsid );
+ msi_reg_set_subkey_val( hkey, L"CLSID", NULL, clsid );
else
TRACE("%s has no class\n", debugstr_w( progid->ProgID ) );
@@ -1039,11 +980,11 @@ static UINT register_progid( const MSIPROGID* progid )
msi_reg_set_val_str( hkey, NULL, progid->Description );
if (progid->IconPath)
- msi_reg_set_subkey_val( hkey, szDefaultIcon, NULL, progid->IconPath );
+ msi_reg_set_subkey_val( hkey, L"DefaultIcon", NULL, progid->IconPath );
/* write out the current version */
if (progid->CurVer)
- msi_reg_set_subkey_val( hkey, szCurVer, NULL, progid->CurVer->ProgID );
+ msi_reg_set_subkey_val( hkey, L"CurVer", NULL, progid->CurVer->ProgID );
RegCloseKey(hkey);
}
@@ -1089,7 +1030,7 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterProgIdInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterProgIdInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1152,7 +1093,7 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterProgIdInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterProgIdInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1180,21 +1121,17 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
return ERROR_SUCCESS;
}
-static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
+static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
MSICOMPONENT* component, const MSIEXTENSION* extension,
MSIVERB* verb, INT* Sequence )
{
LPWSTR keyname;
HKEY key;
- static const WCHAR szShell[] = {'s','h','e','l','l',0};
- static const WCHAR szCommand[] = {'c','o','m','m','a','n','d',0};
- static const WCHAR fmt[] = {'\"','%','s','\"',' ','%','s',0};
- static const WCHAR fmt2[] = {'\"','%','s','\"',0};
LPWSTR command;
DWORD size;
LPWSTR advertise;
- keyname = msi_build_directory_name(4, progid, szShell, verb->Verb, szCommand);
+ keyname = msi_build_directory_name(4, progid, L"shell", verb->Verb, L"command");
TRACE("Making Key %s\n",debugstr_w(keyname));
RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key);
@@ -1205,9 +1142,9 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
command = msi_alloc(size * sizeof (WCHAR));
if (verb->Argument)
- swprintf(command, size, fmt, component->FullKeypath, verb->Argument);
+ swprintf(command, size, L"\"%s\" %s", component->FullKeypath, verb->Argument);
else
- swprintf(command, size, fmt2, component->FullKeypath);
+ swprintf(command, size, L"\"%s\"", component->FullKeypath);
msi_reg_set_val_str( key, NULL, command );
msi_free(command);
@@ -1225,12 +1162,12 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
lstrcpyW(command,advertise);
if (verb->Argument)
{
- lstrcatW(command,szSpace);
- lstrcatW(command,verb->Argument);
+ lstrcatW(command, L" ");
+ lstrcatW(command, verb->Argument);
}
- msi_reg_set_val_multi_str( key, szCommand, command );
-
+ msi_reg_set_val_multi_str( key, L"command", command );
+
RegCloseKey(key);
msi_free(keyname);
msi_free(advertise);
@@ -1238,7 +1175,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
if (verb->Command)
{
- keyname = msi_build_directory_name( 3, progid, szShell, verb->Verb );
+ 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);
}
@@ -1248,7 +1185,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
if (*Sequence == MSI_NULL_INTEGER || verb->Sequence < *Sequence)
{
*Sequence = verb->Sequence;
- keyname = msi_build_directory_name( 2, progid, szShell );
+ keyname = msi_build_directory_name( 2, progid, L"shell" );
msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, keyname, NULL, verb->Verb );
msi_free(keyname);
}
@@ -1258,7 +1195,6 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid,
UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
{
- static const WCHAR szContentType[] = {'C','o','n','t','e','n','t',' ','T','y','p','e',0};
HKEY hkey = NULL;
MSIEXTENSION *ext;
MSIRECORD *uirow;
@@ -1267,7 +1203,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterExtensionInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterExtensionInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1277,12 +1213,12 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
* shortcuts and the like. Because Mike McCormack is working on this i am
* going to default to TRUE
*/
-
+
LIST_FOR_EACH_ENTRY( ext, &package->extensions, MSIEXTENSION, entry )
{
LPWSTR extension;
MSIFEATURE *feature;
-
+
if (!ext->Component)
continue;
@@ -1296,7 +1232,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
if (!feature)
continue;
- /*
+ /*
* yes. MSDN says that these are based on _Feature_ not on
* Component. So verify the feature is to be installed
*/
@@ -1324,18 +1260,16 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
}
if (ext->Mime)
- msi_reg_set_val_str( hkey, szContentType, ext->Mime->ContentType );
+ msi_reg_set_val_str( hkey, L"Content Type", ext->Mime->ContentType );
if (ext->ProgID || ext->ProgIDText)
{
- static const WCHAR szSN[] =
- {'\\','S','h','e','l','l','N','e','w',0};
HKEY hkey2;
LPWSTR newkey;
LPCWSTR progid;
MSIVERB *verb;
INT Sequence = MSI_NULL_INTEGER;
-
+
if (ext->ProgID)
progid = ext->ProgID->ProgID;
else
@@ -1343,11 +1277,11 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
msi_reg_set_val_str( hkey, NULL, progid );
- newkey = msi_alloc( (lstrlenW(progid)+lstrlenW(szSN)+1) * sizeof(WCHAR));
+ newkey = msi_alloc( (lstrlenW(progid) + lstrlenW(L"\\ShellNew") + 1) * sizeof(WCHAR));
- lstrcpyW(newkey,progid);
- lstrcatW(newkey,szSN);
- RegCreateKeyW(hkey,newkey,&hkey2);
+ lstrcpyW(newkey, progid);
+ lstrcatW(newkey, L"\\ShellNew");
+ RegCreateKeyW(hkey, newkey, &hkey2);
RegCloseKey(hkey2);
msi_free(newkey);
@@ -1359,7 +1293,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
ext, verb, &Sequence);
}
}
-
+
RegCloseKey(hkey);
uirow = MSI_CreateRecord(1);
@@ -1378,7 +1312,7 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterExtensionInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterExtensionInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1426,7 +1360,6 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
if (ext->ProgID || ext->ProgIDText)
{
- static const WCHAR shellW[] = {'\\','s','h','e','l','l',0};
LPCWSTR progid;
LPWSTR progid_shell;
@@ -1435,11 +1368,11 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
else
progid = ext->ProgIDText;
- progid_shell = msi_alloc( (lstrlenW( progid ) + lstrlenW( shellW ) + 1) * sizeof(WCHAR) );
+ progid_shell = msi_alloc( (lstrlenW( progid ) + lstrlenW( L"\\shell" ) + 1) * sizeof(WCHAR) );
if (progid_shell)
{
lstrcpyW( progid_shell, progid );
- lstrcatW( progid_shell, shellW );
+ lstrcatW( progid_shell, L"\\shell" );
res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell );
msi_free( progid_shell );
if (res != ERROR_SUCCESS)
@@ -1458,13 +1391,12 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
{
- static const WCHAR szExtension[] = {'E','x','t','e','n','s','i','o','n',0};
MSIRECORD *uirow;
MSIMIME *mt;
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterMIMEInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterMIMEInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1474,7 +1406,7 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
{
LPWSTR extension = NULL, key;
- /*
+ /*
* check if the MIME is to be installed. Either as requested by an
* extension or Class
*/
@@ -1488,19 +1420,20 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
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( szMIMEDatabase ) + 1) * sizeof(WCHAR) );
+ key = msi_alloc( (lstrlenW( mt->ContentType ) +
+ lstrlenW( L"MIME\\Database\\Content Type\\" ) + 1) * sizeof(WCHAR) );
if (extension && key)
{
extension[0] = '.';
lstrcpyW( extension + 1, mt->Extension->Extension );
- lstrcpyW( key, szMIMEDatabase );
+ lstrcpyW( key, L"MIME\\Database\\Content Type\\" );
lstrcatW( key, mt->ContentType );
- msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, szExtension, extension );
+ msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, L"Extension", extension );
if (mt->clsid)
- msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, szCLSID, mt->clsid );
+ msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, L"CLSID", mt->clsid );
}
msi_free( extension );
msi_free( key );
@@ -1521,7 +1454,7 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package )
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterMIMEInfo);
+ return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterMIMEInfo" );
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
@@ -1541,10 +1474,11 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package )
TRACE("Unregistering MIME type %s\n", debugstr_w(mime->ContentType));
- mime_key = msi_alloc( (lstrlenW( szMIMEDatabase ) + lstrlenW( mime->ContentType ) + 1) * sizeof(WCHAR) );
+ mime_key = msi_alloc( (lstrlenW( L"MIME\\Database\\Content Type\\" ) +
+ lstrlenW( mime->ContentType ) + 1) * sizeof(WCHAR) );
if (mime_key)
{
- lstrcpyW( mime_key, szMIMEDatabase );
+ lstrcpyW( mime_key, L"MIME\\Database\\Content Type\\" );
lstrcatW( mime_key, mime->ContentType );
res = RegDeleteKeyW( HKEY_CLASSES_ROOT, mime_key );
if (res != ERROR_SUCCESS)
--
2.28.0
1
0
28 Oct '20
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/registry.c | 349 +++++++++++++-------------------------------
1 file changed, 104 insertions(+), 245 deletions(-)
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c
index 4d439d0b304..623bc1866d3 100644
--- a/dlls/msi/registry.c
+++ b/dlls/msi/registry.c
@@ -38,151 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-/*
- * This module will be all the helper functions for registry access by the
- * installer bits.
- */
-
-static const WCHAR szUserDataFeatures_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s','\\','F','e','a','t','u','r','e','s',0};
-
-static const WCHAR szUserDataComp_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','C','o','m','p','o','n','e','n','t','s','\\','%','s',0};
-
-static const WCHAR szUserDataComponents_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','C','o','m','p','o','n','e','n','t','s',0};
-
-static const WCHAR szUserDataProd_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s',0};
-
-static const WCHAR szUserDataProducts_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','r','o','d','u','c','t','s',0};
-
-static const WCHAR szUserDataPatch_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','a','t','c','h','e','s','\\','%','s',0};
-
-static const WCHAR szUserDataPatches_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','a','t','c','h','e','s',0};
-
-static const WCHAR szUserDataProductPatches_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s','\\','P','a','t','c','h','e','s',0};
-
-static const WCHAR szInstallProperties_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- '%','s','\\','P','r','o','d','u','c','t','s','\\','%','s','\\',
- 'I','n','s','t','a','l','l','P','r','o','p','e','r','t','i','e','s',0};
-
-static const WCHAR szInstaller_LocalManagedProd_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','M','a','n','a','g','e','d','\\','%','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s','\\','%','s',0};
-
-static const WCHAR szInstaller_LocalManagedFeat_fmt[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','M','a','n','a','g','e','d','\\','%','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\','%','s',0};
-
-static const WCHAR szInstaller_Products[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0};
-
-static const WCHAR szInstaller_Patches[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','a','t','c','h','e','s',0};
-
-static const WCHAR szInstaller_LocalClassesProducts[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0};
-
-static const WCHAR szInstaller_LocalClassesFeatures[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s',0};
-
-static const WCHAR szInstaller_LocalClassesProd[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s','\\',0};
-
-static const WCHAR szInstaller_LocalClassesFeat[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\',0};
-
-static const WCHAR szInstaller_ClassesUpgradeCode[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s','\\',0};
-
-static const WCHAR szInstaller_ClassesUpgradeCodes[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s',0};
-
-static const WCHAR szInstaller_Features[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\',0};
-
-static const WCHAR szInstaller_UpgradeCodes[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s','\\',0};
-
-static const WCHAR szInstaller_UserUpgradeCodes[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s','\\',0};
-
-static const WCHAR szUninstall[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'U','n','i','n','s','t','a','l','l','\\',0};
-
-static const WCHAR szUserComponents[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','C','o','m','p','o','n','e','n','t','s','\\',0};
-
-static const WCHAR szInstaller_Components[] = {
- 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','C','o','m','p','o','n','e','n','t','s','\\',0};
-
-static const WCHAR szUserFeatures[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\',0};
-
-static const WCHAR szUserProducts[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s','\\',0};
-
-static const WCHAR szUserPatches[] = {
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','a','t','c','h','e','s','\\',0};
-
BOOL unsquash_guid(LPCWSTR in, LPWSTR out)
{
DWORD i,n=0;
@@ -354,7 +209,7 @@ DWORD msi_version_str_to_dword(LPCWSTR p)
LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value )
{
DWORD len;
- if (!value) value = szEmpty;
+ if (!value) value = L"";
len = (lstrlenW(value) + 1) * sizeof (WCHAR);
return RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)value, len );
}
@@ -455,7 +310,7 @@ UINT MSIREG_OpenUninstallKey(const WCHAR *product, enum platform platform, HKEY
access |= KEY_WOW64_32KEY;
else
access |= KEY_WOW64_64KEY;
- lstrcpyW(keypath, szUninstall);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\");
lstrcatW(keypath, product);
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
@@ -473,8 +328,8 @@ UINT MSIREG_DeleteUninstallKey(const WCHAR *product, enum platform platform)
access |= KEY_WOW64_32KEY;
else
access |= KEY_WOW64_64KEY;
- if ((r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szUninstall, 0, access, &parent)))
- return r;
+ if ((r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\",
+ 0, access, &parent))) return r;
r = RegDeleteTreeW(parent, product);
RegCloseKey(parent);
return r;
@@ -491,13 +346,13 @@ UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTE
if (context == MSIINSTALLCONTEXT_MACHINE)
{
- lstrcpyW(keypath, szInstaller_LocalClassesProd);
+ lstrcpyW(keypath, L"Software\\Classes\\Installer\\Products\\");
lstrcatW( keypath, squashed_pc );
}
else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
{
root = HKEY_CURRENT_USER;
- lstrcpyW(keypath, szUserProducts);
+ lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
lstrcatW( keypath, squashed_pc );
}
else
@@ -511,7 +366,9 @@ UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTE
}
szUserSid = usersid;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szInstaller_LocalManagedProd_fmt, szUserSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath),
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Products\\%s",
+ szUserSid, squashed_pc );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -525,7 +382,7 @@ UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct)
if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
- lstrcpyW(keypath, szUserProducts);
+ lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
lstrcatW( keypath, squashed_pc );
return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
}
@@ -537,7 +394,7 @@ UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create)
if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
- lstrcpyW(keypath, szUserPatches);
+ lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Patches\\" );
lstrcatW( keypath, squashed_pc );
if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
@@ -556,13 +413,13 @@ UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONT
if (context == MSIINSTALLCONTEXT_MACHINE)
{
- lstrcpyW(keypath, szInstaller_LocalClassesFeat);
+ lstrcpyW(keypath, L"Software\\Classes\\Installer\\Features\\");
lstrcatW( keypath, squashed_pc );
}
else if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
{
root = HKEY_CURRENT_USER;
- lstrcpyW(keypath, szUserFeatures);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Features\\");
lstrcatW( keypath, squashed_pc );
}
else
@@ -576,7 +433,9 @@ UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONT
}
szUserSid = usersid;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szInstaller_LocalManagedFeat_fmt, szUserSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath),
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Features\\%s",
+ szUserSid, squashed_pc );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -590,7 +449,7 @@ UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct)
if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
- lstrcpyW(keypath, szUserFeatures);
+ lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Features\\" );
lstrcatW( keypath, squashed_pc );
return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
}
@@ -603,7 +462,7 @@ static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL c
if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
- lstrcpyW(keypath, szInstaller_Features);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Features\\");
lstrcatW( keypath, squashed_pc );
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -613,6 +472,8 @@ static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL c
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context,
HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Features";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200], *usersid = NULL;
@@ -621,7 +482,7 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINS
if (context == MSIINSTALLCONTEXT_MACHINE)
{
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataFeatures_fmt, szLocalSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
}
else
{
@@ -634,7 +495,7 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINS
}
szUserSid = usersid;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataFeatures_fmt, szUserSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -650,20 +511,22 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create)
if (!squash_guid( szComponent, squashed_cc)) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_cc));
- lstrcpyW(keypath, szUserComponents);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Components\\");
lstrcatW( keypath, squashed_cc );
if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
ret = RegOpenKeyW(HKEY_CURRENT_USER, keypath, key);
if (ret != ERROR_FILE_NOT_FOUND) return ret;
- lstrcpyW(keypath, szInstaller_Components);
+ lstrcpyW(keypath, L"Software\\Classes\\Installer\\Components\\");
lstrcatW( keypath, squashed_cc );
return RegOpenKeyExW( HKEY_LOCAL_MACHINE, keypath, 0, access, key );
}
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
@@ -677,11 +540,10 @@ UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKE
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataComp_fmt, usersid, squashed_comp );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_comp );
LocalFree(usersid);
}
- else
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataComp_fmt, szUserSid, squashed_comp );
+ else swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_comp );
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
@@ -689,6 +551,8 @@ UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKE
UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
HKEY hkey;
@@ -704,11 +568,10 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid)
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataComponents_fmt, usersid);
+ swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
LocalFree(usersid);
}
- else
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataComponents_fmt, szUserSid);
+ else swprintf(keypath, ARRAY_SIZE(keypath), fmtW, szUserSid);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
r = RegDeleteTreeW( hkey, squashed_comp );
@@ -718,6 +581,8 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid)
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
@@ -725,9 +590,9 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContex
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
if (dwContext == MSIINSTALLCONTEXT_MACHINE)
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataProd_fmt, szLocalSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
else if (szUserSid)
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataProd_fmt, szUserSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
else
{
if (!(usersid = get_user_sid()))
@@ -735,7 +600,7 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContex
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataProd_fmt, usersid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -744,6 +609,8 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContex
UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches\\%s";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
@@ -751,7 +618,7 @@ UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, H
TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_patch));
if (dwContext == MSIINSTALLCONTEXT_MACHINE)
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataPatch_fmt, szLocalSid, squashed_patch );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_patch );
else
{
if (!(usersid = get_user_sid()))
@@ -759,7 +626,7 @@ UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, H
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataPatch_fmt, usersid, squashed_patch );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_patch );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -768,6 +635,8 @@ UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, H
UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
HKEY hkey;
@@ -777,7 +646,7 @@ UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context)
TRACE("%s squashed %s\n", debugstr_w(patch), debugstr_w(squashed_patch));
if (context == MSIINSTALLCONTEXT_MACHINE)
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataPatches_fmt, szLocalSid);
+ swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
else
{
if (!(usersid = get_user_sid()))
@@ -785,7 +654,7 @@ UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context)
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataPatches_fmt, usersid);
+ swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
LocalFree(usersid);
}
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
@@ -796,6 +665,8 @@ UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context)
UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Patches";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_product[SQUASHED_GUID_SIZE], keypath[0x200];
@@ -803,7 +674,7 @@ UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT con
TRACE("%s squashed %s\n", debugstr_w(product), debugstr_w(squashed_product));
if (context == MSIINSTALLCONTEXT_MACHINE)
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataProductPatches_fmt, szLocalSid, squashed_product );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_product );
else
{
if (!(usersid = get_user_sid()))
@@ -811,7 +682,7 @@ UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT con
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szUserDataProductPatches_fmt, usersid, squashed_product );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_product );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -820,6 +691,8 @@ UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT con
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\InstallProperties";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
@@ -827,9 +700,9 @@ UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPC
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
if (dwContext == MSIINSTALLCONTEXT_MACHINE)
- swprintf( keypath, ARRAY_SIZE(keypath), szInstallProperties_fmt, szLocalSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
else if (szUserSid)
- swprintf( keypath, ARRAY_SIZE(keypath), szInstallProperties_fmt, szUserSid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
else
{
if (!(usersid = get_user_sid()))
@@ -837,7 +710,7 @@ UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPC
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf( keypath, ARRAY_SIZE(keypath), szInstallProperties_fmt, usersid, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
LocalFree(usersid);
}
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -846,6 +719,8 @@ UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPC
UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context)
{
+ static const WCHAR fmtW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products";
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
HKEY hkey;
@@ -855,7 +730,7 @@ UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT contex
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
if (context == MSIINSTALLCONTEXT_MACHINE)
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataProducts_fmt, szLocalSid);
+ swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
else
{
if (!(usersid = get_user_sid()))
@@ -863,7 +738,7 @@ UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT contex
ERR("Failed to retrieve user SID\n");
return ERROR_FUNCTION_FAILED;
}
- swprintf(keypath, ARRAY_SIZE(keypath), szUserDataProducts_fmt, usersid);
+ swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
LocalFree(usersid);
}
@@ -883,7 +758,8 @@ UINT MSIREG_DeleteProductKey(LPCWSTR szProduct)
if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_Products, 0, access, &hkey)) return ERROR_SUCCESS;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products",
+ 0, access, &hkey)) return ERROR_SUCCESS;
r = RegDeleteTreeW( hkey, squashed_pc );
RegCloseKey(hkey);
return r;
@@ -897,7 +773,8 @@ UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create)
if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
- swprintf( keypath, ARRAY_SIZE(keypath), szInstaller_Patches, squashed_pc );
+ swprintf( keypath, ARRAY_SIZE(keypath), L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Patches",
+ squashed_pc );
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
@@ -911,7 +788,7 @@ UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY *key, BOOL create)
if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
- lstrcpyW(keypath, szInstaller_UpgradeCodes);
+ lstrcpyW( keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\" );
lstrcatW( keypath, squashed_uc );
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -925,7 +802,7 @@ UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL creat
if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
- lstrcpyW(keypath, szInstaller_UserUpgradeCodes);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
lstrcatW( keypath, squashed_uc );
if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
@@ -942,7 +819,8 @@ UINT MSIREG_DeleteUpgradeCodesKey( const WCHAR *code )
if (!squash_guid( code, squashed_code )) return ERROR_FUNCTION_FAILED;
TRACE( "%s squashed %s\n", debugstr_w(code), debugstr_w(squashed_code) );
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, szInstaller_UpgradeCodes, 0, access, &hkey )) return ERROR_SUCCESS;
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\",
+ 0, access, &hkey )) return ERROR_SUCCESS;
ret = RegDeleteTreeW( hkey, squashed_code );
RegCloseKey( hkey );
return ret;
@@ -955,7 +833,7 @@ UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode)
if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
- lstrcpyW(keypath, szInstaller_UserUpgradeCodes);
+ lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
lstrcatW( keypath, squashed_uc );
return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
}
@@ -970,7 +848,8 @@ UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode)
if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesProducts, 0, access, &hkey)) return ERROR_SUCCESS;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Products", 0, access, &hkey))
+ return ERROR_SUCCESS;
r = RegDeleteTreeW( hkey, squashed_pc );
RegCloseKey(hkey);
return r;
@@ -986,7 +865,8 @@ UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode)
if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesFeatures, 0, access, &hkey)) return ERROR_SUCCESS;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Features", 0, access, &hkey))
+ return ERROR_SUCCESS;
r = RegDeleteTreeW( hkey, squashed_pc );
RegCloseKey(hkey);
return r;
@@ -1000,7 +880,7 @@ UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY *key, BOOL cr
if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
- lstrcpyW(keypath, szInstaller_ClassesUpgradeCode);
+ lstrcpyW(keypath, L"Software\\Classes\\Installer\\UpgradeCodes\\");
lstrcatW( keypath, squashed_uc );
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
@@ -1017,7 +897,8 @@ UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_ClassesUpgradeCodes, 0, access, &hkey)) return ERROR_SUCCESS;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\UpgradeCodes", 0, access, &hkey))
+ return ERROR_SUCCESS;
r = RegDeleteTreeW( hkey, squashed_uc );
RegCloseKey(hkey);
return r;
@@ -1163,12 +1044,11 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
if (NULL == lpguid)
return ERROR_INVALID_PARAMETER;
- return MsiEnumProductsExW( NULL, szAllSid, MSIINSTALLCONTEXT_ALL, index, lpguid,
+ return MsiEnumProductsExW( NULL, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, index, lpguid,
NULL, NULL, NULL );
}
-UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index,
- LPSTR szFeature, LPSTR szParent)
+UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index, LPSTR szFeature, LPSTR szParent)
{
DWORD r;
WCHAR szwFeature[GUID_SIZE], szwParent[GUID_SIZE];
@@ -1197,8 +1077,7 @@ UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index,
return r;
}
-UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index,
- LPWSTR szFeature, LPWSTR szParent)
+UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index, LPWSTR szFeature, LPWSTR szParent)
{
HKEY hkeyProduct = 0;
DWORD r, sz;
@@ -1241,7 +1120,7 @@ UINT WINAPI MsiEnumComponentsW(DWORD index, LPWSTR lpguid)
if (!lpguid) return ERROR_INVALID_PARAMETER;
- return MsiEnumComponentsExW( szAllSid, MSIINSTALLCONTEXT_ALL, index, lpguid, NULL, NULL, NULL );
+ return MsiEnumComponentsExW( L"S-1-1-0", MSIINSTALLCONTEXT_ALL, index, lpguid, NULL, NULL, NULL );
}
UINT WINAPI MsiEnumComponentsExA( LPCSTR user_sid, DWORD ctx, DWORD index, CHAR guid[39],
@@ -1274,18 +1153,15 @@ UINT WINAPI MsiEnumComponentsExA( LPCSTR user_sid, DWORD ctx, DWORD index, CHAR
static UINT fetch_machine_component( DWORD ctx, DWORD index, DWORD *idx, WCHAR guid[39],
MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid, LPDWORD sid_len )
{
- static const WCHAR componentsW[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a','\\',
- 'S','-','1','-','5','-','1','8','\\','C','o','m','p','o','n','e','n','t','s',0};
UINT r = ERROR_SUCCESS;
WCHAR component[SQUASHED_GUID_SIZE];
DWORD i = 0, len_component;
REGSAM access = KEY_ENUMERATE_SUB_KEYS | KEY_WOW64_64KEY;
HKEY key_components;
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, componentsW, 0, access, &key_components ))
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE,
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Components",
+ 0, access, &key_components ))
return ERROR_NO_MORE_ITEMS;
len_component = ARRAY_SIZE( component );
@@ -1323,11 +1199,6 @@ static UINT fetch_user_component( const WCHAR *usersid, DWORD ctx, DWORD index,
WCHAR guid[39], MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid,
LPDWORD sid_len )
{
- static const WCHAR userdataW[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'I','n','s','t','a','l','l','e','r','\\','U','s','e','r','D','a','t','a',0};
- static const WCHAR componentsW[] = {'\\','C','o','m','p','o','n','e','n','t','s',0};
UINT r = ERROR_SUCCESS;
WCHAR path[MAX_PATH], component[SQUASHED_GUID_SIZE], user[128];
DWORD i = 0, j = 0, len_component, len_user;
@@ -1337,21 +1208,21 @@ static UINT fetch_user_component( const WCHAR *usersid, DWORD ctx, DWORD index,
if (ctx == MSIINSTALLCONTEXT_USERMANAGED) /* FIXME: where to find these? */
return ERROR_NO_MORE_ITEMS;
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, userdataW, 0, access, &key_users ))
- return ERROR_NO_MORE_ITEMS;
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData",
+ 0, access, &key_users )) return ERROR_NO_MORE_ITEMS;
len_user = ARRAY_SIZE( user );
while (!RegEnumKeyExW( key_users, i, user, &len_user, NULL, NULL, NULL, NULL ))
{
- if ((wcscmp( usersid, szAllSid ) && wcscmp( usersid, user )) ||
- !wcscmp( szLocalSid, user ))
+ if ((wcscmp( usersid, L"S-1-1-0" ) && wcscmp( usersid, user )) ||
+ !wcscmp( L"S-1-5-18", user ))
{
i++;
len_user = ARRAY_SIZE( user );
continue;
}
lstrcpyW( path, user );
- lstrcatW( path, componentsW );
+ lstrcatW( path, L"\\Components" );
if (RegOpenKeyExW( key_users, path, 0, access, &key_components ))
{
i++;
@@ -1498,7 +1369,7 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct)
return ERROR_INVALID_PARAMETER;
if (MSIREG_OpenUserDataComponentKey(szComponent, NULL, &hkeyComp, FALSE) != ERROR_SUCCESS &&
- MSIREG_OpenUserDataComponentKey(szComponent, szLocalSid, &hkeyComp, FALSE) != ERROR_SUCCESS)
+ MSIREG_OpenUserDataComponentKey(szComponent, L"S-1-5-18", &hkeyComp, FALSE) != ERROR_SUCCESS)
return ERROR_UNKNOWN_COMPONENT;
/* see if there are any products at all */
@@ -1586,7 +1457,7 @@ static UINT MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex,
break;
if (r != ERROR_MORE_DATA)
goto end;
-
+
if (type != REG_MULTI_SZ)
{
ERR("component data has wrong type (%d)\n", type);
@@ -1850,7 +1721,7 @@ static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid,
if (r != ERROR_SUCCESS)
return ERROR_NO_MORE_ITEMS;
- res = RegOpenKeyExW(prod, szPatches, 0, KEY_READ, &hkey);
+ res = RegOpenKeyExW(prod, L"Patches", 0, KEY_READ, &hkey);
if (res != ERROR_SUCCESS)
goto done;
@@ -1859,7 +1730,7 @@ static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid,
goto done;
size = sizeof(DWORD);
- res = RegGetValueW(udpatch, NULL, szState, RRF_RT_DWORD, &type, &val, &size);
+ res = RegGetValueW(udpatch, NULL, L"State", RRF_RT_DWORD, &type, &val, &size);
if (res != ERROR_SUCCESS ||
val < MSIPATCHSTATE_APPLIED || val > MSIPATCHSTATE_REGISTERED)
{
@@ -1896,7 +1767,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
return ERROR_NO_MORE_ITEMS;
size = 0;
- res = RegGetValueW(prod, szPatches, szPatches, RRF_RT_ANY, &type, NULL,
+ res = RegGetValueW(prod, L"Patches", L"Patches", RRF_RT_ANY, &type, NULL,
&size);
if (res != ERROR_SUCCESS)
goto done;
@@ -1914,7 +1785,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
goto done;
}
- res = RegGetValueW(prod, szPatches, szPatches, RRF_RT_ANY, &type,
+ res = RegGetValueW(prod, L"Patches", L"Patches", RRF_RT_ANY, &type,
patches, &size);
if (res != ERROR_SUCCESS)
goto done;
@@ -1928,7 +1799,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
}
size = 0;
- res = RegGetValueW(prod, szPatches, ptr, RRF_RT_REG_SZ,
+ res = RegGetValueW(prod, L"Patches", ptr, RRF_RT_REG_SZ,
&type, NULL, &size);
if (res != ERROR_SUCCESS)
continue;
@@ -1942,7 +1813,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
goto done;
}
- res = RegGetValueW(prod, szPatches, ptr, RRF_RT_REG_SZ,
+ res = RegGetValueW(prod, L"Patches", ptr, RRF_RT_REG_SZ,
&type, *transforms, &size);
if (res != ERROR_SUCCESS)
continue;
@@ -1990,13 +1861,13 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
}
else if (context == MSIINSTALLCONTEXT_MACHINE)
{
- usersid = szEmpty;
+ usersid = L"";
if (MSIREG_OpenUserDataProductKey(prodcode, context, NULL, &localprod, FALSE) == ERROR_SUCCESS &&
- RegOpenKeyExW(localprod, szPatches, 0, KEY_READ, &localpatch) == ERROR_SUCCESS &&
+ RegOpenKeyExW(localprod, L"Patches", 0, KEY_READ, &localpatch) == ERROR_SUCCESS &&
RegOpenKeyExW(localpatch, ptr, 0, KEY_READ, &patchkey) == ERROR_SUCCESS)
{
- res = RegGetValueW(patchkey, NULL, szState, RRF_RT_REG_DWORD,
+ res = RegGetValueW(patchkey, NULL, L"State", RRF_RT_REG_DWORD,
&type, &state, &size);
if (!(filter & state))
@@ -2125,7 +1996,7 @@ UINT WINAPI MsiEnumPatchesExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
if (!szProductCode || !squash_guid( szProductCode, squashed_pc ))
return ERROR_INVALID_PARAMETER;
- if (szUserSid && !wcscmp( szUserSid, szLocalSid ))
+ if (szUserSid && !wcscmp( szUserSid, L"S-1-5-18" ))
return ERROR_INVALID_PARAMETER;
if (dwContext & MSIINSTALLCONTEXT_MACHINE && szUserSid)
@@ -2303,16 +2174,13 @@ static UINT fetch_machine_product( const WCHAR *match, DWORD index, DWORD *idx,
WCHAR installed_product[GUID_SIZE],
MSIINSTALLCONTEXT *installed_ctx, WCHAR *sid, DWORD *sid_len )
{
- static const WCHAR productsW[] =
- {'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0};
UINT r;
WCHAR product[SQUASHED_GUID_SIZE];
DWORD i = 0, len;
REGSAM access = KEY_ENUMERATE_SUB_KEYS | KEY_WOW64_64KEY;
HKEY key;
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, productsW, 0, access, &key ))
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Products", 0, access, &key ))
return ERROR_NO_MORE_ITEMS;
len = ARRAY_SIZE( product );
@@ -2357,15 +2225,6 @@ static UINT fetch_user_product( const WCHAR *match, const WCHAR *usersid, DWORD
DWORD *idx, WCHAR installed_product[GUID_SIZE],
MSIINSTALLCONTEXT *installed_ctx, WCHAR *sid, DWORD *sid_len )
{
- static const WCHAR managedW[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s',
- 'i','o','n','\\','I','n','s','t','a','l','l','e','r','\\','M','a','n','a','g','e','d',0};
- static const WCHAR managed_productsW[] =
- {'\\','I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0};
- static const WCHAR unmanaged_productsW[] =
- {'\\','S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','P','r','o','d','u','c','t','s',0};
UINT r;
const WCHAR *subkey;
WCHAR path[MAX_PATH], product[SQUASHED_GUID_SIZE], user[128];
@@ -2375,13 +2234,13 @@ static UINT fetch_user_product( const WCHAR *match, const WCHAR *usersid, DWORD
if (ctx == MSIINSTALLCONTEXT_USERMANAGED)
{
- subkey = managed_productsW;
- if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, managedW, 0, access, &key_users ))
- return ERROR_NO_MORE_ITEMS;
+ subkey = L"\\Installer\\Products";
+ if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed",
+ 0, access, &key_users )) return ERROR_NO_MORE_ITEMS;
}
else if (ctx == MSIINSTALLCONTEXT_USERUNMANAGED)
{
- subkey = unmanaged_productsW;
+ subkey = L"\\Software\\Microsoft\\Installer\\Products";
if (RegOpenKeyExW( HKEY_USERS, NULL, 0, access, &key_users ))
return ERROR_NO_MORE_ITEMS;
}
@@ -2390,7 +2249,7 @@ static UINT fetch_user_product( const WCHAR *match, const WCHAR *usersid, DWORD
len_user = ARRAY_SIZE( user );
while (!RegEnumKeyExW( key_users, i, user, &len_user, NULL, NULL, NULL, NULL ))
{
- if (wcscmp( usersid, user ) && wcscmp( usersid, szAllSid ))
+ if (wcscmp( usersid, user ) && wcscmp( usersid, L"S-1-1-0" ))
{
i++;
len_user = ARRAY_SIZE( user );
--
2.28.0
1
0
28 Oct '20
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/package.c | 526 +++++++++++++++------------------------------
1 file changed, 179 insertions(+), 347 deletions(-)
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 7b64362b10d..2483d99e2b5 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -359,20 +359,11 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg)
static UINT create_temp_property_table(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'C','R','E','A','T','E',' ','T','A','B','L','E',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ','(',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ',
- 'C','H','A','R','(','5','6',')',' ','N','O','T',' ','N','U','L','L',' ',
- 'T','E','M','P','O','R','A','R','Y',',',' ',
- '`','V','a','l','u','e','`',' ','C','H','A','R','(','9','8',')',' ',
- 'N','O','T',' ','N','U','L','L',' ','T','E','M','P','O','R','A','R','Y',
- ' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ',
- '`','_','P','r','o','p','e','r','t','y','`',')',' ','H','O','L','D',0};
MSIQUERY *view;
UINT rc;
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW(package->db, L"CREATE TABLE `_Property` ( `_Property` CHAR(56) NOT NULL TEMPORARY, "
+ L"`Value` CHAR(98) NOT NULL TEMPORARY PRIMARY KEY `_Property`) HOLD", &view);
if (rc != ERROR_SUCCESS)
return rc;
@@ -384,22 +375,10 @@ static UINT create_temp_property_table(MSIPACKAGE *package)
UINT msi_clone_properties( MSIDATABASE *db )
{
- static const WCHAR query_select[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','P','r','o','p','e','r','t','y','`',0};
- static const WCHAR query_insert[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ',
- '(','`','_','P','r','o','p','e','r','t','y','`',',','`','V','a','l','u','e','`',')',' ',
- 'V','A','L','U','E','S',' ','(','?',',','?',')',0};
- static const WCHAR query_update[] = {
- 'U','P','D','A','T','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ',
- 'S','E','T',' ','`','V','a','l','u','e','`',' ','=',' ','?',' ',
- 'W','H','E','R','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ','=',' ','?',0};
MSIQUERY *view_select;
UINT rc;
- rc = MSI_DatabaseOpenViewW( db, query_select, &view_select );
+ rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
if (rc != ERROR_SUCCESS)
return rc;
@@ -420,7 +399,7 @@ UINT msi_clone_properties( MSIDATABASE *db )
if (rc != ERROR_SUCCESS)
break;
- rc = MSI_DatabaseOpenViewW( db, query_insert, &view_insert );
+ rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
if (rc != ERROR_SUCCESS)
{
msiobj_release( &rec_select->hdr );
@@ -436,7 +415,7 @@ UINT msi_clone_properties( MSIDATABASE *db )
TRACE("insert failed, trying update\n");
- rc = MSI_DatabaseOpenViewW( db, query_update, &view_update );
+ rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
if (rc != ERROR_SUCCESS)
{
WARN("open view failed %u\n", rc);
@@ -481,7 +460,7 @@ static UINT set_installed_prop( MSIPACKAGE *package )
if (r == ERROR_SUCCESS)
{
RegCloseKey( hkey );
- msi_set_property( package->db, szInstalled, szOne, -1 );
+ msi_set_property( package->db, L"Installed", L"1", -1 );
}
return r;
}
@@ -523,7 +502,7 @@ static UINT set_user_sid_prop( MSIPACKAGE *package )
if (!ConvertSidToStringSidW( psid, &sid_str ))
goto done;
- r = msi_set_property( package->db, szUserSID, sid_str, -1 );
+ r = msi_set_property( package->db, L"UserSID", sid_str, -1 );
done:
LocalFree( sid_str );
@@ -536,39 +515,27 @@ done:
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
{
- static const WCHAR fusion[] =
- {'f','u','s','i','o','n','.','d','l','l',0};
- static const WCHAR subkey[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'N','E','T',' ','F','r','a','m','e','w','o','r','k',' ','S','e','t','u','p','\\','N','D','P',0};
- static const WCHAR subdir[] =
- {'M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\',0};
- static const WCHAR v2050727[] =
- {'v','2','.','0','.','5','0','7','2','7',0};
- static const WCHAR v4client[] =
- {'v','4','\\','C','l','i','e','n','t',0};
- static const WCHAR installpath[] =
- {'I','n','s','t','a','l','l','P','a','t','h',0};
HKEY netsetup, hkey;
LONG res;
DWORD size, len, type;
WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
- res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey, 0, KEY_CREATE_SUB_KEY, &netsetup);
+ res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\NET Framework Setup\\NDP", 0, KEY_CREATE_SUB_KEY,
+ &netsetup);
if (res != ERROR_SUCCESS)
return NULL;
- if (!RegCreateKeyExW(netsetup, v4client, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
+ if (!RegCreateKeyExW(netsetup, L"v4\\Client", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
{
size = ARRAY_SIZE(path);
- if (!RegQueryValueExW(hkey, installpath, NULL, &type, (BYTE *)path, &size))
+ if (!RegQueryValueExW(hkey, L"InstallPath", NULL, &type, (BYTE *)path, &size))
{
- len = lstrlenW(path) + lstrlenW(fusion) + 2;
+ len = lstrlenW(path) + lstrlenW(L"fusion.dll") + 2;
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
lstrcpyW(filename, path);
- lstrcatW(filename, szBackSlash);
- lstrcatW(filename, fusion);
+ lstrcpyW(filename, L"\\");
+ lstrcatW(filename, L"fusion.dll");
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
{
TRACE( "found %s\n", debugstr_w(filename) );
@@ -580,19 +547,20 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package)
RegCloseKey(hkey);
}
- if (!RegCreateKeyExW(netsetup, v2050727, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
+ if (!RegCreateKeyExW(netsetup, L"v2.0.50727", 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
{
RegCloseKey(hkey);
GetWindowsDirectoryW(windir, MAX_PATH);
- len = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(v2050727) + lstrlenW(fusion) + 3;
+ len = lstrlenW(windir) + lstrlenW(L"Microsoft.NET\\Framework\\") + lstrlenW(L"v2.0.50727") +
+ lstrlenW(L"fusion.dll") + 3;
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
lstrcpyW(filename, windir);
- lstrcatW(filename, szBackSlash);
- lstrcatW(filename, subdir);
- lstrcatW(filename, v2050727);
- lstrcatW(filename, szBackSlash);
- lstrcatW(filename, fusion);
+ lstrcatW(filename, L"\\");
+ lstrcatW(filename, L"Microsoft.NET\\Framework\\");
+ lstrcatW(filename, L"v2.0.50727");
+ lstrcatW(filename, L"\\");
+ lstrcatW(filename, L"fusion.dll");
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
{
TRACE( "found %s\n", debugstr_w(filename) );
@@ -620,19 +588,6 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
LPWSTR fusion, verstr;
LANGANDCODEPAGE *translate;
- static const WCHAR netasm[] = {
- 'M','s','i','N','e','t','A','s','s','e','m','b','l','y','S','u','p','p','o','r','t',0
- };
- static const WCHAR translation[] = {
- '\\','V','a','r','F','i','l','e','I','n','f','o',
- '\\','T','r','a','n','s','l','a','t','i','o','n',0
- };
- static const WCHAR verfmt[] = {
- '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
- '\\','%','0','4','x','%','0','4','x',
- '\\','P','r','o','d','u','c','t','V','e','r','s','i','o','n',0
- };
-
fusion = get_fusion_filename(package);
if (!fusion)
return;
@@ -648,10 +603,11 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
if (!GetFileVersionInfoW(fusion, handle, size, version))
goto done;
- if (!VerQueryValueW(version, translation, (LPVOID *)&translate, &val_len))
+ if (!VerQueryValueW(version, L"\\VarFileInfo\\Translation", (LPVOID *)&translate, &val_len))
goto done;
- swprintf(buf, ARRAY_SIZE(buf), verfmt, translate[0].wLanguage, translate[0].wCodePage);
+ swprintf(buf, ARRAY_SIZE(buf), L"\\StringFileInfo\\%04x%04x\\ProductVersion", translate[0].wLanguage,
+ translate[0].wCodePage);
if (!VerQueryValueW(version, buf, (LPVOID *)&verstr, &val_len))
goto done;
@@ -659,7 +615,7 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
if (!val_len || !verstr)
goto done;
- msi_set_property( package->db, netasm, verstr, -1 );
+ msi_set_property( package->db, L"MsiNetAssemblySupport", verstr, -1 );
done:
msi_free(fusion);
@@ -679,84 +635,6 @@ static VOID set_installer_properties(MSIPACKAGE *package)
SYSTEM_INFO sys_info;
LANGID langid;
- static const WCHAR szCommonFilesFolder[] = {'C','o','m','m','o','n','F','i','l','e','s','F','o','l','d','e','r',0};
- static const WCHAR szProgramFilesFolder[] = {'P','r','o','g','r','a','m','F','i','l','e','s','F','o','l','d','e','r',0};
- static const WCHAR szCommonAppDataFolder[] = {'C','o','m','m','o','n','A','p','p','D','a','t','a','F','o','l','d','e','r',0};
- static const WCHAR szFavoritesFolder[] = {'F','a','v','o','r','i','t','e','s','F','o','l','d','e','r',0};
- static const WCHAR szFontsFolder[] = {'F','o','n','t','s','F','o','l','d','e','r',0};
- static const WCHAR szSendToFolder[] = {'S','e','n','d','T','o','F','o','l','d','e','r',0};
- static const WCHAR szStartMenuFolder[] = {'S','t','a','r','t','M','e','n','u','F','o','l','d','e','r',0};
- static const WCHAR szStartupFolder[] = {'S','t','a','r','t','u','p','F','o','l','d','e','r',0};
- static const WCHAR szTemplateFolder[] = {'T','e','m','p','l','a','t','e','F','o','l','d','e','r',0};
- static const WCHAR szDesktopFolder[] = {'D','e','s','k','t','o','p','F','o','l','d','e','r',0};
- static const WCHAR szProgramMenuFolder[] = {'P','r','o','g','r','a','m','M','e','n','u','F','o','l','d','e','r',0};
- static const WCHAR szAdminToolsFolder[] = {'A','d','m','i','n','T','o','o','l','s','F','o','l','d','e','r',0};
- static const WCHAR szSystemFolder[] = {'S','y','s','t','e','m','F','o','l','d','e','r',0};
- static const WCHAR szSystem16Folder[] = {'S','y','s','t','e','m','1','6','F','o','l','d','e','r',0};
- static const WCHAR szLocalAppDataFolder[] = {'L','o','c','a','l','A','p','p','D','a','t','a','F','o','l','d','e','r',0};
- static const WCHAR szMyPicturesFolder[] = {'M','y','P','i','c','t','u','r','e','s','F','o','l','d','e','r',0};
- static const WCHAR szPersonalFolder[] = {'P','e','r','s','o','n','a','l','F','o','l','d','e','r',0};
- static const WCHAR szWindowsVolume[] = {'W','i','n','d','o','w','s','V','o','l','u','m','e',0};
- static const WCHAR szPrivileged[] = {'P','r','i','v','i','l','e','g','e','d',0};
- static const WCHAR szVersion9x[] = {'V','e','r','s','i','o','n','9','X',0};
- static const WCHAR szVersionNT[] = {'V','e','r','s','i','o','n','N','T',0};
- static const WCHAR szMsiNTProductType[] = {'M','s','i','N','T','P','r','o','d','u','c','t','T','y','p','e',0};
- static const WCHAR szFormat[] = {'%','u',0};
- static const WCHAR szFormat2[] = {'%','u','.','%','u',0};
- static const WCHAR szWindowsBuild[] = {'W','i','n','d','o','w','s','B','u','i','l','d',0};
- static const WCHAR szServicePackLevel[] = {'S','e','r','v','i','c','e','P','a','c','k','L','e','v','e','l',0};
- static const WCHAR szVersionMsi[] = { 'V','e','r','s','i','o','n','M','s','i',0 };
- static const WCHAR szVersionDatabase[] = { 'V','e','r','s','i','o','n','D','a','t','a','b','a','s','e',0 };
- static const WCHAR szPhysicalMemory[] = { 'P','h','y','s','i','c','a','l','M','e','m','o','r','y',0 };
- static const WCHAR szScreenX[] = {'S','c','r','e','e','n','X',0};
- static const WCHAR szScreenY[] = {'S','c','r','e','e','n','Y',0};
- static const WCHAR szColorBits[] = {'C','o','l','o','r','B','i','t','s',0};
- static const WCHAR szIntFormat[] = {'%','d',0};
- static const WCHAR szMsiAMD64[] = { 'M','s','i','A','M','D','6','4',0 };
- static const WCHAR szMsix64[] = { 'M','s','i','x','6','4',0 };
- static const WCHAR szSystem64Folder[] = { 'S','y','s','t','e','m','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szCommonFiles64Folder[] = { 'C','o','m','m','o','n','F','i','l','e','s','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szProgramFiles64Folder[] = { 'P','r','o','g','r','a','m','F','i','l','e','s','6','4','F','o','l','d','e','r',0 };
- static const WCHAR szProgramFilesDir[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',0};
- static const WCHAR szProgramFilesDirx86[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',' ','(','x','8','6',')',0};
- static const WCHAR szCommonFilesDir[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',0};
- static const WCHAR szCommonFilesDirx86[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')',0};
- static const WCHAR szVersionNT64[] = { 'V','e','r','s','i','o','n','N','T','6','4',0 };
- static const WCHAR szUserInfo[] = {
- 'S','O','F','T','W','A','R','E','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'M','S',' ','S','e','t','u','p',' ','(','A','C','M','E',')','\\',
- 'U','s','e','r',' ','I','n','f','o',0
- };
- static const WCHAR szDefName[] = { 'D','e','f','N','a','m','e',0 };
- static const WCHAR szDefCompany[] = { 'D','e','f','C','o','m','p','a','n','y',0 };
- static const WCHAR szCurrentVersion[] = {
- 'S','O','F','T','W','A','R','E','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0
- };
- static const WCHAR szCurrentVersionNT[] = {
- 'S','O','F','T','W','A','R','E','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0
- };
- static const WCHAR szRegisteredOwner[] = {'R','e','g','i','s','t','e','r','e','d','O','w','n','e','r',0};
- static const WCHAR szRegisteredOrganization[] = {
- 'R','e','g','i','s','t','e','r','e','d','O','r','g','a','n','i','z','a','t','i','o','n',0
- };
- static const WCHAR szUSERNAME[] = {'U','S','E','R','N','A','M','E',0};
- static const WCHAR szCOMPANYNAME[] = {'C','O','M','P','A','N','Y','N','A','M','E',0};
- static const WCHAR szUserLanguageID[] = {'U','s','e','r','L','a','n','g','u','a','g','e','I','D',0};
- static const WCHAR szSystemLangID[] = {'S','y','s','t','e','m','L','a','n','g','u','a','g','e','I','D',0};
- static const WCHAR szProductState[] = {'P','r','o','d','u','c','t','S','t','a','t','e',0};
- static const WCHAR szLogonUser[] = {'L','o','g','o','n','U','s','e','r',0};
- static const WCHAR szNetHoodFolder[] = {'N','e','t','H','o','o','d','F','o','l','d','e','r',0};
- static const WCHAR szPrintHoodFolder[] = {'P','r','i','n','t','H','o','o','d','F','o','l','d','e','r',0};
- static const WCHAR szRecentFolder[] = {'R','e','c','e','n','t','F','o','l','d','e','r',0};
- static const WCHAR szComputerName[] = {'C','o','m','p','u','t','e','r','N','a','m','e',0};
-
/*
* Other things that probably should be set:
*
@@ -765,100 +643,100 @@ static VOID set_installer_properties(MSIPACKAGE *package)
*/
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szCommonAppDataFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"CommonAppDataFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_FAVORITES, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szFavoritesFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"FavoritesFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szFontsFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"FontsFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_SENDTO, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szSendToFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"SendToFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_STARTMENU, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szStartMenuFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"StartMenuFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_STARTUP, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szStartupFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"StartupFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_TEMPLATES, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szTemplateFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"TemplateFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_DESKTOP, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szDesktopFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"DesktopFolder", pth, -1 );
/* FIXME: set to AllUsers profile path if ALLUSERS is set */
SHGetFolderPathW(NULL, CSIDL_PROGRAMS, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szProgramMenuFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"ProgramMenuFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_ADMINTOOLS, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szAdminToolsFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"AdminToolsFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szAppDataFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"AppDataFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_SYSTEM, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szSystemFolder, pth, -1 );
- msi_set_property( package->db, szSystem16Folder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"SystemFolder", pth, -1 );
+ msi_set_property( package->db, L"System16Folder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szLocalAppDataFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"LocalAppDataFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_MYPICTURES, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szMyPicturesFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"MyPicturesFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szPersonalFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"PersonalFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szWindowsFolder, pth, -1 );
-
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"WindowsFolder", pth, -1 );
+
SHGetFolderPathW(NULL, CSIDL_PRINTHOOD, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szPrintHoodFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"PrintHoodFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_NETHOOD, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szNetHoodFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"NetHoodFolder", pth, -1 );
SHGetFolderPathW(NULL, CSIDL_RECENT, NULL, 0, pth);
- lstrcatW(pth, szBackSlash);
- msi_set_property( package->db, szRecentFolder, pth, -1 );
+ lstrcatW(pth, L"\\");
+ msi_set_property( package->db, L"RecentFolder", pth, -1 );
/* Physical Memory is specified in MB. Using total amount. */
msex.dwLength = sizeof(msex);
GlobalMemoryStatusEx( &msex );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, (int)(msex.ullTotalPhys / 1024 / 1024) );
- msi_set_property( package->db, szPhysicalMemory, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", (int)(msex.ullTotalPhys / 1024 / 1024) );
+ msi_set_property( package->db, L"PhysicalMemory", bufstr, len );
SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
ptr = wcschr(pth,'\\');
if (ptr) *(ptr + 1) = 0;
- msi_set_property( package->db, szWindowsVolume, pth, -1 );
-
+ msi_set_property( package->db, L"WindowsVolume", pth, -1 );
+
len = GetTempPathW(MAX_PATH, pth);
- msi_set_property( package->db, szTempFolder, pth, len );
+ msi_set_property( package->db, L"TempFolder", pth, len );
/* in a wine environment the user is always admin and privileged */
- msi_set_property( package->db, szAdminUser, szOne, -1 );
- msi_set_property( package->db, szPrivileged, szOne, -1 );
+ msi_set_property( package->db, L"AdminUser", L"1", -1 );
+ msi_set_property( package->db, L"Privileged", L"1", -1 );
/* set the os things */
OSVersion.dwOSVersionInfoSize = sizeof(OSVersion);
@@ -869,122 +747,122 @@ static VOID set_installer_properties(MSIPACKAGE *package)
verval = 603;
OSVersion.dwBuildNumber = 9600;
}
- len = swprintf( verstr, ARRAY_SIZE(verstr), szFormat, verval );
+ len = swprintf( verstr, ARRAY_SIZE(verstr), L"%u", verval );
switch (OSVersion.dwPlatformId)
{
- case VER_PLATFORM_WIN32_WINDOWS:
- msi_set_property( package->db, szVersion9x, verstr, len );
+ case VER_PLATFORM_WIN32_WINDOWS:
+ msi_set_property( package->db, L"Version9X", verstr, len );
break;
case VER_PLATFORM_WIN32_NT:
- msi_set_property( package->db, szVersionNT, verstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szFormat,OSVersion.wProductType );
- msi_set_property( package->db, szMsiNTProductType, bufstr, len );
+ msi_set_property( package->db, L"VersionNT", verstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wProductType );
+ msi_set_property( package->db, L"MsiNTProductType", bufstr, len );
break;
}
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szFormat, OSVersion.dwBuildNumber );
- msi_set_property( package->db, szWindowsBuild, bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szFormat, OSVersion.wServicePackMajor );
- msi_set_property( package->db, szServicePackLevel, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.dwBuildNumber );
+ msi_set_property( package->db, L"WindowsBuild", bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", OSVersion.wServicePackMajor );
+ msi_set_property( package->db, L"ServicePackLevel", bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szFormat2, MSI_MAJORVERSION, MSI_MINORVERSION );
- msi_set_property( package->db, szVersionMsi, bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szFormat, MSI_MAJORVERSION * 100 );
- msi_set_property( package->db, szVersionDatabase, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u.%u", MSI_MAJORVERSION, MSI_MINORVERSION );
+ msi_set_property( package->db, L"VersionMsi", bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%u", MSI_MAJORVERSION * 100 );
+ msi_set_property( package->db, L"VersionDatabase", bufstr, len );
- RegOpenKeyExW(HKEY_LOCAL_MACHINE, szCurrentVersion, 0,
+ RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0,
KEY_QUERY_VALUE | KEY_WOW64_64KEY, &hkey);
GetNativeSystemInfo( &sys_info );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, sys_info.wProcessorLevel );
- msi_set_property( package->db, szIntel, bufstr, len );
+ 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)
{
GetSystemDirectoryW( pth, MAX_PATH );
PathAddBackslashW( pth );
- msi_set_property( package->db, szSystemFolder, pth, -1 );
+ msi_set_property( package->db, L"SystemFolder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szProgramFilesDir, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFilesFolder, pth, -1 );
+ msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szCommonFilesDir, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFilesFolder, pth, -1 );
+ msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
}
else if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
{
- msi_set_property( package->db, szMsiAMD64, bufstr, -1 );
- msi_set_property( package->db, szMsix64, bufstr, -1 );
- msi_set_property( package->db, szVersionNT64, verstr, -1 );
+ msi_set_property( package->db, L"MsiAMD64", bufstr, -1 );
+ msi_set_property( package->db, L"Msix64", bufstr, -1 );
+ msi_set_property( package->db, L"VersionNT64", verstr, -1 );
GetSystemDirectoryW( pth, MAX_PATH );
PathAddBackslashW( pth );
- msi_set_property( package->db, szSystem64Folder, pth, -1 );
+ msi_set_property( package->db, L"System64Folder", pth, -1 );
GetSystemWow64DirectoryW( pth, MAX_PATH );
PathAddBackslashW( pth );
- msi_set_property( package->db, szSystemFolder, pth, -1 );
+ msi_set_property( package->db, L"SystemFolder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szProgramFilesDir, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"ProgramFilesDir", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFiles64Folder, pth, -1 );
+ msi_set_property( package->db, L"ProgramFiles64Folder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szProgramFilesDirx86, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"ProgramFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szProgramFilesFolder, pth, -1 );
+ msi_set_property( package->db, L"ProgramFilesFolder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szCommonFilesDir, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"CommonFilesDir", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFiles64Folder, pth, -1 );
+ msi_set_property( package->db, L"CommonFiles64Folder", pth, -1 );
len = MAX_PATH;
- RegQueryValueExW(hkey, szCommonFilesDirx86, 0, &type, (BYTE *)pth, &len);
+ RegQueryValueExW(hkey, L"CommonFilesDir (x86)", 0, &type, (BYTE *)pth, &len);
PathAddBackslashW( pth );
- msi_set_property( package->db, szCommonFilesFolder, pth, -1 );
+ msi_set_property( package->db, L"CommonFilesFolder", pth, -1 );
}
RegCloseKey(hkey);
/* Screen properties. */
dc = GetDC(0);
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, GetDeviceCaps(dc, HORZRES) );
- msi_set_property( package->db, szScreenX, bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, GetDeviceCaps(dc, VERTRES) );
- msi_set_property( package->db, szScreenY, bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, GetDeviceCaps(dc, BITSPIXEL) );
- msi_set_property( package->db, szColorBits, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, HORZRES) );
+ msi_set_property( package->db, L"ScreenX", bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, VERTRES) );
+ msi_set_property( package->db, L"ScreenY", bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", GetDeviceCaps(dc, BITSPIXEL) );
+ msi_set_property( package->db, L"ColorBits", bufstr, len );
ReleaseDC(0, dc);
/* USERNAME and COMPANYNAME */
- username = msi_dup_property( package->db, szUSERNAME );
- companyname = msi_dup_property( package->db, szCOMPANYNAME );
+ username = msi_dup_property( package->db, L"USERNAME" );
+ companyname = msi_dup_property( package->db, L"COMPANYNAME" );
if ((!username || !companyname) &&
- RegOpenKeyW( HKEY_CURRENT_USER, szUserInfo, &hkey ) == ERROR_SUCCESS)
+ RegOpenKeyW( HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey ) == ERROR_SUCCESS)
{
if (!username &&
- (username = msi_reg_get_val_str( hkey, szDefName )))
- msi_set_property( package->db, szUSERNAME, username, -1 );
+ (username = msi_reg_get_val_str( hkey, L"DefName" )))
+ msi_set_property( package->db, L"USERNAME", username, -1 );
if (!companyname &&
- (companyname = msi_reg_get_val_str( hkey, szDefCompany )))
- msi_set_property( package->db, szCOMPANYNAME, companyname, -1 );
+ (companyname = msi_reg_get_val_str( hkey, L"DefCompany" )))
+ msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
CloseHandle( hkey );
}
if ((!username || !companyname) &&
- RegOpenKeyExW( HKEY_LOCAL_MACHINE, szCurrentVersionNT, 0, KEY_QUERY_VALUE|KEY_WOW64_64KEY,
- &hkey ) == ERROR_SUCCESS)
+ RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0,
+ KEY_QUERY_VALUE|KEY_WOW64_64KEY, &hkey ) == ERROR_SUCCESS)
{
if (!username &&
- (username = msi_reg_get_val_str( hkey, szRegisteredOwner )))
- msi_set_property( package->db, szUSERNAME, username, -1 );
+ (username = msi_reg_get_val_str( hkey, L"RegisteredOwner" )))
+ msi_set_property( package->db, L"USERNAME", username, -1 );
if (!companyname &&
- (companyname = msi_reg_get_val_str( hkey, szRegisteredOrganization )))
- msi_set_property( package->db, szCOMPANYNAME, companyname, -1 );
+ (companyname = msi_reg_get_val_str( hkey, L"RegisteredOrganization" )))
+ msi_set_property( package->db, L"COMPANYNAME", companyname, -1 );
CloseHandle( hkey );
}
msi_free( username );
@@ -996,15 +874,15 @@ static VOID set_installer_properties(MSIPACKAGE *package)
set_msi_assembly_prop( package );
langid = GetUserDefaultLangID();
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, langid );
- msi_set_property( package->db, szUserLanguageID, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
+ msi_set_property( package->db, L"UserLanguageID", bufstr, len );
langid = GetSystemDefaultLangID();
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, langid );
- msi_set_property( package->db, szSystemLangID, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", langid );
+ msi_set_property( package->db, L"SystemLanguageID", bufstr, len );
- len = swprintf( bufstr, ARRAY_SIZE(bufstr), szIntFormat, MsiQueryProductStateW(package->ProductCode) );
- msi_set_property( package->db, szProductState, bufstr, len );
+ len = swprintf( bufstr, ARRAY_SIZE(bufstr), L"%d", MsiQueryProductStateW(package->ProductCode) );
+ msi_set_property( package->db, L"ProductState", bufstr, len );
len = 0;
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
@@ -1013,7 +891,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
if ((username = msi_alloc( len * sizeof(WCHAR) )))
{
if (GetUserNameW( username, &len ))
- msi_set_property( package->db, szLogonUser, username, len - 1 );
+ msi_set_property( package->db, L"LogonUser", username, len - 1 );
msi_free( username );
}
}
@@ -1024,7 +902,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
if ((computername = msi_alloc( len * sizeof(WCHAR) )))
{
if (GetComputerNameW( computername, &len ))
- msi_set_property( package->db, szComputerName, computername, len );
+ msi_set_property( package->db, L"ComputerName", computername, len );
msi_free( computername );
}
}
@@ -1066,9 +944,7 @@ static UINT msi_load_admin_properties(MSIPACKAGE *package)
BYTE *data;
UINT r, sz;
- static const WCHAR stmname[] = {'A','d','m','i','n','P','r','o','p','e','r','t','i','e','s',0};
-
- r = read_stream_data(package->db->storage, stmname, FALSE, &data, &sz);
+ r = read_stream_data(package->db->storage, L"AdminProperties", FALSE, &data, &sz);
if (r != ERROR_SUCCESS)
return r;
@@ -1081,17 +957,16 @@ static UINT msi_load_admin_properties(MSIPACKAGE *package)
void msi_adjust_privilege_properties( MSIPACKAGE *package )
{
/* FIXME: this should depend on the user's privileges */
- if (msi_get_property_int( package->db, szAllUsers, 0 ) == 2)
+ if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
{
TRACE("resetting ALLUSERS property from 2 to 1\n");
- msi_set_property( package->db, szAllUsers, szOne, -1 );
+ msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
}
- msi_set_property( package->db, szAdminUser, szOne, -1 );
+ msi_set_property( package->db, L"AdminUser", L"1", -1 );
}
MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
{
- static const WCHAR fmtW[] = {'%','u',0};
MSIPACKAGE *package;
WCHAR uilevel[11];
int len;
@@ -1115,13 +990,13 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
msi_clone_properties( package->db );
msi_adjust_privilege_properties( package );
- package->ProductCode = msi_dup_property( package->db, szProductCode );
+ package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
set_installer_properties( package );
package->ui_level = gUILevel;
- len = swprintf( uilevel, ARRAY_SIZE(uilevel), fmtW, gUILevel & INSTALLUILEVEL_MASK );
- msi_set_property( package->db, szUILevel, uilevel, len );
+ len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
+ msi_set_property( package->db, L"UILevel", uilevel, len );
r = msi_load_suminfo_properties( package );
if (r != ERROR_SUCCESS)
@@ -1177,21 +1052,18 @@ UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename )
UINT msi_create_empty_local_file( LPWSTR path, LPCWSTR suffix )
{
- static const WCHAR szInstaller[] = {
- '\\','I','n','s','t','a','l','l','e','r','\\',0};
- static const WCHAR fmt[] = {'%','x',0};
DWORD time, len, i, offset;
HANDLE handle;
time = GetTickCount();
GetWindowsDirectoryW( path, MAX_PATH );
- lstrcatW( path, szInstaller );
+ lstrcatW( path, L"\\Installer\\" );
CreateDirectoryW( path, NULL );
len = lstrlenW(path);
for (i = 0; i < 0x10000; i++)
{
- offset = swprintf( path + len, MAX_PATH - len, fmt, (time + i) & 0xffff );
+ offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
handle = CreateFileW( path, GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 );
@@ -1210,11 +1082,11 @@ UINT msi_create_empty_local_file( LPWSTR path, LPCWSTR suffix )
static enum platform parse_platform( const WCHAR *str )
{
- if (!str[0] || !wcscmp( str, szIntel )) return PLATFORM_INTEL;
- else if (!wcscmp( str, szIntel64 )) return PLATFORM_INTEL64;
- else if (!wcscmp( str, szX64 ) || !wcscmp( str, szAMD64 )) return PLATFORM_X64;
- else if (!wcscmp( str, szARM )) return PLATFORM_ARM;
- else if (!wcscmp( str, szARM64 )) return PLATFORM_ARM64;
+ if (!str[0] || !wcscmp( str, L"Intel" )) return PLATFORM_INTEL;
+ else if (!wcscmp( str, L"Intel64" )) return PLATFORM_INTEL64;
+ else if (!wcscmp( str, L"x64" ) || !wcscmp( str, L"AMD64" )) return PLATFORM_X64;
+ else if (!wcscmp( str, L"Arm" )) return PLATFORM_ARM;
+ else if (!wcscmp( str, L"Arm64" )) return PLATFORM_ARM64;
return PLATFORM_UNRECOGNIZED;
}
@@ -1332,17 +1204,12 @@ static UINT validate_package( MSIPACKAGE *package )
static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop )
{
- static const WCHAR select_query[] = {
- 'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ',
- 'F','R','O','M',' ','`','P','r','o','p','e','r','t','y','`',' ',
- 'W','H','E','R','E',' ','`','P','r','o','p','e','r','t','y','`','=',
- '\'','%','s','\'',0};
WCHAR query[MAX_PATH];
MSIQUERY *view;
MSIRECORD *rec;
WCHAR *ret = NULL;
- swprintf(query, ARRAY_SIZE(query), select_query, prop);
+ swprintf(query, ARRAY_SIZE(query), L"SELECT `Value` FROM `Property` WHERE `Property`='%s'", prop);
if (MSI_DatabaseOpenViewW( db, query, &view ) != ERROR_SUCCESS)
{
return NULL;
@@ -1365,12 +1232,12 @@ static WCHAR *get_property( MSIDATABASE *db, const WCHAR *prop )
static WCHAR *get_product_code( MSIDATABASE *db )
{
- return get_property( db, szProductCode );
+ return get_property( db, L"ProductCode" );
}
static WCHAR *get_product_version( MSIDATABASE *db )
{
- return get_property( db, szProductVersion );
+ return get_property( db, L"ProductVersion" );
}
static UINT get_registered_local_package( const WCHAR *product, WCHAR *localfile )
@@ -1436,9 +1303,9 @@ UINT msi_set_original_database_property( MSIDATABASE *db, const WCHAR *package )
UINT r;
if (UrlIsW( package, URLIS_URL ))
- r = msi_set_property( db, szOriginalDatabase, package, -1 );
+ r = msi_set_property( db, L"OriginalDatabase", package, -1 );
else if (package[0] == '#')
- r = msi_set_property( db, szOriginalDatabase, db->path, -1 );
+ r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
else
{
DWORD len;
@@ -1447,7 +1314,7 @@ UINT msi_set_original_database_property( MSIDATABASE *db, const WCHAR *package )
if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
if (!(path = msi_alloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
len = GetFullPathNameW( package, len, path, NULL );
- r = msi_set_property( db, szOriginalDatabase, path, len );
+ r = msi_set_property( db, L"OriginalDatabase", path, len );
msi_free( path );
}
return r;
@@ -1455,7 +1322,6 @@ UINT msi_set_original_database_property( MSIDATABASE *db, const WCHAR *package )
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
{
- static const WCHAR dotmsi[] = {'.','m','s','i',0};
MSIDATABASE *db;
MSIPACKAGE *package;
MSIHANDLE handle;
@@ -1502,7 +1368,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
r = get_local_package( db, localfile );
if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES)
{
- r = msi_create_empty_local_file( localfile, dotmsi );
+ r = msi_create_empty_local_file( localfile, L".msi" );
if (r != ERROR_SUCCESS)
{
msiobj_release( &db->hdr );
@@ -1583,7 +1449,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
msiobj_release( &package->hdr );
return r;
}
- msi_set_property( package->db, szDatabase, db->path, -1 );
+ msi_set_property( package->db, L"DATABASE", db->path, -1 );
set_installed_prop( package );
msi_set_context( package );
@@ -1591,7 +1457,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
{
TRACE("product already registered\n");
- msi_set_property( package->db, szProductToBeRegistered, szOne, -1 );
+ msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
}
msi_free(product_code);
@@ -1765,12 +1631,6 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
{
- static const WCHAR szActionData[] = {'A','c','t','i','o','n','D','a','t','a',0};
- static const WCHAR szActionText[] = {'A','c','t','i','o','n','T','e','x','t',0};
- static const WCHAR szSetProgress[] = {'S','e','t','P','r','o','g','r','e','s','s',0};
- static const WCHAR szWindows_Installer[] =
- {'W','i','n','d','o','w','s',' ','I','n','s','t','a','l','l','e','r',0};
-
if (!package || (package->ui_level & INSTALLUILEVEL_MASK) == INSTALLUILEVEL_NONE)
return 0;
@@ -1784,17 +1644,17 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
if (!(eMessageType & MB_ICONMASK))
eMessageType |= MB_ICONEXCLAMATION;
- return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
+ return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
case INSTALLMESSAGE_WARNING:
if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
if (!(eMessageType & MB_ICONMASK))
eMessageType |= MB_ICONASTERISK;
- return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
+ return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
case INSTALLMESSAGE_USER:
if (package->ui_level & INSTALLUILEVEL_PROGRESSONLY) return 0;
if (!(eMessageType & MB_ICONMASK))
eMessageType |= MB_USERICON;
- return MessageBoxW(gUIhwnd, message, szWindows_Installer, eMessageType & 0x00ffffff);
+ return MessageBoxW(gUIhwnd, message, L"Windows Installer", eMessageType & 0x00ffffff);
case INSTALLMESSAGE_INFO:
case INSTALLMESSAGE_INITIALIZE:
case INSTALLMESSAGE_TERMINATE:
@@ -1815,7 +1675,7 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
if (!uirow) return -1;
deformat_string(package, MSI_RecordGetString(record, 2), &deformatted);
MSI_RecordSetStringW(uirow, 1, deformatted);
- msi_event_fire(package, szActionText, uirow);
+ msi_event_fire(package, L"ActionText", uirow);
msi_free(deformatted);
msiobj_release(&uirow->hdr);
@@ -1826,7 +1686,7 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
MSIRECORD *uirow = MSI_CreateRecord(1);
if (!uirow) return -1;
MSI_RecordSetStringW(uirow, 1, message);
- msi_event_fire(package, szActionData, uirow);
+ msi_event_fire(package, L"ActionData", uirow);
msiobj_release(&uirow->hdr);
if (package->action_progress_increment)
@@ -1835,13 +1695,13 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
if (!uirow) return -1;
MSI_RecordSetInteger(uirow, 1, 2);
MSI_RecordSetInteger(uirow, 2, package->action_progress_increment);
- msi_event_fire(package, szSetProgress, uirow);
+ msi_event_fire(package, L"SetProgress", uirow);
msiobj_release(&uirow->hdr);
}
return 1;
}
case INSTALLMESSAGE_PROGRESS:
- msi_event_fire(package, szSetProgress, record);
+ msi_event_fire(package, L"SetProgress", record);
return 1;
case INSTALLMESSAGE_COMMONDATA:
switch (MSI_RecordGetInteger(record, 1))
@@ -1860,8 +1720,6 @@ static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
}
}
-static const WCHAR szActionNotFound[] = {'D','E','B','U','G',':',' ','E','r','r','o','r',' ','[','1',']',':',' ',' ','A','c','t','i','o','n',' ','n','o','t',' ','f','o','u','n','d',':',' ','[','2',']',0};
-
static const struct
{
int id;
@@ -1869,7 +1727,7 @@ static const struct
}
internal_errors[] =
{
- {2726, szActionNotFound},
+ {2726, L"DEBUG: Error [1]: Action not found: [2]"},
{0}
};
@@ -1891,14 +1749,10 @@ static LPCWSTR get_internal_error_message(int error)
/* Returned string must be freed */
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
{
- static const WCHAR query[] =
- {'S','E','L','E','C','T',' ','`','M','e','s','s','a','g','e','`',' ',
- 'F','R','O','M',' ','`','E','r','r','o','r','`',' ','W','H','E','R','E',' ',
- '`','E','r','r','o','r','`',' ','=',' ','%','i',0};
MSIRECORD *record;
LPWSTR ret = NULL;
- if ((record = MSI_QueryGetRecord(db, query, error)))
+ if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
{
ret = msi_dup_record_field(record, 1);
msiobj_release(&record->hdr);
@@ -2028,7 +1882,7 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC
template_rec = msi_dup_record_field(record, 0);
template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
- if (!template_prefix) template_prefix = strdupW(szEmpty);
+ if (!template_prefix) template_prefix = strdupW(L"");
if (!template_rec)
{
@@ -2060,19 +1914,17 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIREC
msi_free(package->LastAction);
msi_free(package->LastActionTemplate);
package->LastAction = msi_dup_record_field(record, 1);
- if (!package->LastAction) package->LastAction = strdupW(szEmpty);
+ if (!package->LastAction) package->LastAction = strdupW(L"");
package->LastActionTemplate = msi_dup_record_field(record, 3);
break;
}
case INSTALLMESSAGE_ACTIONDATA:
if (package->LastAction && package->LastActionTemplate)
{
- static const WCHAR template_s[] =
- {'{','{','%','s',':',' ','}','}','%','s',0};
size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
WCHAR *template = msi_alloc(len * sizeof(WCHAR));
if (!template) return ERROR_OUTOFMEMORY;
- swprintf(template, len, template_s, package->LastAction, package->LastActionTemplate);
+ swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
MSI_RecordSetStringW(record, 0, template);
msi_free(template);
}
@@ -2174,19 +2026,6 @@ void msi_reset_source_folders( MSIPACKAGE *package )
UINT msi_set_property( MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len )
{
- static const WCHAR insert_query[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ',
- '(','`','_','P','r','o','p','e','r','t','y','`',',','`','V','a','l','u','e','`',')',' ',
- 'V','A','L','U','E','S',' ','(','?',',','?',')',0};
- static const WCHAR update_query[] = {
- 'U','P','D','A','T','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ',
- 'S','E','T',' ','`','V','a','l','u','e','`',' ','=',' ','?',' ','W','H','E','R','E',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',0};
- static const WCHAR delete_query[] = {
- 'D','E','L','E','T','E',' ','F','R','O','M',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ','W','H','E','R','E',' ',
- '`','_','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',0};
MSIQUERY *view;
MSIRECORD *row = NULL;
DWORD sz = 0;
@@ -2207,17 +2046,17 @@ UINT msi_set_property( MSIDATABASE *db, const WCHAR *name, const WCHAR *value, i
rc = msi_get_property( db, name, 0, &sz );
if (!value || (!*value && !len))
{
- swprintf( query, ARRAY_SIZE(query), delete_query, name );
+ swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
}
else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
{
- swprintf( query, ARRAY_SIZE(query), update_query, name );
+ swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
row = MSI_CreateRecord(1);
msi_record_set_string( row, 1, value, len );
}
else
{
- lstrcpyW( query, insert_query );
+ lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
row = MSI_CreateRecord(2);
msi_record_set_string( row, 1, name, -1 );
msi_record_set_string( row, 2, value, len );
@@ -2261,7 +2100,7 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue
}
ret = msi_set_property( package->db, szName, szValue, -1 );
- if (ret == ERROR_SUCCESS && !wcscmp( szName, szSourceDir ))
+ if (ret == ERROR_SUCCESS && !wcscmp( szName, L"SourceDir" ))
msi_reset_source_folders( package );
msiobj_release( &package->hdr );
@@ -2270,23 +2109,16 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue
static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name )
{
- static const WCHAR query[]= {
- 'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ',
- 'F','R','O','M',' ' ,'`','_','P','r','o','p','e','r','t','y','`',' ',
- 'W','H','E','R','E',' ' ,'`','_','P','r','o','p','e','r','t','y','`','=','?',0};
MSIRECORD *rec, *row = NULL;
MSIQUERY *view;
UINT r;
-
- static const WCHAR szDate[] = {'D','a','t','e',0};
- static const WCHAR szTime[] = {'T','i','m','e',0};
WCHAR *buffer;
int length;
if (!name || !*name)
return NULL;
- if (!wcscmp(name, szDate))
+ if (!wcscmp(name, L"Date"))
{
length = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, NULL, 0);
if (!length)
@@ -2304,7 +2136,7 @@ static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name )
msi_free(buffer);
return row;
}
- else if (!wcscmp(name, szTime))
+ else if (!wcscmp(name, L"Time"))
{
length = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER, NULL, NULL, NULL, 0);
if (!length)
@@ -2329,7 +2161,7 @@ static MSIRECORD *msi_get_property_row( MSIDATABASE *db, LPCWSTR name )
MSI_RecordSetStringW(rec, 1, name);
- r = MSI_DatabaseOpenViewW(db, query, &view);
+ r = MSI_DatabaseOpenViewW(db, L"SELECT `Value` FROM `_Property` WHERE `_Property`=?", &view);
if (r == ERROR_SUCCESS)
{
MSI_ViewExecute(view, rec);
@@ -2408,7 +2240,7 @@ int msi_get_property_int( MSIDATABASE *db, LPCWSTR prop, int def )
UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
{
- const WCHAR *value = szEmpty;
+ const WCHAR *value = L"";
MSIPACKAGE *package;
MSIRECORD *row;
WCHAR *nameW;
@@ -2480,7 +2312,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
{
- const WCHAR *value = szEmpty;
+ const WCHAR *value = L"";
MSIPACKAGE *package;
MSIRECORD *row;
int len = 0;
--
2.28.0
1
0
28 Oct '20
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/msi.c | 182 +++++++++++++++++--------------------------------
1 file changed, 64 insertions(+), 118 deletions(-)
diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 6387b0a9372..71de13a8ffc 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -53,8 +53,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
BOOL is_wow64;
-static const WCHAR installerW[] = {'\\','I','n','s','t','a','l','l','e','r',0};
-
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
{
HKEY hkey = NULL;
@@ -109,10 +107,6 @@ static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
LPWSTR path;
MSIINSTALLCONTEXT context;
- static const WCHAR managed[] = {
- 'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0};
- static const WCHAR local[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
-
TRACE("%s %p\n", debugstr_w(szProduct), package);
r = msi_locate_product(szProduct, &context);
@@ -124,9 +118,9 @@ static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
return ERROR_UNKNOWN_PRODUCT;
if (context == MSIINSTALLCONTEXT_USERMANAGED)
- path = msi_reg_get_val_str(props, managed);
+ path = msi_reg_get_val_str(props, L"ManagedLocalPackage");
else
- path = msi_reg_get_val_str(props, local);
+ path = msi_reg_get_val_str(props, L"LocalPackage");
r = ERROR_UNKNOWN_PRODUCT;
@@ -250,7 +244,7 @@ UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
if (!*szPackagePath)
return ERROR_PATH_NOT_FOUND;
- reinstallmode = msi_get_command_line_option(szCommandLine, szReinstallMode, &len);
+ reinstallmode = msi_get_command_line_option(szCommandLine, L"REINSTALLMODE", &len);
if (reinstallmode)
{
while (len > 0)
@@ -292,7 +286,7 @@ UINT WINAPI MsiReinstallProductW(LPCWSTR szProduct, DWORD dwReinstallMode)
{
TRACE("%s %08x\n", debugstr_w(szProduct), dwReinstallMode);
- return MsiReinstallFeatureW(szProduct, szAll, dwReinstallMode);
+ return MsiReinstallFeatureW(szProduct, L"ALL", dwReinstallMode);
}
UINT WINAPI MsiApplyPatchA(LPCSTR szPatchPackage, LPCSTR szInstallPackage,
@@ -376,9 +370,6 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
LPWSTR cmd, *codes = NULL;
BOOL succeeded = FALSE;
- static const WCHAR fmt[] = {'%','s',' ','P','A','T','C','H','=','"','%','s','"',0};
- static const WCHAR empty[] = {0};
-
if (!szPatchPackage || !szPatchPackage[0])
return ERROR_INVALID_PARAMETER;
@@ -386,16 +377,16 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
return r;
if (!szCommandLine)
- cmd_ptr = empty;
+ cmd_ptr = L"";
- size = lstrlenW(cmd_ptr) + lstrlenW(fmt) + lstrlenW(szPatchPackage) + 1;
+ size = lstrlenW(cmd_ptr) + lstrlenW(L"%s PATCH=\"%s\"") + lstrlenW(szPatchPackage) + 1;
cmd = msi_alloc(size * sizeof(WCHAR));
if (!cmd)
{
msi_free(codes);
return ERROR_OUTOFMEMORY;
}
- swprintf(cmd, size, fmt, cmd_ptr, szPatchPackage);
+ swprintf(cmd, size, L"%s PATCH=\"%s\"", cmd_ptr, szPatchPackage);
if (szProductCode)
r = MsiConfigureProductExW(szProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
@@ -603,9 +594,6 @@ static UINT MSI_ApplicablePatchW( MSIPACKAGE *package, LPCWSTR patch )
/* IXMLDOMDocument should be set to XPath mode already */
static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
{
- static const WCHAR queryW[] = {'M','s','i','P','a','t','c','h','/',
- 'T','a','r','g','e','t','P','r','o','d','u','c','t','/',
- 'T','a','r','g','e','t','P','r','o','d','u','c','t','C','o','d','e',0};
UINT r = ERROR_FUNCTION_FAILED;
IXMLDOMNodeList *list;
LPWSTR product_code;
@@ -613,7 +601,7 @@ static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
HRESULT hr;
BSTR s;
- product_code = msi_dup_property( package->db, szProductCode );
+ product_code = msi_dup_property( package->db, L"ProductCode" );
if (!product_code)
{
/* FIXME: the property ProductCode should be written into the DB somewhere */
@@ -621,7 +609,7 @@ static UINT MSI_ApplicablePatchXML( MSIPACKAGE *package, IXMLDOMDocument *desc )
return ERROR_SUCCESS;
}
- s = SysAllocString(queryW);
+ s = SysAllocString( L"MsiPatch/TargetProduct/TargetProductCode" );
hr = IXMLDOMDocument_selectNodes( desc, s, &list );
SysFreeString(s);
if (hr != S_OK)
@@ -808,7 +796,7 @@ static UINT open_package( const WCHAR *product, const WCHAR *usersid,
r = MSIREG_OpenInstallProps( product, context, usersid, &props, FALSE );
if (r != ERROR_SUCCESS) return ERROR_BAD_CONFIGURATION;
- if ((localpath = msi_reg_get_val_str( props, szLocalPackage )))
+ if ((localpath = msi_reg_get_val_str( props, L"LocalPackage" )))
{
lstrcpyW( sourcepath, localpath );
msi_free( localpath );
@@ -858,15 +846,6 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
LPWSTR commandline;
- static const WCHAR szInstalled[] = {
- ' ','I','n','s','t','a','l','l','e','d','=','1',0};
- static const WCHAR szMaxInstallLevel[] = {
- ' ','I','N','S','T','A','L','L','L','E','V','E','L','=','3','2','7','6','7',0};
- static const WCHAR szRemoveAll[] = {
- ' ','R','E','M','O','V','E','=','A','L','L',0};
- static const WCHAR szMachine[] = {
- ' ','A','L','L','U','S','E','R','S','=','1',0};
-
TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
debugstr_w(szCommandLine));
@@ -888,19 +867,19 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
if (r != ERROR_SUCCESS)
return r;
- sz = lstrlenW(szInstalled) + 1;
+ sz = lstrlenW(L" Installed=1") + 1;
if (szCommandLine)
sz += lstrlenW(szCommandLine);
if (eInstallState != INSTALLSTATE_DEFAULT)
- sz += lstrlenW(szMaxInstallLevel);
+ sz += lstrlenW(L" INSTALLLEVEL=32767");
if (eInstallState == INSTALLSTATE_ABSENT)
- sz += lstrlenW(szRemoveAll);
+ sz += lstrlenW(L" REMOVE=ALL");
if (context == MSIINSTALLCONTEXT_MACHINE)
- sz += lstrlenW(szMachine);
+ sz += lstrlenW(L" ALLUSERS=1");
commandline = msi_alloc(sz * sizeof(WCHAR));
if (!commandline)
@@ -911,16 +890,16 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
commandline[0] = 0;
if (szCommandLine)
- lstrcpyW(commandline,szCommandLine);
+ lstrcpyW(commandline, szCommandLine);
if (eInstallState != INSTALLSTATE_DEFAULT)
- lstrcatW(commandline, szMaxInstallLevel);
+ lstrcatW(commandline, L" INSTALLLEVEL=32767");
if (eInstallState == INSTALLSTATE_ABSENT)
- lstrcatW(commandline, szRemoveAll);
+ lstrcatW(commandline, L" REMOVE=ALL");
if (context == MSIINSTALLCONTEXT_MACHINE)
- lstrcatW(commandline, szMachine);
+ lstrcatW(commandline, L" ALLUSERS=1");
sz = sizeof(sourcepath);
MsiSourceListGetInfoW(szProduct, NULL, context, MSICODE_PRODUCT,
@@ -1041,7 +1020,7 @@ UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer)
return ERROR_INVALID_PARAMETER;
if (MSIREG_OpenUserDataComponentKey(szComponent, NULL, &compkey, FALSE) != ERROR_SUCCESS &&
- MSIREG_OpenUserDataComponentKey(szComponent, szLocalSid, &compkey, FALSE) != ERROR_SUCCESS)
+ MSIREG_OpenUserDataComponentKey(szComponent, L"S-1-5-18", &compkey, FALSE) != ERROR_SUCCESS)
{
return ERROR_UNKNOWN_COMPONENT;
}
@@ -1102,12 +1081,11 @@ static WCHAR *reg_get_value( HKEY hkey, const WCHAR *name, DWORD *type )
if (*type == REG_SZ) return msi_reg_get_val_str( hkey, name );
if (*type == REG_DWORD)
{
- static const WCHAR fmt[] = {'%','u',0};
WCHAR temp[11];
DWORD val;
if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
- swprintf( temp, ARRAY_SIZE(temp), fmt, val );
+ swprintf( temp, ARRAY_SIZE(temp), L"%u", val );
return strdupW( temp );
}
@@ -1119,10 +1097,6 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
awstring *szValue, LPDWORD pcchValueBuf)
{
static WCHAR empty[] = {0};
- static const WCHAR sourcelist[] = {'S','o','u','r','c','e','L','i','s','t',0};
- static const WCHAR display_name[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
- static const WCHAR display_version[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
- static const WCHAR assignment[] = {'A','s','s','i','g','n','m','e','n','t',0};
MSIINSTALLCONTEXT context = MSIINSTALLCONTEXT_USERUNMANAGED;
UINT r = ERROR_UNKNOWN_PROPERTY;
HKEY prodkey, userdata, source;
@@ -1182,9 +1156,9 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
}
if (!wcscmp( szAttribute, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
- szAttribute = display_name;
+ szAttribute = L"DisplayName";
else if (!wcscmp( szAttribute, INSTALLPROPERTY_VERSIONSTRINGW ))
- szAttribute = display_version;
+ szAttribute = L"DisplayVersion";
val = reg_get_value(userdata, szAttribute, &type);
if (!val)
@@ -1209,11 +1183,11 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
}
if (!wcscmp( szAttribute, INSTALLPROPERTY_ASSIGNMENTTYPEW ))
- szAttribute = assignment;
+ szAttribute = L"Assignment";
if (!wcscmp( szAttribute, INSTALLPROPERTY_PACKAGENAMEW ))
{
- res = RegOpenKeyW(prodkey, sourcelist, &source);
+ res = RegOpenKeyW(prodkey, L"SourceList", &source);
if (res != ERROR_SUCCESS)
{
r = ERROR_UNKNOWN_PRODUCT;
@@ -1426,14 +1400,6 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty,
LPWSTR szValue, LPDWORD pcchValue)
{
- static const WCHAR five[] = {'5',0};
- static const WCHAR displayname[] = {
- 'D','i','s','p','l','a','y','N','a','m','e',0};
- static const WCHAR displayversion[] = {
- 'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
- static const WCHAR managed_local_package[] = {
- 'M','a','n','a','g','e','d','L','o','c','a','l',
- 'P','a','c','k','a','g','e',0};
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE];
LPCWSTR package = NULL;
HKEY props = NULL, prod, classes = NULL, managed, hkey = NULL;
@@ -1478,7 +1444,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
}
else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
{
- package = managed_local_package;
+ package = L"ManagedLocalPackage";
if (!props && !managed)
goto done;
@@ -1522,13 +1488,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
msi_free(val);
if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW ))
- szProperty = displayname;
+ szProperty = L"DisplayName";
else if (!wcscmp( szProperty, INSTALLPROPERTY_VERSIONSTRINGW ))
- szProperty = displayversion;
+ szProperty = L"DisplayVersion";
val = reg_get_value(props, szProperty, &type);
if (!val)
- val = strdupW(szEmpty);
+ val = strdupW(L"");
r = msi_copy_outval(val, szValue, pcchValue);
}
@@ -1553,7 +1519,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
val = reg_get_value(hkey, szProperty, &type);
if (!val)
- val = strdupW(szEmpty);
+ val = strdupW(L"");
r = msi_copy_outval(val, szValue, pcchValue);
}
@@ -1568,10 +1534,10 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
goto done;
msi_free(val);
- val = strdupW(five);
+ val = strdupW(L"5");
}
else
- val = strdupW(szOne);
+ val = strdupW(L"1");
r = msi_copy_outval(val, szValue, pcchValue);
goto done;
@@ -1579,13 +1545,13 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
else if (props && (val = reg_get_value(props, package, &type)))
{
msi_free(val);
- val = strdupW(five);
+ val = strdupW(L"5");
r = msi_copy_outval(val, szValue, pcchValue);
goto done;
}
if (prod || managed)
- val = strdupW(szOne);
+ val = strdupW(L"1");
else
goto done;
@@ -1597,7 +1563,7 @@ UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
goto done;
/* FIXME */
- val = strdupW(szEmpty);
+ val = strdupW(L"");
r = msi_copy_outval(val, szValue, pcchValue);
}
else
@@ -1700,8 +1666,6 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext,
LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
{
- static const WCHAR szManagedPackage[] =
- {'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0};
WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_patch[SQUASHED_GUID_SIZE];
HKEY udprod = 0, prod = 0, props = 0;
HKEY patch = 0, patches = 0;
@@ -1735,7 +1699,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid)
return ERROR_INVALID_PARAMETER;
- if (szUserSid && !wcscmp( szUserSid, szLocalSid ))
+ if (szUserSid && !wcscmp( szUserSid, L"S-1-5-18" ))
return ERROR_INVALID_PARAMETER;
if (MSIREG_OpenUserDataProductKey(szProductCode, dwContext, NULL,
@@ -1748,7 +1712,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
r = ERROR_UNKNOWN_PATCH;
- res = RegOpenKeyExW(udprod, szPatches, 0, KEY_READ, &patches);
+ res = RegOpenKeyExW(udprod, L"Patches", 0, KEY_READ, &patches);
if (res != ERROR_SUCCESS)
goto done;
@@ -1762,7 +1726,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
&prod, FALSE) != ERROR_SUCCESS)
goto done;
- res = RegOpenKeyExW(prod, szPatches, 0, KEY_ALL_ACCESS, &prodpatches);
+ res = RegOpenKeyExW(prod, L"Patches", 0, KEY_ALL_ACCESS, &prodpatches);
if (res != ERROR_SUCCESS)
goto done;
@@ -1778,13 +1742,13 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
if (!wcscmp( szProperty, INSTALLPROPERTY_LOCALPACKAGEW ))
{
if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
- szProperty = szManagedPackage;
+ szProperty = L"ManagedLocalPackage";
datakey = udpatch;
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLDATEW ))
{
datakey = patch;
- szProperty = szInstalled;
+ szProperty = L"Installed";
}
else if (!wcscmp( szProperty, INSTALLPROPERTY_UNINSTALLABLEW ) ||
!wcscmp( szProperty, INSTALLPROPERTY_PATCHSTATEW ) ||
@@ -1802,7 +1766,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
val = reg_get_value(datakey, szProperty, &type);
if (!val)
- val = strdupW(szEmpty);
+ val = strdupW(L"");
r = ERROR_SUCCESS;
@@ -2048,7 +2012,7 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
return r;
}
- if (!msi_get_property_int( package->db, szCostingComplete, 0 ))
+ if (!msi_get_property_int( package->db, L"CostingComplete", 0 ))
{
msiobj_release( &package->hdr );
return ERROR_FUNCTION_NOT_CALLED;
@@ -2145,19 +2109,14 @@ static BOOL msi_comp_find_package(LPCWSTR prodcode, MSIINSTALLCONTEXT context)
LONG res;
UINT r;
- static const WCHAR local_package[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
- static const WCHAR managed_local_package[] = {
- 'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0
- };
-
r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
if (r != ERROR_SUCCESS)
return FALSE;
if (context == MSIINSTALLCONTEXT_USERMANAGED)
- package = managed_local_package;
+ package = L"ManagedLocalPackage";
else
- package = local_package;
+ package = L"LocalPackage";
sz = 0;
res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
@@ -2175,7 +2134,7 @@ static UINT msi_comp_find_prodcode(WCHAR *squashed_pc,
UINT r;
if (context == MSIINSTALLCONTEXT_MACHINE)
- r = MSIREG_OpenUserDataComponentKey(comp, szLocalSid, &hkey, FALSE);
+ r = MSIREG_OpenUserDataComponentKey(comp, L"S-1-5-18", &hkey, FALSE);
else
r = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE);
@@ -2308,7 +2267,7 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
if (r != ERROR_SUCCESS)
goto done;
- if (!msi_reg_get_val_dword(userdata, szWindowsInstaller, &val))
+ if (!msi_reg_get_val_dword(userdata, L"WindowsInstaller", &val))
goto done;
if (val)
@@ -2724,11 +2683,6 @@ UINT WINAPI MsiGetProductPropertyW(MSIHANDLE hProduct, LPCWSTR szProperty,
LPCWSTR val;
UINT r;
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`','=','\'','%','s','\'',0};
-
TRACE("(%d, %s, %p, %p)\n", hProduct, debugstr_w(szProperty),
szValue, pccbValue);
@@ -2742,7 +2696,7 @@ UINT WINAPI MsiGetProductPropertyW(MSIHANDLE hProduct, LPCWSTR szProperty,
if (!package)
return ERROR_INVALID_HANDLE;
- r = MSI_OpenQuery(package->db, &view, query, szProperty);
+ r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `Property` WHERE `Property` = '%s'", szProperty);
if (r != ERROR_SUCCESS)
goto done;
@@ -2829,11 +2783,11 @@ static BOOL open_userdata_comp_key( const WCHAR *comp, const WCHAR *usersid, MSI
{
if (ctx & MSIINSTALLCONTEXT_MACHINE)
{
- if (!MSIREG_OpenUserDataComponentKey( comp, szLocalSid, hkey, FALSE )) return TRUE;
+ if (!MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", hkey, FALSE )) return TRUE;
}
if (ctx & (MSIINSTALLCONTEXT_USERMANAGED|MSIINSTALLCONTEXT_USERUNMANAGED))
{
- if (usersid && !wcsicmp( usersid, szAllSid ))
+ if (usersid && !wcsicmp( usersid, L"S-1-1-0" ))
{
FIXME( "only looking at the current user\n" );
usersid = NULL;
@@ -2847,8 +2801,6 @@ static INSTALLSTATE MSI_GetComponentPath( const WCHAR *szProduct, const WCHAR *s
const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx,
awstring *lpPathBuf, DWORD *pcchBuf )
{
- static const WCHAR wininstaller[] =
- {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
HKEY hkey;
INSTALLSTATE state;
@@ -2877,7 +2829,7 @@ static INSTALLSTATE MSI_GetComponentPath( const WCHAR *szProduct, const WCHAR *s
if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
!MSIREG_OpenUserDataProductKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, NULL, &hkey, FALSE)) &&
- msi_reg_get_val_dword(hkey, wininstaller, &version) &&
+ msi_reg_get_val_dword(hkey, L"WindowsInstaller", &version) &&
GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES)
{
RegCloseKey(hkey);
@@ -2966,7 +2918,7 @@ end:
*/
INSTALLSTATE WINAPI MsiGetComponentPathW( LPCWSTR product, LPCWSTR comp, LPWSTR buf, LPDWORD buflen )
{
- return MsiGetComponentPathExW( product, comp, szAllSid, MSIINSTALLCONTEXT_ALL, buf, buflen );
+ return MsiGetComponentPathExW( product, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, buf, buflen );
}
/******************************************************************
@@ -3028,7 +2980,7 @@ static UINT query_feature_state( const WCHAR *product, const WCHAR *squashed, co
}
StringFromGUID2( &guid, comp, GUID_SIZE );
if (ctx == MSIINSTALLCONTEXT_MACHINE)
- r = MSIREG_OpenUserDataComponentKey( comp, szLocalSid, &hkey, FALSE );
+ r = MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", &hkey, FALSE );
else
r = MSIREG_OpenUserDataComponentKey( comp, usersid, &hkey, FALSE );
@@ -3214,9 +3166,6 @@ end:
static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
WCHAR *langbuf, DWORD *langlen )
{
- static const WCHAR szVersionResource[] = {'\\',0};
- static const WCHAR szVersionFormat[] = {'%','d','.','%','d','.','%','d','.','%','d',0};
- static const WCHAR szLangFormat[] = {'%','d',0};
UINT ret = ERROR_MORE_DATA;
DWORD len, error;
LPVOID version;
@@ -3244,9 +3193,9 @@ static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
}
if (verlen)
{
- if (VerQueryValueW( version, szVersionResource, (LPVOID *)&ffi, &len ) && len > 0)
+ if (VerQueryValueW( version, L"\\", (LPVOID *)&ffi, &len ) && len > 0)
{
- swprintf( tmp, ARRAY_SIZE(tmp), szVersionFormat,
+ swprintf( tmp, ARRAY_SIZE(tmp), L"%d.%d.%d.%d",
HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
@@ -3262,9 +3211,9 @@ static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
}
if (langlen)
{
- if (VerQueryValueW( version, szLangResource, (LPVOID *)&lang, &len ) && len > 0)
+ if (VerQueryValueW( version, L"\\VarFileInfo\\Translation", (LPVOID *)&lang, &len ) && len > 0)
{
- swprintf( tmp, ARRAY_SIZE(tmp), szLangFormat, *lang );
+ swprintf( tmp, ARRAY_SIZE(tmp), L"%d", *lang );
if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
len = lstrlenW( tmp );
if (*langlen > len) ret = ERROR_SUCCESS;
@@ -3496,7 +3445,7 @@ static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent,
StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
}
- state = MSI_GetComponentPath( szProduct, comp, szAllSid, MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
+ state = MSI_GetComponentPath( szProduct, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
if (state == INSTALLSTATE_MOREDATA) return ERROR_MORE_DATA;
if (state != INSTALLSTATE_LOCAL) return ERROR_FILE_NOT_FOUND;
@@ -3658,7 +3607,7 @@ static USERINFOSTATE MSI_GetUserInfo(LPCWSTR szProduct,
if (pcchOrgNameBuf)
{
orgptr = org;
- if (!orgptr) orgptr = szEmpty;
+ if (!orgptr) orgptr = L"";
r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
if (r == ERROR_MORE_DATA)
@@ -3755,7 +3704,6 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct)
MSIHANDLE handle;
UINT rc;
MSIPACKAGE *package;
- static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
TRACE("(%s)\n",debugstr_w(szProduct));
@@ -3768,7 +3716,7 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct)
if (!package)
return ERROR_CALL_NOT_IMPLEMENTED;
- rc = ACTION_PerformAction(package, szFirstRun);
+ rc = ACTION_PerformAction(package, L"FirstRun");
msiobj_release( &package->hdr );
MsiCloseHandle(handle);
@@ -3781,7 +3729,6 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct)
MSIHANDLE handle;
UINT rc;
MSIPACKAGE *package;
- static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
TRACE("(%s)\n",debugstr_a(szProduct));
@@ -3794,7 +3741,7 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct)
if (!package)
return ERROR_CALL_NOT_IMPLEMENTED;
- rc = ACTION_PerformAction(package, szFirstRun);
+ rc = ACTION_PerformAction(package, L"FirstRun");
msiobj_release( &package->hdr );
MsiCloseHandle(handle);
@@ -3875,7 +3822,7 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLST
MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL );
- r = ACTION_PerformAction(package, szCostInitialize);
+ r = ACTION_PerformAction(package, L"CostInitialize");
if (r != ERROR_SUCCESS)
goto end;
@@ -3911,7 +3858,7 @@ UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved)
if (!GetWindowsDirectoryW(path, MAX_PATH))
return ERROR_FUNCTION_FAILED;
- lstrcatW(path, installerW);
+ lstrcatW(path, L"\\Installer");
if (!CreateDirectoryW(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
return ERROR_FUNCTION_FAILED;
@@ -4006,7 +3953,6 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dwReinstallMode )
{
- static const WCHAR fmtW[] = {'%','s','=','%','s',' ','%','s','=','%','s',0};
MSIPACKAGE *package;
MSIINSTALLCONTEXT context;
UINT r;
@@ -4060,14 +4006,14 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dw
if (r != ERROR_SUCCESS)
return r;
- sz = (lstrlenW( fmtW ) + lstrlenW( szReinstallMode ) + lstrlenW( reinstallmode )) * sizeof(WCHAR);
- sz += (lstrlenW( szReinstall ) + lstrlenW( szFeature )) * sizeof(WCHAR);
+ 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 )))
{
msiobj_release( &package->hdr );
return ERROR_OUTOFMEMORY;
}
- swprintf( cmdline, sz / sizeof(WCHAR), fmtW, szReinstallMode, reinstallmode, szReinstall, szFeature );
+ swprintf( cmdline, sz / sizeof(WCHAR), L"%s=%s %s=%s", L"REINSTALLMODE", reinstallmode, L"REINSTALL", szFeature );
r = MSI_InstallPackage( package, sourcepath, cmdline );
msiobj_release( &package->hdr );
--
2.28.0
1
0
28 Oct '20
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/dialog.c | 500 ++++++++++++++++------------------------------
1 file changed, 174 insertions(+), 326 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 81b0d3dba02..f2bfbf1d913 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -117,7 +117,7 @@ struct subscriber
};
typedef UINT (*msi_dialog_control_func)( msi_dialog *dialog, MSIRECORD *rec );
-struct control_handler
+struct control_handler
{
LPCWSTR control_type;
msi_dialog_control_func func;
@@ -130,38 +130,6 @@ typedef struct
LPWSTR propval;
} radio_button_group_descr;
-static const WCHAR szMsiDialogClass[] = { 'M','s','i','D','i','a','l','o','g','C','l','o','s','e','C','l','a','s','s',0 };
-static const WCHAR szMsiHiddenWindow[] = { 'M','s','i','H','i','d','d','e','n','W','i','n','d','o','w',0 };
-static const WCHAR szStatic[] = { 'S','t','a','t','i','c',0 };
-static const WCHAR szButton[] = { 'B','U','T','T','O','N', 0 };
-static const WCHAR szButtonData[] = { 'M','S','I','D','A','T','A',0 };
-static const WCHAR szProgress[] = { 'P','r','o','g','r','e','s','s',0 };
-static const WCHAR szText[] = { 'T','e','x','t',0 };
-static const WCHAR szPushButton[] = { 'P','u','s','h','B','u','t','t','o','n',0 };
-static const WCHAR szLine[] = { 'L','i','n','e',0 };
-static const WCHAR szBitmap[] = { 'B','i','t','m','a','p',0 };
-static const WCHAR szCheckBox[] = { 'C','h','e','c','k','B','o','x',0 };
-static const WCHAR szScrollableText[] = { 'S','c','r','o','l','l','a','b','l','e','T','e','x','t',0 };
-static const WCHAR szComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
-static const WCHAR szEdit[] = { 'E','d','i','t',0 };
-static const WCHAR szMaskedEdit[] = { 'M','a','s','k','e','d','E','d','i','t',0 };
-static const WCHAR szPathEdit[] = { 'P','a','t','h','E','d','i','t',0 };
-static const WCHAR szProgressBar[] = { 'P','r','o','g','r','e','s','s','B','a','r',0 };
-static const WCHAR szSetProgress[] = { 'S','e','t','P','r','o','g','r','e','s','s',0 };
-static const WCHAR szRadioButtonGroup[] = { 'R','a','d','i','o','B','u','t','t','o','n','G','r','o','u','p',0 };
-static const WCHAR szIcon[] = { 'I','c','o','n',0 };
-static const WCHAR szSelectionTree[] = { 'S','e','l','e','c','t','i','o','n','T','r','e','e',0 };
-static const WCHAR szGroupBox[] = { 'G','r','o','u','p','B','o','x',0 };
-static const WCHAR szListBox[] = { 'L','i','s','t','B','o','x',0 };
-static const WCHAR szDirectoryCombo[] = { 'D','i','r','e','c','t','o','r','y','C','o','m','b','o',0 };
-static const WCHAR szDirectoryList[] = { 'D','i','r','e','c','t','o','r','y','L','i','s','t',0 };
-static const WCHAR szVolumeCostList[] = { 'V','o','l','u','m','e','C','o','s','t','L','i','s','t',0 };
-static const WCHAR szVolumeSelectCombo[] = { 'V','o','l','u','m','e','S','e','l','e','c','t','C','o','m','b','o',0 };
-static const WCHAR szSelectionDescription[] = {'S','e','l','e','c','t','i','o','n','D','e','s','c','r','i','p','t','i','o','n',0};
-static const WCHAR szSelectionPath[] = {'S','e','l','e','c','t','i','o','n','P','a','t','h',0};
-static const WCHAR szHyperLink[] = {'H','y','p','e','r','L','i','n','k',0};
-static const WCHAR szListView[] = {'L','i','s','t','V','i','e','w',0};
-
/* dialog sequencing */
#define WM_MSI_DIALOG_CREATE (WM_USER+0x100)
@@ -376,15 +344,12 @@ static UINT msi_dialog_set_font( msi_dialog *dialog, HWND hwnd, LPCWSTR name )
static UINT msi_dialog_build_font_list( msi_dialog *dialog )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','T','e','x','t','S','t','y','l','e','`',0};
MSIQUERY *view;
UINT r;
TRACE("dialog %p\n", dialog );
- r = MSI_OpenQuery( dialog->package->db, &view, query );
+ r = MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `TextStyle`" );
if( r != ERROR_SUCCESS )
return r;
@@ -479,31 +444,13 @@ static LPWSTR msi_dialog_get_uitext( msi_dialog *dialog, LPCWSTR key )
MSIRECORD *rec;
LPWSTR text;
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ','`','U','I','T','e','x','t','`',' ',
- 'w','h','e','r','e',' ','`','K','e','y','`',' ','=',' ','\'','%','s','\'',0
- };
-
- rec = MSI_QueryGetRecord( dialog->package->db, query, key );
+ rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key );
if (!rec) return NULL;
text = strdupW( MSI_RecordGetString( rec, 2 ) );
msiobj_release( &rec->hdr );
return text;
}
-static MSIRECORD *msi_get_binary_record( MSIDATABASE *db, LPCWSTR name )
-{
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ','B','i','n','a','r','y',' ',
- 'w','h','e','r','e',' ',
- '`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0
- };
-
- return MSI_QueryGetRecord( db, query, name );
-}
-
static HANDLE msi_load_image( MSIDATABASE *db, LPCWSTR name, UINT type,
UINT cx, UINT cy, UINT flags )
{
@@ -516,7 +463,7 @@ static HANDLE msi_load_image( MSIDATABASE *db, LPCWSTR name, UINT type,
if (!(tmp = msi_create_temp_file( db ))) return NULL;
- rec = msi_get_binary_record( db, name );
+ rec = MSI_QueryGetRecord( db, L"SELCT * FROM `Binary` WHERE `Name` = '%s'", name );
if( rec )
{
r = MSI_RecordStreamToFile( rec, 2, tmp );
@@ -580,7 +527,7 @@ static void msi_dialog_update_all_controls( msi_dialog *dialog )
static void msi_dialog_set_property( MSIPACKAGE *package, LPCWSTR property, LPCWSTR value )
{
UINT r = msi_set_property( package->db, property, value, -1 );
- if (r == ERROR_SUCCESS && !wcscmp( property, szSourceDir ))
+ if (r == ERROR_SUCCESS && !wcscmp( property, L"SourceDir" ))
msi_reset_source_folders( package );
}
@@ -606,7 +553,7 @@ struct msi_selection_tree_info
static MSIFEATURE *msi_seltree_get_selected_feature( msi_control *control )
{
- struct msi_selection_tree_info *info = GetPropW( control->hwnd, szButtonData );
+ struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
return msi_seltree_feature_from_item( control->hwnd, info->selected );
}
@@ -618,7 +565,7 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control,
ctrl = msi_dialog_find_control( dialog, control );
if (!ctrl)
return;
- if( !wcscmp( attribute, szText ) )
+ if( !wcscmp( attribute, L"Text" ) )
{
const WCHAR *font_text, *text = NULL;
WCHAR *font, *text_fmt = NULL;
@@ -627,7 +574,7 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control,
font = msi_dialog_get_style( font_text, &text );
deformat_string( dialog->package, text, &text_fmt );
if (text_fmt) text = text_fmt;
- else text = szEmpty;
+ else text = L"";
SetWindowTextW( ctrl->hwnd, text );
@@ -635,7 +582,7 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control,
msi_free( text_fmt );
msi_dialog_check_messages( NULL );
}
- else if( !wcscmp( attribute, szProgress ) )
+ else if( !wcscmp( attribute, L"Progress" ) )
{
DWORD func, val1, val2, units;
@@ -690,12 +637,12 @@ static void dialog_handle_event( msi_dialog *dialog, const WCHAR *control,
break;
}
}
- else if ( !wcscmp( attribute, szProperty ) )
+ 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 );
}
- else if ( !wcscmp( attribute, szSelectionPath ) )
+ else if ( !wcscmp( attribute, L"SelectionPath" ) )
{
BOOL indirect = ctrl->attributes & msidbControlAttributesIndirect;
LPWSTR path = msi_dialog_dup_property( dialog, ctrl->property, indirect );
@@ -754,11 +701,6 @@ static UINT map_event( MSIRECORD *row, void *param )
static void dialog_map_events( msi_dialog *dialog, const WCHAR *control )
{
- static const WCHAR queryW[] =
- {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','E','v','e','n','t','M','a','p','p','i','n','g','`',' ',
- 'W','H','E','R','E',' ','`','D','i','a','l','o','g','_','`',' ','=',' ','\'','%','s','\'',' ',
- 'A','N','D',' ','`','C','o','n','t','r','o','l','_','`',' ','=',' ','\'','%','s','\'',0};
MSIQUERY *view;
struct dialog_control dialog_control =
{
@@ -766,7 +708,9 @@ static void dialog_map_events( msi_dialog *dialog, const WCHAR *control )
control
};
- if (!MSI_OpenQuery( dialog->package->db, &view, queryW, dialog->name, control ))
+ if (!MSI_OpenQuery( dialog->package->db, &view,
+ L"SELECT * FROM `EventMapping` WHERE `Dialog_` = '%s' AND `Control_` = '%s'",
+ dialog->name, control ))
{
MSI_IterateRecords( view, NULL, map_event, &dialog_control );
msiobj_release( &view->hdr );
@@ -784,7 +728,7 @@ static msi_control *msi_dialog_add_control( msi_dialog *dialog,
name = MSI_RecordGetString( rec, 2 );
control_type = MSI_RecordGetString( rec, 3 );
attributes = MSI_RecordGetInteger( rec, 8 );
- if (wcscmp( control_type, szScrollableText )) text = MSI_RecordGetString( rec, 10 );
+ if (wcscmp( control_type, L"ScrollableText" )) text = MSI_RecordGetString( rec, 10 );
TRACE("%s, %s, %08x, %s, %08x\n", debugstr_w(szCls), debugstr_w(name),
attributes, debugstr_w(text), style);
@@ -831,7 +775,7 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW(hWnd, szButtonData);
+ info = GetPropW(hWnd, L"MSIDATA");
if( msg == WM_CTLCOLORSTATIC &&
( info->attributes & msidbControlAttributesTransparent ) )
@@ -851,7 +795,7 @@ MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_NCDESTROY:
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
}
@@ -867,7 +811,7 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, szStatic, SS_LEFT | WS_GROUP );
+ control = msi_dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP );
if( !control )
return ERROR_FUNCTION_FAILED;
@@ -891,9 +835,9 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec )
info->oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIText_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
- event_subscribe( dialog, szSelectionPath, control_name, szSelectionPath );
+ event_subscribe( dialog, L"SelectionPath", control_name, L"SelectionPath" );
return ERROR_SUCCESS;
}
@@ -920,7 +864,6 @@ static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec )
static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LPCWSTR arg )
{
- static const WCHAR szNullArg[] = {'{','}',0};
LPWSTR p, prop, arg_fmt = NULL;
UINT len;
@@ -931,8 +874,7 @@ static UINT msi_dialog_set_property_event( msi_dialog *dialog, LPCWSTR event, LP
if (p && (p[1] == 0 || p[1] == ' '))
{
*p = 0;
- if (wcscmp( szNullArg, arg ))
- deformat_string( dialog->package, arg, &arg_fmt );
+ 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 );
@@ -981,19 +923,15 @@ static UINT msi_dialog_control_event( MSIRECORD *rec, LPVOID param )
static UINT msi_dialog_button_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'C','o','n','t','r','o','l','E','v','e','n','t',' ','W','H','E','R','E',' ',
- '`','D','i','a','l','o','g','_','`',' ','=',' ','\'','%','s','\'',' ','A','N','D',' ',
- '`','C','o','n','t','r','o','l','_','`',' ','=',' ','\'','%','s','\'',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','O','r','d','e','r','i','n','g','`',0};
MSIQUERY *view;
UINT r;
if (HIWORD(param) != BN_CLICKED)
return ERROR_SUCCESS;
- r = MSI_OpenQuery( dialog->package->db, &view, query, dialog->name, control->name );
+ r = MSI_OpenQuery( dialog->package->db, &view,
+ L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`",
+ dialog->name, control->name );
if (r != ERROR_SUCCESS)
{
ERR("query failed\n");
@@ -1024,7 +962,7 @@ static HBITMAP msi_load_picture( MSIDATABASE *db, const WCHAR *name, INT cx, INT
BITMAP bm;
UINT r;
- rec = msi_get_binary_record( db, name );
+ rec = MSI_QueryGetRecord( db, L"SELCT * FROM `Binary` WHERE `Name` = '%s'", name );
if (!rec)
goto end;
@@ -1100,7 +1038,7 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec )
}
}
- control = msi_dialog_add_control( dialog, rec, szButton, style );
+ control = msi_dialog_add_control( dialog, rec, L"BUTTON", style );
if (!control)
return ERROR_FUNCTION_FAILED;
@@ -1133,18 +1071,11 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec )
static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','`','C','h','e','c','k','B','o','x','`',' ',
- 'W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','=',' ',
- '\'','%','s','\'',0
- };
MSIRECORD *rec = NULL;
LPWSTR ret = NULL;
/* find if there is a value associated with the checkbox */
- rec = MSI_QueryGetRecord( dialog->package->db, query, prop );
+ rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `CheckBox` WHERE `Property` = '%s'", prop );
if (!rec)
return ret;
@@ -1179,7 +1110,6 @@ static UINT msi_dialog_get_checkbox_state( msi_dialog *dialog, msi_control *cont
static void msi_dialog_set_checkbox_state( msi_dialog *dialog, msi_control *control, UINT state )
{
- static const WCHAR szState[] = {'1',0};
LPCWSTR val;
/* if uncheck then the property is set to NULL */
@@ -1193,7 +1123,7 @@ static void msi_dialog_set_checkbox_state( msi_dialog *dialog, msi_control *cont
if (control->value && control->value[0])
val = control->value;
else
- val = szState;
+ val = L"1";
msi_dialog_set_property( dialog->package, control->property, val );
}
@@ -1228,7 +1158,7 @@ static UINT msi_dialog_checkbox_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("%p %p\n", dialog, rec);
- control = msi_dialog_add_control( dialog, rec, szButton, BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP );
+ 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;
prop = MSI_RecordGetString( rec, 9 );
@@ -1293,7 +1223,7 @@ static UINT msi_dialog_line_control( msi_dialog *dialog, MSIRECORD *rec )
width = msi_dialog_scale_unit( dialog, width );
height = 2; /* line is exactly 2 units in height */
- control->hwnd = CreateWindowExW( exstyle, szStatic, NULL, style,
+ 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",
@@ -1319,7 +1249,7 @@ MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW( hWnd, szButtonData );
+ info = GetPropW( hWnd, L"MSIDATA" );
r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
@@ -1329,7 +1259,7 @@ MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return DLGC_WANTARROWS;
case WM_NCDESTROY:
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
case WM_PAINT:
/* native MSI sets a wait cursor here */
@@ -1382,7 +1312,6 @@ static void msi_scrolltext_add_text( msi_control *control, LPCWSTR text )
static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
{
- static const WCHAR szRichEdit20W[] = {'R','i','c','h','E','d','i','t','2','0','W',0};
struct msi_scrolltext_info *info;
msi_control *control;
HMODULE hRichedit;
@@ -1397,7 +1326,7 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
style = WS_BORDER | ES_MULTILINE | WS_VSCROLL |
ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP;
- control = msi_dialog_add_control( dialog, rec, szRichEdit20W, style );
+ control = msi_dialog_add_control( dialog, rec, L"RichEdit20W", style );
if (!control)
{
FreeLibrary( hRichedit );
@@ -1413,7 +1342,7 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
/* subclass the static control */
info->oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIScrollText_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
/* add the text into the richedit */
text = MSI_RecordGetString( rec, 10 );
@@ -1440,7 +1369,7 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec )
style |= SS_CENTERIMAGE;
}
- control = msi_dialog_add_control( dialog, rec, szStatic, style );
+ control = msi_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 );
@@ -1455,7 +1384,7 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec )
ERR("Failed to load bitmap %s\n", debugstr_w(name));
msi_free( name );
-
+
return ERROR_SUCCESS;
}
@@ -1467,9 +1396,9 @@ static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec )
TRACE("\n");
- control = msi_dialog_add_control( dialog, rec, szStatic,
+ control = msi_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 );
@@ -1501,7 +1430,7 @@ static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW( hWnd, szButtonData );
+ info = GetPropW( hWnd, L"MSIDATA" );
if (!info)
return 0;
@@ -1514,7 +1443,7 @@ static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
msi_free( info->items[j] );
msi_free( info->items );
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
}
@@ -1541,16 +1470,12 @@ static UINT msi_combobox_add_item( MSIRECORD *rec, LPVOID param )
static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR property )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','C','o','m','b','o','B','o','x','`',' ','W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','O','r','d','e','r','`',0};
MSIQUERY *view;
DWORD count;
UINT r;
- r = MSI_OpenQuery( info->dialog->package->db, &view, query, property );
+ r = MSI_OpenQuery( info->dialog->package->db, &view,
+ L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
if (r != ERROR_SUCCESS)
return r;
@@ -1572,11 +1497,6 @@ static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR prop
static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param )
{
- static const WCHAR szHide[] = {'H','i','d','e',0};
- static const WCHAR szShow[] = {'S','h','o','w',0};
- static const WCHAR szDisable[] = {'D','i','s','a','b','l','e',0};
- static const WCHAR szEnable[] = {'E','n','a','b','l','e',0};
- static const WCHAR szDefault[] = {'D','e','f','a','u','l','t',0};
msi_dialog *dialog = param;
msi_control *control;
LPCWSTR name, action, condition;
@@ -1592,15 +1512,15 @@ static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param )
TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
/* FIXME: case sensitive? */
- if (!wcscmp( action, szHide ))
+ if (!wcscmp( action, L"Hide" ))
ShowWindow(control->hwnd, SW_HIDE);
- else if (!wcscmp( action, szShow ))
+ else if (!wcscmp( action, L"Show" ))
ShowWindow(control->hwnd, SW_SHOW);
- else if (!wcscmp( action, szDisable ))
+ else if (!wcscmp( action, L"Disable" ))
EnableWindow(control->hwnd, FALSE);
- else if (!wcscmp( action, szEnable ))
+ else if (!wcscmp( action, L"Enable" ))
EnableWindow(control->hwnd, TRUE);
- else if (!wcscmp( action, szDefault ))
+ else if (!wcscmp( action, L"Default" ))
SetFocus(control->hwnd);
else
FIXME("Unhandled action %s\n", debugstr_w(action));
@@ -1610,10 +1530,6 @@ static UINT msi_dialog_set_control_condition( MSIRECORD *rec, LPVOID param )
static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'C','o','n','t','r','o','l','C','o','n','d','i','t','i','o','n',' ',
- 'W','H','E','R','E',' ','`','D','i','a','l','o','g','_','`',' ','=',' ','\'','%','s','\'',0};
UINT r;
MSIQUERY *view;
MSIPACKAGE *package = dialog->package;
@@ -1621,7 +1537,7 @@ static UINT msi_dialog_evaluate_control_conditions( msi_dialog *dialog )
TRACE("%p %s\n", dialog, debugstr_w(dialog->name));
/* query the Control table for all the elements of the control */
- r = MSI_OpenQuery( package->db, &view, query, dialog->name );
+ r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `ControlCondition` WHERE `Dialog_` = '%s'", dialog->name );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -1639,7 +1555,7 @@ static UINT msi_dialog_combobox_handler( msi_dialog *dialog, msi_control *contro
if (HIWORD(param) != CBN_SELCHANGE && HIWORD(param) != CBN_EDITCHANGE)
return ERROR_SUCCESS;
- info = GetPropW( control->hwnd, szButtonData );
+ 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 );
@@ -1661,7 +1577,7 @@ static void msi_dialog_combobox_update( msi_dialog *dialog, msi_control *control
LPWSTR value, tmp;
DWORD j;
- info = GetPropW( control->hwnd, szButtonData );
+ info = GetPropW( control->hwnd, L"MSIDATA" );
value = msi_dup_property( dialog->package->db, control->property );
if (!value)
@@ -1730,7 +1646,7 @@ static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec )
info->addpos_items = 0;
info->oldproc = (WNDPROC)SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIComboBox_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
if (control->property)
msi_combobox_add_items( info, control->property );
@@ -1767,7 +1683,7 @@ static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
WCHAR num[MAX_NUM_DIGITS];
DWORD limit;
- control = msi_dialog_add_control( dialog, rec, szEdit,
+ control = msi_dialog_add_control( dialog, rec, L"Edit",
WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL );
control->handler = msi_dialog_edit_handler;
@@ -1914,7 +1830,7 @@ MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW(hWnd, szButtonData);
+ info = GetPropW(hWnd, L"MSIDATA");
r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
@@ -1930,7 +1846,7 @@ MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_NCDESTROY:
msi_free( info->prop );
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
}
@@ -2053,7 +1969,7 @@ msi_maskedit_create_children( struct msi_maskedit_info *info, LPCWSTR font )
wx = 0;
ww = width;
}
- hwnd = CreateWindowW( szEdit, NULL, style, wx, 0, ww, height,
+ hwnd = CreateWindowW( L"Edit", NULL, style, wx, 0, ww, height,
info->hwnd, NULL, NULL, NULL );
if( !hwnd )
{
@@ -2101,7 +2017,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
info->dialog = dialog;
- control = msi_dialog_add_control( dialog, rec, szStatic,
+ control = msi_dialog_add_control( dialog, rec, L"Static",
SS_OWNERDRAW | WS_GROUP | WS_VISIBLE );
if( !control )
{
@@ -2116,7 +2032,7 @@ static UINT msi_dialog_maskedit_control( msi_dialog *dialog, MSIRECORD *rec )
/* subclass the static control */
info->oldproc = (WNDPROC) SetWindowLongPtrW( info->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIMaskedEdit_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
prop = MSI_RecordGetString( rec, 9 );
if( prop )
@@ -2158,7 +2074,7 @@ static UINT msi_dialog_progress_bar( msi_dialog *dialog, MSIRECORD *rec )
if( !control )
return ERROR_FUNCTION_FAILED;
- event_subscribe( dialog, szSetProgress, control->name, szProgress );
+ event_subscribe( dialog, L"SetProgress", control->name, L"Progress" );
return ERROR_SUCCESS;
}
@@ -2185,7 +2101,7 @@ static void msi_dialog_update_pathedit( msi_dialog *dialog, msi_control *control
{
WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, szPathEdit )))
+ if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"PathEdit" )))
return;
if (!(path = get_path_property( dialog, control ))) return;
@@ -2244,7 +2160,7 @@ static BOOL msi_dialog_onkillfocus( msi_dialog *dialog, msi_control *control )
static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct msi_pathedit_info *info = GetPropW(hWnd, szButtonData);
+ struct msi_pathedit_info *info = GetPropW(hWnd, L"MSIDATA");
LRESULT r = 0;
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
@@ -2261,7 +2177,7 @@ static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
if ( msg == WM_NCDESTROY )
{
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
}
return r;
@@ -2277,7 +2193,7 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec )
if (!info)
return ERROR_FUNCTION_FAILED;
- control = msi_dialog_add_control( dialog, rec, szEdit,
+ control = msi_dialog_add_control( dialog, rec, L"Edit",
WS_BORDER | WS_TABSTOP );
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
@@ -2288,7 +2204,7 @@ static UINT msi_dialog_pathedit_control( msi_dialog *dialog, MSIRECORD *rec )
info->control = control;
info->oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIPathEdit_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
msi_dialog_update_pathedit( dialog, control );
@@ -2319,7 +2235,7 @@ static UINT msi_dialog_create_radiobutton( MSIRECORD *rec, LPVOID param )
name = MSI_RecordGetString( rec, 3 );
text = MSI_RecordGetString( rec, 8 );
- control = dialog_create_window( dialog, rec, 0, szButton, name, text, style,
+ control = dialog_create_window( dialog, rec, 0, L"BUTTON", name, text, style,
group->parent->hwnd );
if (!control)
return ERROR_FUNCTION_FAILED;
@@ -2343,7 +2259,7 @@ static BOOL CALLBACK msi_radioground_child_enum( HWND hWnd, LPARAM lParam )
static LRESULT WINAPI MSIRadioGroup_WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
- WNDPROC oldproc = (WNDPROC)GetPropW( hWnd, szButtonData );
+ WNDPROC oldproc = (WNDPROC)GetPropW( hWnd, L"MSIDATA" );
LRESULT r;
TRACE("hWnd %p msg %04x wParam 0x%08lx lParam 0x%08lx\n", hWnd, msg, wParam, lParam);
@@ -2362,10 +2278,6 @@ static LRESULT WINAPI MSIRadioGroup_WndProc( HWND hWnd, UINT msg, WPARAM wParam,
static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'R','a','d','i','o','B','u','t','t','o','n',' ','W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',0};
UINT r;
LPCWSTR prop;
msi_control *control;
@@ -2390,23 +2302,23 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
style |= BS_OWNERDRAW;
/* Create parent group box to hold radio buttons */
- control = msi_dialog_add_control( dialog, rec, szButton, style );
+ control = msi_dialog_add_control( dialog, rec, L"BUTTON", style );
if( !control )
return ERROR_FUNCTION_FAILED;
oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIRadioGroup_WndProc );
- SetPropW(control->hwnd, szButtonData, oldproc);
+ SetPropW(control->hwnd, L"MSIDATA", oldproc);
SetWindowLongPtrW( control->hwnd, GWL_EXSTYLE, WS_EX_CONTROLPARENT );
if( prop )
control->property = strdupW( prop );
/* query the Radio Button table for all control in this group */
- r = MSI_OpenQuery( package->db, &view, query, prop );
+ r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
if( r != ERROR_SUCCESS )
{
- ERR("query failed for dialog %s radio group %s\n",
+ ERR("query failed for dialog %s radio group %s\n",
debugstr_w(dialog->name), debugstr_w(prop));
return ERROR_INVALID_PARAMETER;
}
@@ -2505,7 +2417,7 @@ msi_seltree_menu( HWND hwnd, HTREEITEM hItem )
} u;
UINT r;
- info = GetPropW(hwnd, szButtonData);
+ info = GetPropW(hwnd, L"MSIDATA");
package = info->dialog->package;
feature = msi_seltree_feature_from_item( hwnd, hItem );
@@ -2553,7 +2465,7 @@ MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW(hWnd, szButtonData);
+ info = GetPropW(hWnd, L"MSIDATA");
switch( msg )
{
@@ -2573,7 +2485,7 @@ MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_NCDESTROY:
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
}
return r;
@@ -2583,7 +2495,7 @@ static void
msi_seltree_add_child_features( MSIPACKAGE *package, HWND hwnd,
LPCWSTR parent, HTREEITEM hParent )
{
- struct msi_selection_tree_info *info = GetPropW( hwnd, szButtonData );
+ struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" );
MSIFEATURE *feature;
TVINSERTSTRUCTW tvis;
HTREEITEM hitem, hfirst = NULL;
@@ -2671,7 +2583,7 @@ static void msi_seltree_create_imagelist( HWND hwnd )
static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
msi_control *control, WPARAM param )
{
- struct msi_selection_tree_info *info = GetPropW( control->hwnd, szButtonData );
+ struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
LPNMTREEVIEWW tv = (LPNMTREEVIEWW)param;
MSIRECORD *row, *rec;
MSIFOLDER *folder;
@@ -2679,12 +2591,6 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
LPCWSTR dir, title = NULL;
UINT r = ERROR_SUCCESS;
- static const WCHAR select[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','F','e','a','t','u','r','e','`',' ','W','H','E','R','E',' ',
- '`','T','i','t','l','e','`',' ','=',' ','\'','%','s','\'',0
- };
-
if (tv->hdr.code != TVN_SELCHANGINGW)
return ERROR_SUCCESS;
@@ -2699,14 +2605,14 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
else
title = tv->itemNew.pszText;
- row = MSI_QueryGetRecord( dialog->package->db, select, title );
+ row = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `Feature` WHERE `Title` = '%s'", title );
if (!row)
return ERROR_FUNCTION_FAILED;
rec = MSI_CreateRecord( 1 );
MSI_RecordSetStringW( rec, 1, MSI_RecordGetString( row, 4 ) );
- msi_event_fire( dialog->package, szSelectionDescription, rec );
+ msi_event_fire( dialog->package, L"SelectionDescription", rec );
dir = MSI_RecordGetString( row, 7 );
if (dir)
@@ -2722,7 +2628,7 @@ static UINT msi_dialog_seltree_handler( msi_dialog *dialog,
else
MSI_RecordSetStringW( rec, 1, NULL );
- msi_event_fire( dialog->package, szSelectionPath, rec );
+ msi_event_fire( dialog->package, L"SelectionPath", rec );
done:
msiobj_release(&row->hdr);
@@ -2764,9 +2670,9 @@ static UINT msi_dialog_selection_tree( msi_dialog *dialog, MSIRECORD *rec )
info->hwnd = control->hwnd;
info->oldproc = (WNDPROC) SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSISelectionTree_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
- event_subscribe( dialog, szSelectionPath, control_name, szProperty );
+ event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
/* initialize it */
msi_seltree_create_imagelist( control->hwnd );
@@ -2810,7 +2716,7 @@ static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
TRACE("%p %04x %08lx %08lx\n", hWnd, msg, wParam, lParam);
- info = GetPropW( hWnd, szButtonData );
+ info = GetPropW( hWnd, L"MSIDATA" );
if (!info)
return 0;
@@ -2823,7 +2729,7 @@ static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
msi_free( info->items[j] );
msi_free( info->items );
msi_free( info );
- RemovePropW( hWnd, szButtonData );
+ RemovePropW( hWnd, L"MSIDATA" );
break;
}
@@ -2849,16 +2755,12 @@ static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param )
static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR property )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','L','i','s','t','B','o','x','`',' ','W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','O','r','d','e','r','`',0};
MSIQUERY *view;
DWORD count;
UINT r;
- r = MSI_OpenQuery( info->dialog->package->db, &view, query, property );
+ r = MSI_OpenQuery( info->dialog->package->db, &view,
+ L"SELECT * FROM `ListBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
if ( r != ERROR_SUCCESS )
return r;
@@ -2888,7 +2790,7 @@ static UINT msi_dialog_listbox_handler( msi_dialog *dialog,
if( HIWORD(param) != LBN_SELCHANGE )
return ERROR_SUCCESS;
- info = GetPropW( control->hwnd, szButtonData );
+ info = GetPropW( control->hwnd, L"MSIDATA" );
index = SendMessageW( control->hwnd, LB_GETCURSEL, 0, 0 );
value = (LPCWSTR) SendMessageW( control->hwnd, LB_GETITEMDATA, index, 0 );
@@ -2933,7 +2835,7 @@ static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
info->addpos_items = 0;
info->oldproc = (WNDPROC)SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
(LONG_PTR)MSIListBox_WndProc );
- SetPropW( control->hwnd, szButtonData, info );
+ SetPropW( control->hwnd, L"MSIDATA", info );
if ( control->property )
msi_listbox_add_items( info, control->property );
@@ -2947,7 +2849,7 @@ static void msi_dialog_update_directory_combo( msi_dialog *dialog, msi_control *
{
WCHAR *path;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, szDirectoryCombo )))
+ if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
return;
if (!(path = get_path_property( dialog, control ))) return;
@@ -2986,13 +2888,12 @@ static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *control )
{
- static const WCHAR asterisk[] = {'*',0};
WCHAR dir_spec[MAX_PATH], *path;
WIN32_FIND_DATAW wfd;
LVITEMW item;
HANDLE file;
- if (!control && !(control = msi_dialog_find_control_by_type( dialog, szDirectoryList )))
+ if (!control && !(control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" )))
return;
/* clear the list-view */
@@ -3000,7 +2901,7 @@ static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *c
if (!(path = get_path_property( dialog, control ))) return;
lstrcpyW( dir_spec, path );
- lstrcatW( dir_spec, asterisk );
+ lstrcatW( dir_spec, L"*" );
file = FindFirstFileW( dir_spec, &wfd );
if (file == INVALID_HANDLE_VALUE)
@@ -3014,7 +2915,7 @@ static void msi_dialog_update_directory_list( msi_dialog *dialog, msi_control *c
if ( wfd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY )
continue;
- if ( !wcscmp( wfd.cFileName, szDot ) || !wcscmp( wfd.cFileName, szDotDot ) )
+ if ( !wcscmp( wfd.cFileName, L"." ) || !wcscmp( wfd.cFileName, L".." ) )
continue;
item.mask = LVIF_TEXT;
@@ -3036,7 +2937,7 @@ static UINT msi_dialog_directorylist_up( msi_dialog *dialog )
LPWSTR prop, path, ptr;
BOOL indirect;
- control = msi_dialog_find_control_by_type( dialog, szDirectoryList );
+ control = msi_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 );
@@ -3060,7 +2961,6 @@ static UINT msi_dialog_directorylist_up( msi_dialog *dialog )
static WCHAR *get_unique_folder_name( const WCHAR *root, int *ret_len )
{
- static const WCHAR fmtW[] = {'%','s','%','s',' ','%','u',0};
WCHAR newfolder[MAX_PATH], *path, *ptr;
int len, count = 2;
@@ -3078,7 +2978,7 @@ static WCHAR *get_unique_folder_name( const WCHAR *root, int *ret_len )
msi_free( path );
return NULL;
}
- swprintf( path, len + 4, fmtW, root, newfolder, count++ );
+ swprintf( path, len + 4, L"%s%s %u", root, newfolder, count++ );
}
ptr = wcsrchr( path, '\\' ) + 1;
@@ -3094,7 +2994,7 @@ static UINT msi_dialog_directorylist_new( msi_dialog *dialog )
LVITEMW item;
int index;
- control = msi_dialog_find_control_by_type( dialog, szDirectoryList );
+ control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" );
if (!(path = get_path_property( dialog, control ))) return ERROR_OUTOFMEMORY;
@@ -3162,7 +3062,7 @@ static UINT msi_dialog_dirlist_handler( msi_dialog *dialog, msi_control *control
lstrcpyW( new_path, path );
lstrcatW( new_path, text );
if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
- lstrcatW( new_path, szBackSlash );
+ lstrcatW( new_path, L"\\" );
msi_dialog_set_property( dialog->package, prop, new_path );
@@ -3219,11 +3119,11 @@ static BOOL str_is_number( LPCWSTR str )
static const WCHAR column_keys[][80] =
{
- {'V','o','l','u','m','e','C','o','s','t','V','o','l','u','m','e',0},
- {'V','o','l','u','m','e','C','o','s','t','S','i','z','e',0},
- {'V','o','l','u','m','e','C','o','s','t','A','v','a','i','l','a','b','l','e',0},
- {'V','o','l','u','m','e','C','o','s','t','R','e','q','u','i','r','e','d',0},
- {'V','o','l','u','m','e','C','o','s','t','D','i','f','f','e','r','e','n','c','e',0}
+ L"VolumeCostVolume",
+ L"VolumeCostSize",
+ L"VolumeCostAvailable",
+ L"VolumeCostRequired",
+ L"VolumeCostDifference",
};
static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control, MSIRECORD *rec )
@@ -3234,8 +3134,6 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
LVCOLUMNW lvc;
DWORD count = 0;
- static const WCHAR negative[] = {'-',0};
-
if (!text) return;
while ((begin = wcschr( begin, '{' )) && count < 5)
@@ -3250,8 +3148,8 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
lstrcpynW( num, begin + 1, end - begin );
begin += end - begin + 1;
- /* empty braces or '0' hides the column */
- if ( !num[0] || !wcscmp( num, szZero ) )
+ /* empty braces or '0' hides the column */
+ if ( !num[0] || !wcscmp( num, L"0" ) )
{
count++;
msi_free( num );
@@ -3261,7 +3159,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
/* the width must be a positive number
* if a width is invalid, all remaining columns are hidden
*/
- if ( !wcsncmp( num, negative, 1 ) || !str_is_number( num ) ) {
+ if ( !wcsncmp( num, L"-", 1 ) || !str_is_number( num ) ) {
msi_free( num );
return;
}
@@ -3471,9 +3369,7 @@ static UINT msi_dialog_volumeselect_combo( msi_dialog *dialog, MSIRECORD *rec )
static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *control, WPARAM param )
{
- static const WCHAR hrefW[] = {'h','r','e','f'};
- static const WCHAR openW[] = {'o','p','e','n',0};
- int len, len_href = ARRAY_SIZE( hrefW );
+ int len, len_href = ARRAY_SIZE( L"href" ) - 1;
const WCHAR *p, *q;
WCHAR quote = 0;
LITEM item;
@@ -3491,7 +3387,7 @@ static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *contr
while (*p && iswspace( *p )) p++;
len = lstrlenW( p );
- if (len > len_href && !wcsnicmp( p, hrefW, len_href ))
+ if (len > len_href && !wcsnicmp( p, L"href", len_href ))
{
p += len_href;
while (*p && iswspace( *p )) p++;
@@ -3511,7 +3407,7 @@ static UINT msi_dialog_hyperlink_handler( msi_dialog *dialog, msi_control *contr
if (!*q) return ERROR_SUCCESS;
}
item.szUrl[q - item.szUrl] = 0;
- ShellExecuteW( NULL, openW, p, NULL, NULL, SW_SHOWNORMAL );
+ ShellExecuteW( NULL, L"open", p, NULL, NULL, SW_SHOWNORMAL );
}
return ERROR_SUCCESS;
}
@@ -3587,15 +3483,11 @@ static UINT msi_listview_add_item( MSIRECORD *rec, LPVOID param )
static UINT msi_listview_add_items( msi_dialog *dialog, msi_control *control )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','L','i','s','t','V','i','e','w','`',' ','W','H','E','R','E',' ',
- '`','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','O','r','d','e','r','`',0};
MSIQUERY *view;
struct listview_param lv_param = { dialog, control };
- if (MSI_OpenQuery( dialog->package->db, &view, query, control->property ) == ERROR_SUCCESS)
+ 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 );
msiobj_release( &view->hdr );
@@ -3646,28 +3538,28 @@ static UINT msi_dialog_listview( msi_dialog *dialog, MSIRECORD *rec )
static const struct control_handler msi_dialog_handler[] =
{
- { szText, msi_dialog_text_control },
- { szPushButton, msi_dialog_button_control },
- { szLine, msi_dialog_line_control },
- { szBitmap, msi_dialog_bitmap_control },
- { szCheckBox, msi_dialog_checkbox_control },
- { szScrollableText, msi_dialog_scrolltext_control },
- { szComboBox, msi_dialog_combo_control },
- { szEdit, msi_dialog_edit_control },
- { szMaskedEdit, msi_dialog_maskedit_control },
- { szPathEdit, msi_dialog_pathedit_control },
- { szProgressBar, msi_dialog_progress_bar },
- { szRadioButtonGroup, msi_dialog_radiogroup_control },
- { szIcon, msi_dialog_icon_control },
- { szSelectionTree, msi_dialog_selection_tree },
- { szGroupBox, msi_dialog_group_box },
- { szListBox, msi_dialog_list_box },
- { szDirectoryCombo, msi_dialog_directory_combo },
- { szDirectoryList, msi_dialog_directory_list },
- { szVolumeCostList, msi_dialog_volumecost_list },
- { szVolumeSelectCombo, msi_dialog_volumeselect_combo },
- { szHyperLink, msi_dialog_hyperlink },
- { szListView, msi_dialog_listview }
+ { 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 }
};
static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
@@ -3691,10 +3583,6 @@ static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
static UINT msi_dialog_fill_controls( msi_dialog *dialog )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'C','o','n','t','r','o','l',' ','W','H','E','R','E',' ',
- '`','D','i','a','l','o','g','_','`',' ','=',' ','\'','%','s','\'',0};
UINT r;
MSIQUERY *view;
MSIPACKAGE *package = dialog->package;
@@ -3702,7 +3590,7 @@ static UINT msi_dialog_fill_controls( msi_dialog *dialog )
TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
/* query the Control table for all the elements of the control */
- r = MSI_OpenQuery( package->db, &view, query, dialog->name );
+ r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `Control` WHERE `Dialog_` = '%s'", dialog->name );
if( r != ERROR_SUCCESS )
{
ERR("query failed for dialog %s\n", debugstr_w(dialog->name));
@@ -3723,8 +3611,6 @@ static UINT msi_dialog_reset( msi_dialog *dialog )
/* figure out the height of 10 point MS Sans Serif */
static INT msi_dialog_get_sans_serif_height( HWND hwnd )
{
- static const WCHAR szSansSerif[] = {
- 'M','S',' ','S','a','n','s',' ','S','e','r','i','f',0 };
LOGFONTW lf;
TEXTMETRICW tm;
BOOL r;
@@ -3737,7 +3623,7 @@ static INT msi_dialog_get_sans_serif_height( HWND hwnd )
{
memset( &lf, 0, sizeof lf );
lf.lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- lstrcpyW( lf.lfFaceName, szSansSerif );
+ lstrcpyW( lf.lfFaceName, L"MS Sans Serif" );
hFont = CreateFontIndirectW(&lf);
if (hFont)
{
@@ -3756,17 +3642,12 @@ static INT msi_dialog_get_sans_serif_height( HWND hwnd )
/* fetch the associated record from the Dialog table */
static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','D','i','a','l','o','g',' ',
- 'W','H','E','R','E',' ',
- '`','D','i','a','l','o','g','`',' ','=',' ','\'','%','s','\'',0};
MSIPACKAGE *package = dialog->package;
MSIRECORD *rec = NULL;
TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
- rec = MSI_QueryGetRecord( package->db, query, dialog->name );
+ rec = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Dialog` WHERE `Dialog` = '%s'", dialog->name );
if( !rec )
WARN("query failed for dialog %s\n", debugstr_w(dialog->name));
@@ -3775,9 +3656,6 @@ static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog )
static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LPRECT pos )
{
- static const WCHAR szScreenX[] = {'S','c','r','e','e','n','X',0};
- static const WCHAR szScreenY[] = {'S','c','r','e','e','n','Y',0};
-
UINT xres, yres;
POINT center;
SIZE sz;
@@ -3792,8 +3670,8 @@ static void msi_dialog_adjust_dialog_pos( msi_dialog *dialog, MSIRECORD *rec, LP
sz.cx = msi_dialog_scale_unit( dialog, sz.cx );
sz.cy = msi_dialog_scale_unit( dialog, sz.cy );
- xres = msi_get_property_int( dialog->package->db, szScreenX, 0 );
- yres = msi_get_property_int( dialog->package->db, szScreenY, 0 );
+ xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
+ yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
center.x = MulDiv( center.x, xres, 100 );
center.y = MulDiv( center.y, yres, 100 );
@@ -3859,10 +3737,6 @@ static void msi_dialog_set_tab_order( msi_dialog *dialog, LPCWSTR first )
static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
{
- static const WCHAR df[] = {
- 'D','e','f','a','u','l','t','U','I','F','o','n','t',0 };
- static const WCHAR dfv[] = {
- 'M','S',' ','S','h','e','l','l',' ','D','l','g',0 };
msi_dialog *dialog = cs->lpCreateParams;
MSIRECORD *rec = NULL;
LPWSTR title = NULL;
@@ -3886,10 +3760,10 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
dialog->attributes = MSI_RecordGetInteger( rec, 6 );
- dialog->default_font = msi_dup_property( dialog->package->db, df );
+ dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
if (!dialog->default_font)
{
- dialog->default_font = strdupW(dfv);
+ dialog->default_font = strdupW( L"MS Shell Dlg" );
if (!dialog->default_font)
{
msiobj_release( &rec->hdr );
@@ -3928,7 +3802,7 @@ static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd
case 2: /* escape */
control = msi_dialog_find_control( dialog, dialog->control_cancel );
break;
- default:
+ default:
control = msi_dialog_find_control_by_hwnd( dialog, hwnd );
}
@@ -4043,7 +3917,7 @@ static UINT dialog_run_message_loop( msi_dialog *dialog )
if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
style |= WS_MINIMIZEBOX;
- hwnd = CreateWindowW( szMsiDialogClass, dialog->name, style,
+ hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, NULL, dialog );
if( !hwnd )
@@ -4098,20 +3972,20 @@ static BOOL dialog_register_class( void )
cls.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
cls.lpszMenuName = NULL;
- cls.lpszClassName = szMsiDialogClass;
+ cls.lpszClassName = L"MsiDialogCloseClass";
if( !RegisterClassW( &cls ) )
return FALSE;
cls.lpfnWndProc = MSIHiddenWindowProc;
- cls.lpszClassName = szMsiHiddenWindow;
+ cls.lpszClassName = L"MsiHiddenWindow";
if( !RegisterClassW( &cls ) )
return FALSE;
uiThreadId = GetCurrentThreadId();
- hMsiHiddenWindow = CreateWindowW( szMsiHiddenWindow, NULL, WS_OVERLAPPED,
+ hMsiHiddenWindow = CreateWindowW( L"MsiHiddenWindow", NULL, WS_OVERLAPPED,
0, 0, 100, 100, NULL, NULL, NULL, NULL );
if( !hMsiHiddenWindow )
return FALSE;
@@ -4122,8 +3996,6 @@ static BOOL dialog_register_class( void )
static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent,
control_event_handler event_handler )
{
- static const WCHAR szDialogCreated[] =
- {'D','i','a','l','o','g',' ','c','r','e','a','t','e','d',0};
MSIRECORD *rec = NULL;
msi_dialog *dialog;
@@ -4162,7 +4034,7 @@ static msi_dialog *dialog_create( MSIPACKAGE *package, const WCHAR *name, msi_di
return NULL;
}
MSI_RecordSetStringW(rec, 1, name);
- MSI_RecordSetStringW(rec, 2, szDialogCreated);
+ MSI_RecordSetStringW(rec, 2, L"Dialog created");
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, rec);
msiobj_release(&rec->hdr);
@@ -4292,8 +4164,8 @@ void msi_dialog_unregister_class( void )
{
DestroyWindow( hMsiHiddenWindow );
hMsiHiddenWindow = NULL;
- UnregisterClassW( szMsiDialogClass, NULL );
- UnregisterClassW( szMsiHiddenWindow, NULL );
+ UnregisterClassW( L"MsiDialogCloseClass", NULL );
+ UnregisterClassW( L"MsiHiddenWindow", NULL );
uiThreadId = 0;
}
@@ -4477,18 +4349,13 @@ static INT event_do_dialog( MSIPACKAGE *package, const WCHAR *name, msi_dialog *
/* end a modal dialog box */
static UINT event_end_dialog( msi_dialog *dialog, const WCHAR *argument )
{
- static const WCHAR exitW[] = {'E','x','i','t',0};
- static const WCHAR retryW[] = {'R','e','t','r','y',0};
- static const WCHAR ignoreW[] = {'I','g','n','o','r','e',0};
- static const WCHAR returnW[] = {'R','e','t','u','r','n',0};
-
- if (!wcscmp( argument, exitW ))
+ if (!wcscmp( argument, L"Exit" ))
dialog->retval = IDCANCEL;
- else if (!wcscmp( argument, retryW ))
+ else if (!wcscmp( argument, L"Retry" ))
dialog->retval = IDRETRY;
- else if (!wcscmp( argument, ignoreW ))
+ else if (!wcscmp( argument, L"Ignore" ))
dialog->retval = IDOK;
- else if (!wcscmp( argument, returnW ))
+ else if (!wcscmp( argument, L"Return" ))
dialog->retval = 0;
else
{
@@ -4570,10 +4437,10 @@ static UINT event_add_local( msi_dialog *dialog, const WCHAR *argument )
LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
{
- if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, szAll ))
+ if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
{
if (feature->ActionRequest != INSTALLSTATE_LOCAL)
- msi_set_property( dialog->package->db, szPreselected, szOne, -1 );
+ msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
MSI_SetFeatureStateW( dialog->package, feature->Feature, INSTALLSTATE_LOCAL );
}
}
@@ -4586,10 +4453,10 @@ static UINT event_remove( msi_dialog *dialog, const WCHAR *argument )
LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
{
- if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, szAll ))
+ if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
{
if (feature->ActionRequest != INSTALLSTATE_ABSENT)
- msi_set_property( dialog->package->db, szPreselected, szOne, -1 );
+ msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
MSI_SetFeatureStateW( dialog->package, feature->Feature, INSTALLSTATE_ABSENT );
}
}
@@ -4602,10 +4469,10 @@ static UINT event_add_source( msi_dialog *dialog, const WCHAR *argument )
LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
{
- if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, szAll ))
+ if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
{
if (feature->ActionRequest != INSTALLSTATE_SOURCE)
- msi_set_property( dialog->package->db, szPreselected, szOne, -1 );
+ msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
MSI_SetFeatureStateW( dialog->package, feature->Feature, INSTALLSTATE_SOURCE );
}
}
@@ -4632,7 +4499,7 @@ static UINT event_set_target_path( msi_dialog *dialog, const WCHAR *argument )
UINT r = ERROR_SUCCESS;
MSI_RecordSetStringW( rec, 1, path );
- msi_event_fire( dialog->package, szSelectionPath, rec );
+ msi_event_fire( dialog->package, L"SelectionPath", rec );
if (path)
{
/* failure to set the path halts the executing of control events */
@@ -4651,11 +4518,10 @@ static UINT event_reset( msi_dialog *dialog, const WCHAR *argument )
INT ACTION_ShowDialog( MSIPACKAGE *package, const WCHAR *dialog )
{
- static const WCHAR szDialog[] = {'D','i','a','l','o','g',0};
MSIRECORD *row;
INT rc;
- if (!TABLE_Exists(package->db, szDialog)) return 0;
+ if (!TABLE_Exists(package->db, L"Dialog")) return 0;
row = MSI_CreateRecord(0);
if (!row) return -1;
@@ -4722,12 +4588,12 @@ static UINT event_directory_list_new( msi_dialog *dialog, const WCHAR *argument
static UINT event_reinstall_mode( msi_dialog *dialog, const WCHAR *argument )
{
- return msi_set_property( dialog->package->db, szReinstallMode, argument, -1 );
+ return msi_set_property( dialog->package->db, L"REINSTALLMODE", argument, -1 );
}
static UINT event_reinstall( msi_dialog *dialog, const WCHAR *argument )
{
- return msi_set_property( dialog->package->db, szReinstall, argument, -1 );
+ return msi_set_property( dialog->package->db, L"REINSTALL", argument, -1 );
}
static UINT event_validate_product_id( msi_dialog *dialog, const WCHAR *argument )
@@ -4735,43 +4601,25 @@ static UINT event_validate_product_id( msi_dialog *dialog, const WCHAR *argument
return msi_validate_product_id( dialog->package );
}
-static const WCHAR end_dialogW[] = {'E','n','d','D','i','a','l','o','g',0};
-static const WCHAR new_dialogW[] = {'N','e','w','D','i','a','l','o','g',0};
-static const WCHAR spawn_dialogW[] = {'S','p','a','w','n','D','i','a','l','o','g',0};
-static const WCHAR spawn_wait_dialogW[] = {'S','p','a','w','n','W','a','i','t','D','i','a','l','o','g',0};
-static const WCHAR do_actionW[] = {'D','o','A','c','t','i','o','n',0};
-static const WCHAR add_localW[] = {'A','d','d','L','o','c','a','l',0};
-static const WCHAR removeW[] = {'R','e','m','o','v','e',0};
-static const WCHAR add_sourceW[] = {'A','d','d','S','o','u','r','c','e',0};
-static const WCHAR set_target_pathW[] = {'S','e','t','T','a','r','g','e','t','P','a','t','h',0};
-static const WCHAR resetW[] = {'R','e','s','e','t',0};
-static const WCHAR set_install_levelW[] = {'S','e','t','I','n','s','t','a','l','l','L','e','v','e','l',0};
-static const WCHAR directory_list_upW[] = {'D','i','r','e','c','t','o','r','y','L','i','s','t','U','p',0};
-static const WCHAR directory_list_newW[] = {'D','i','r','e','c','t','o','r','y','L','i','s','t','N','e','w',0};
-static const WCHAR selection_browseW[] = {'S','e','l','e','c','t','i','o','n','B','r','o','w','s','e',0};
-static const WCHAR reinstall_modeW[] = {'R','e','i','n','s','t','a','l','l','M','o','d','e',0};
-static const WCHAR reinstallW[] = {'R','e','i','n','s','t','a','l','l',0};
-static const WCHAR validate_product_idW[] = {'V','a','l','i','d','a','t','e','P','r','o','d','u','c','t','I','D',0};
-
static const struct control_event control_events[] =
{
- { end_dialogW, pending_event_end_dialog },
- { new_dialogW, pending_event_new_dialog },
- { spawn_dialogW, pending_event_spawn_dialog },
- { spawn_wait_dialogW, event_spawn_wait_dialog },
- { do_actionW, event_do_action },
- { add_localW, event_add_local },
- { removeW, event_remove },
- { add_sourceW, event_add_source },
- { set_target_pathW, event_set_target_path },
- { resetW, event_reset },
- { set_install_levelW, event_set_install_level },
- { directory_list_upW, event_directory_list_up },
- { directory_list_newW, event_directory_list_new },
- { selection_browseW, event_spawn_dialog },
- { reinstall_modeW, event_reinstall_mode },
- { reinstallW, event_reinstall },
- { validate_product_idW, event_validate_product_id },
+ { L"EndDialog", pending_event_end_dialog },
+ { L"NewDialog", pending_event_new_dialog },
+ { L"SpawnDialog", pending_event_spawn_dialog },
+ { L"SpawnWaitDialog", event_spawn_wait_dialog },
+ { L"DoAction", event_do_action },
+ { L"AddLocal", event_add_local },
+ { L"Remove", event_remove },
+ { L"AddSource", event_add_source },
+ { L"SetTargetPath", event_set_target_path },
+ { L"Reset", event_reset },
+ { L"SetInstallLevel", event_set_install_level },
+ { L"DirectoryListUp", event_directory_list_up },
+ { L"DirectoryListNew", event_directory_list_new },
+ { L"SelectionBrowse", event_spawn_dialog },
+ { L"ReinstallMode", event_reinstall_mode },
+ { L"Reinstall", event_reinstall },
+ { L"ValidateProductID", event_validate_product_id },
{ NULL, NULL }
};
--
2.28.0
1
0
[PATCH 3/4] winex11.drv: Query virtual screen and primary screen rectangles from the wineserver.
by Zhiyi Zhang 28 Oct '20
by Zhiyi Zhang 28 Oct '20
28 Oct '20
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/winex11.drv/display.c | 39 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 23 deletions(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c
index abc4f2a07cc..b0c52fa91ef 100644
--- a/dlls/winex11.drv/display.c
+++ b/dlls/winex11.drv/display.c
@@ -47,7 +47,6 @@ DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_OUTPUT_ID, 0xca085853, 0x16ce, 0x48aa, 0xb1
/* Wine specific properties */
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_GPU_VULKAN_UUID, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5c, 2);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_STATEFLAGS, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 2);
-DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCMONITOR, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 3);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0};
@@ -146,14 +145,11 @@ void release_display_device_init_mutex(HANDLE mutex)
static BOOL update_screen_cache(void)
{
RECT virtual_rect = {0}, primary_rect = {0}, monitor_rect;
- SP_DEVINFO_DATA device_data = {sizeof(device_data)};
- HDEVINFO devinfo = INVALID_HANDLE_VALUE;
FILETIME filetime = {0};
HANDLE mutex = NULL;
+ NTSTATUS status;
DWORD i = 0;
INT result;
- DWORD type;
- BOOL ret = FALSE;
EnterCriticalSection(&screen_section);
if ((!video_key && RegOpenKeyW(HKEY_LOCAL_MACHINE, video_keyW, &video_key))
@@ -169,15 +165,21 @@ static BOOL update_screen_cache(void)
mutex = get_display_device_init_mutex();
- devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, displayW, NULL, DIGCF_PRESENT);
- if (devinfo == INVALID_HANDLE_VALUE)
- goto fail;
-
- while (SetupDiEnumDeviceInfo(devinfo, i++, &device_data))
+ while (TRUE)
{
- if (!SetupDiGetDevicePropertyW(devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCMONITOR, &type,
- (BYTE *)&monitor_rect, sizeof(monitor_rect), NULL, 0))
- goto fail;
+ SERVER_START_REQ(enum_monitor)
+ {
+ req->index = i++;
+ if (!(status = wine_server_call(req)))
+ {
+ SetRect(&monitor_rect, reply->monitor_rect.left, reply->monitor_rect.top,
+ reply->monitor_rect.right, reply->monitor_rect.bottom);
+ }
+ }
+ SERVER_END_REQ;
+
+ if (status)
+ break;
UnionRect(&virtual_rect, &virtual_rect, &monitor_rect);
if (i == 1)
@@ -189,13 +191,8 @@ static BOOL update_screen_cache(void)
primary_monitor_rect = primary_rect;
last_query_screen_time = filetime;
LeaveCriticalSection(&screen_section);
- ret = TRUE;
-fail:
- SetupDiDestroyDeviceInfoList(devinfo);
release_display_device_init_mutex(mutex);
- if (!ret)
- WARN("Update screen cache failed!\n");
- return ret;
+ return TRUE;
}
POINT virtual_screen_to_root(INT x, INT y)
@@ -621,10 +618,6 @@ static BOOL X11DRV_InitMonitor(HDEVINFO devinfo, const struct x11drv_monitor *mo
if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_STATEFLAGS, DEVPROP_TYPE_UINT32,
(const BYTE *)&monitor->state_flags, sizeof(monitor->state_flags), 0))
goto done;
- /* RcMonitor */
- if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCMONITOR, DEVPROP_TYPE_BINARY,
- (const BYTE *)&monitor->rc_monitor, sizeof(monitor->rc_monitor), 0))
- goto done;
/* Adapter name */
sprintfW(bufferW, adapter_name_fmtW, video_index + 1);
size = (strlenW(bufferW) + 1) * sizeof(WCHAR);
--
2.27.0
2
1
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/dbs.idl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/dbs.idl b/include/dbs.idl
index 63617c88c00..19f92b3c05f 100644
--- a/include/dbs.idl
+++ b/include/dbs.idl
@@ -500,6 +500,8 @@ cpp_quote(" EXTERN_C const GUID name DECLSPEC_HIDDEN")
cpp_quote("#endif")
cpp_quote("DEFINE_DBGUID(DB_NULLGUID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);")
+cpp_quote("DEFINE_DBGUID(DBGUID_SQL, 0xc8b522d7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
+cpp_quote("DEFINE_DBGUID(DBGUID_DEFAULT, 0xc8b521fb, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_SESSION, 0xc8b522f5, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROWSET, 0xc8b522f6, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
cpp_quote("DEFINE_DBGUID(DBGUID_ROW, 0xc8b522f7, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);")
--
2.28.0
1
0