Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 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
- 4 participants
- 84544 discussions
[PATCH v3 resend 3/4] ntdll: Allow NtQueryVolumeInformationFile to query volume information from the mountmgr.
by Erich E. Hoover Oct. 28, 2020
by Erich E. Hoover Oct. 28, 2020
Oct. 28, 2020
This patch allows NtQueryVolumeInformationFile to pass
FileFsVolumeInformation and FileFsAttributeInformation requests to the
mountmgr. These requests currently do not work for NT device paths,
which results in a bunch of duplication in kernelbase.
Best,
Erich
2
3
[PATCH v3 resend 1/4] server: Allow get_volume_info to issue IRP_MJ_QUERY_VOLUME_INFORMATION.
by Erich E. Hoover Oct. 28, 2020
by Erich E. Hoover Oct. 28, 2020
Oct. 28, 2020
Per AJ's request for splitting, this patch allows the get_volume_info
request to issue an IRP to request the volume information from the
mountmgr. Sorry it's taken me awhile to get to this :/
Note that patch 1 and 2 can be applied in opposite order, if desired.
Best,
Erich2
2
1
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
configure | 1 +
configure.ac | 1 +
dlls/wow64cpu/Makefile.in | 7 +++++++
dlls/wow64cpu/wow64cpu.spec | 9 +++++++++
dlls/wow64cpu/wow64cpu_main.c | 27 +++++++++++++++++++++++++++
5 files changed, 45 insertions(+)
create mode 100644 dlls/wow64cpu/Makefile.in
create mode 100644 dlls/wow64cpu/wow64cpu.spec
create mode 100644 dlls/wow64cpu/wow64cpu_main.c
diff --git a/configure b/configure
index ac6a7985cc7..b7a6fcae9a8 100755
--- a/configure
+++ b/configure
@@ -21142,6 +21142,7 @@ wine_fn_config_makefile dlls/wmvcore enable_wmvcore
wine_fn_config_makefile dlls/wmvcore/tests enable_tests
wine_fn_config_makefile dlls/wnaspi32 enable_wnaspi32
wine_fn_config_makefile dlls/wow32 enable_win16
+wine_fn_config_makefile dlls/wow64cpu enable_win64
wine_fn_config_makefile dlls/wpc enable_wpc
wine_fn_config_makefile dlls/wpc/tests enable_tests
wine_fn_config_makefile dlls/wpcap enable_wpcap
diff --git a/configure.ac b/configure.ac
index 2f81fd22610..83939c85e52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3885,6 +3885,7 @@ WINE_CONFIG_MAKEFILE(dlls/wmvcore)
WINE_CONFIG_MAKEFILE(dlls/wmvcore/tests)
WINE_CONFIG_MAKEFILE(dlls/wnaspi32)
WINE_CONFIG_MAKEFILE(dlls/wow32,enable_win16)
+WINE_CONFIG_MAKEFILE(dlls/wow64cpu,enable_win64)
WINE_CONFIG_MAKEFILE(dlls/wpc)
WINE_CONFIG_MAKEFILE(dlls/wpc/tests)
WINE_CONFIG_MAKEFILE(dlls/wpcap)
diff --git a/dlls/wow64cpu/Makefile.in b/dlls/wow64cpu/Makefile.in
new file mode 100644
index 00000000000..2ab1ca62c4a
--- /dev/null
+++ b/dlls/wow64cpu/Makefile.in
@@ -0,0 +1,7 @@
+MODULE = wow64cpu.dll
+IMPORTS = winecrt0 ntdll
+
+EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin
+
+C_SRCS = \
+ wow64cpu_main.c
diff --git a/dlls/wow64cpu/wow64cpu.spec b/dlls/wow64cpu/wow64cpu.spec
new file mode 100644
index 00000000000..bd156df1e79
--- /dev/null
+++ b/dlls/wow64cpu/wow64cpu.spec
@@ -0,0 +1,9 @@
+# @ stub BTCpuGetBopCode
+# @ stub BTCpuGetContext
+# @ stub BTCpuProcessInit
+# @ stub BTCpuResetToConsistentState
+# @ stub BTCpuSetContext
+# @ stub BTCpuSimulate
+# @ stub BTCpuTurboThunkControl
+# @ stub TurboDispatchJumpAddressEnd
+# @ stub TurboDispatchJumpAddressStart
diff --git a/dlls/wow64cpu/wow64cpu_main.c b/dlls/wow64cpu/wow64cpu_main.c
new file mode 100644
index 00000000000..4da9695230b
--- /dev/null
+++ b/dlls/wow64cpu/wow64cpu_main.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2018 Zebediah Figura
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winternl.h"
+
+BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
+{
+ if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
+ return TRUE;
+}
--
2.28.0
2
4
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
configure | 2 ++
configure.ac | 1 +
dlls/wow64cpu/Makefile.in | 7 +++++++
dlls/wow64cpu/wow64cpu.spec | 25 +++++++++++++++++++++++++
dlls/wow64cpu/wow64cpu_main.c | 27 +++++++++++++++++++++++++++
5 files changed, 62 insertions(+)
create mode 100644 dlls/wow64cpu/Makefile.in
create mode 100644 dlls/wow64cpu/wow64cpu.spec
create mode 100644 dlls/wow64cpu/wow64cpu_main.c
diff --git a/configure b/configure
index ac6a7985cc7..8bff0297bef 100755
--- a/configure
+++ b/configure
@@ -1692,6 +1692,7 @@ enable_wmp
enable_wmphoto
enable_wmvcore
enable_wnaspi32
+enable_wow64cpu
enable_wpc
enable_wpcap
enable_ws2_32
@@ -21142,6 +21143,7 @@ wine_fn_config_makefile dlls/wmvcore enable_wmvcore
wine_fn_config_makefile dlls/wmvcore/tests enable_tests
wine_fn_config_makefile dlls/wnaspi32 enable_wnaspi32
wine_fn_config_makefile dlls/wow32 enable_win16
+wine_fn_config_makefile dlls/wow64cpu enable_wow64cpu
wine_fn_config_makefile dlls/wpc enable_wpc
wine_fn_config_makefile dlls/wpc/tests enable_tests
wine_fn_config_makefile dlls/wpcap enable_wpcap
diff --git a/configure.ac b/configure.ac
index 2f81fd22610..7b7abeb11ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3885,6 +3885,7 @@ WINE_CONFIG_MAKEFILE(dlls/wmvcore)
WINE_CONFIG_MAKEFILE(dlls/wmvcore/tests)
WINE_CONFIG_MAKEFILE(dlls/wnaspi32)
WINE_CONFIG_MAKEFILE(dlls/wow32,enable_win16)
+WINE_CONFIG_MAKEFILE(dlls/wow64cpu)
WINE_CONFIG_MAKEFILE(dlls/wpc)
WINE_CONFIG_MAKEFILE(dlls/wpc/tests)
WINE_CONFIG_MAKEFILE(dlls/wpcap)
diff --git a/dlls/wow64cpu/Makefile.in b/dlls/wow64cpu/Makefile.in
new file mode 100644
index 00000000000..2ab1ca62c4a
--- /dev/null
+++ b/dlls/wow64cpu/Makefile.in
@@ -0,0 +1,7 @@
+MODULE = wow64cpu.dll
+IMPORTS = winecrt0 ntdll
+
+EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin
+
+C_SRCS = \
+ wow64cpu_main.c
diff --git a/dlls/wow64cpu/wow64cpu.spec b/dlls/wow64cpu/wow64cpu.spec
new file mode 100644
index 00000000000..0ea2b4defc6
--- /dev/null
+++ b/dlls/wow64cpu/wow64cpu.spec
@@ -0,0 +1,25 @@
+# @ stub CpuFlushInstructionCache
+# @ stub CpuGetContext
+# @ stub CpuGetStackPointer
+# @ stub CpuInitializeStartupContext
+# @ stub CpuNotifyAffinityChange
+# @ stub CpuNotifyAfterFork
+# @ stub CpuNotifyBeforeFork
+# @ stub CpuNotifyDllLoad
+# @ stub CpuNotifyDllUnload
+# @ stub CpuPrepareForDebuggerAttach
+# @ stub CpuProcessDebugEvent
+# @ stub CpuProcessInit
+# @ stub CpuProcessTerm
+# @ stub CpuResetFloatingPoint
+# @ stub CpuResetToConsistentState
+# @ stub CpuSetContext
+# @ stub CpuSetInstructionPointer
+# @ stub CpuSetStackPointer
+# @ stub CpuSimulate
+# @ stub CpuSuspendLocalThread
+# @ stub CpuSuspendThread
+# @ stub CpuThreadInit
+# @ stub CpuThreadTerm
+# @ stub TurboDispatchJumpAddressEnd
+# @ stub TurboDispatchJumpAddressStart
diff --git a/dlls/wow64cpu/wow64cpu_main.c b/dlls/wow64cpu/wow64cpu_main.c
new file mode 100644
index 00000000000..4da9695230b
--- /dev/null
+++ b/dlls/wow64cpu/wow64cpu_main.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2018 Zebediah Figura
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winternl.h"
+
+BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
+{
+ if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
+ return TRUE;
+}
--
2.28.0
4
8
Oct. 28, 2020
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/msxml3/tests/domdoc.c | 13 +++----------
dlls/msxml3/tests/saxreader.c | 14 +++++++-------
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index c19dd6c430e..02e31b4aafb 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -733,11 +733,7 @@ static void _expect_parse_error(IXMLDOMDocument *doc, HRESULT hr_exp, BOOL hr_to
IXMLDOMParseError_Release(error);
}
-static const WCHAR szComplete1[] = {
- '<','?','x','m','l',' ',
- 'v','e','r','s','i','o','n','=','\'','1','.','0','\'','?','>','\n',
- '<','o','p','e','n','>','<','/','o','p','e','n','>','\n',0
-};
+static const WCHAR szComplete1[] = L"<?xml version='1.0'?>\n<open></open>\n";
static const char complete4A[] =
"<?xml version=\'1.0\'?>\n"
"<lc dl=\'str1\'>\n"
@@ -1148,10 +1144,7 @@ static const char attributes_map[] = {
static const WCHAR nonexistent_fileW[] = L"c:\\Nonexistent.xml";
-static const WCHAR szElementXML4[] = {'<','E','l','e','T','e','s','t',' ','A','t','t','r','=','"','"','>',
- '&','a','m','p',';','x',' ',0x2103,'<','/','E','l','e','T','e','s','t','>',0 };
-
-static const WCHAR szStrangeChars[] = {'&','x',' ',0x2103, 0};
+static const WCHAR szStrangeChars[] = L"&x \x2103";
#define expect_bstr_eq_and_free(bstr, expect) { \
BSTR bstrExp = alloc_str_from_narrow(expect); \
@@ -5872,7 +5865,7 @@ static void test_xmlTypes(void)
hr = IXMLDOMElement_get_xml(pElement, &str);
ok(hr == S_OK, "ret %08x\n", hr );
- ok( !lstrcmpW( str, szElementXML4 ), "incorrect element xml\n");
+ ok( !lstrcmpW( str, L"<EleTest Attr=\"\">&x \x2103</EleTest>" ), "incorrect element xml\n");
SysFreeString(str);
hr = IXMLDOMElement_get_text(pElement, &str);
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index 47d158ab3ea..ab814c5f764 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -1518,9 +1518,9 @@ static HRESULT WINAPI isaxattributes_getQName(
const WCHAR **QName,
int *QNameLength)
{
- static const WCHAR attrqnamesW[][15] = {{'a',':','a','t','t','r','1','j','u','n','k',0},
- {'a','t','t','r','2','j','u','n','k',0},
- {'a','t','t','r','3',0}};
+ static const WCHAR attrqnamesW[][15] = {L"a:attr1junk",
+ L"attr2junk",
+ L"attr3"};
static const int attrqnamelen[] = {7, 5, 5};
ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
@@ -1609,9 +1609,9 @@ static HRESULT WINAPI isaxattributes_getTypeFromQName(
static HRESULT WINAPI isaxattributes_getValue(ISAXAttributes* iface, int index,
const WCHAR **value, int *nValue)
{
- static const WCHAR attrvaluesW[][10] = {{'a','1','j','u','n','k',0},
- {'a','2','j','u','n','k',0},
- {'<','&','"','>','\'',0}};
+ static const WCHAR attrvaluesW[][10] = {L"a1junk",
+ L"a2junk",
+ L"<&\">'"};
static const int attrvalueslen[] = {2, 2, 5};
ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
@@ -3960,7 +3960,7 @@ static const struct writer_characters_t writer_characters[] = {
static void test_mxwriter_characters(void)
{
- static const WCHAR embedded_nullbytes[] = {'a',0,'b',0,0,0,'c',0};
+ static const WCHAR embedded_nullbytes[] = L"a\0b\0\0\0c";
const struct writer_characters_t *table = writer_characters;
IVBSAXContentHandler *vb_content;
ISAXContentHandler *content;
--
2.26.2
2
1
[PATCH v2 1/2] ntdll: Allow renaming a file/directory to a different casing of itself.
by Gabriel Ivăncescu Oct. 28, 2020
by Gabriel Ivăncescu Oct. 28, 2020
Oct. 28, 2020
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 Oct. 28, 2020
by Zhiyi Zhang Oct. 28, 2020
Oct. 28, 2020
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
Oct. 28, 2020
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
Oct. 28, 2020
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