Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com --- dlls/kernel32/kernel_private.h | 2 + dlls/kernel32/resource.c | 96 ++++++++++++++++++++++++++++++++++++++++++ dlls/kernel32/time.c | 28 ++++++++++++ 3 files changed, 126 insertions(+)
Akihiro Sagawa sagawa.aki@gmail.com writes:
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com
dlls/kernel32/kernel_private.h | 2 + dlls/kernel32/resource.c | 96 ++++++++++++++++++++++++++++++++++++++++++ dlls/kernel32/time.c | 28 ++++++++++++ 3 files changed, 126 insertions(+)
diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h index 09a2cad..15a4ab6 100644 --- a/dlls/kernel32/kernel_private.h +++ b/dlls/kernel32/kernel_private.h @@ -84,4 +84,6 @@ extern void TIMEZONE_InitRegistry(void) DECLSPEC_HIDDEN; /* oldconfig.c */ extern void convert_old_config(void) DECLSPEC_HIDDEN;
+/* resource.c */ +extern BOOL load_indirect_string(LPCWSTR src, LPWSTR dst, UINT dst_len) DECLSPEC_HIDDEN; #endif diff --git a/dlls/kernel32/resource.c b/dlls/kernel32/resource.c index a04fe62..49d87a0 100644 --- a/dlls/kernel32/resource.c +++ b/dlls/kernel32/resource.c @@ -1807,3 +1807,99 @@ BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, if(!IS_INTRESOURCE(lpName)) RtlFreeUnicodeString(&NameW); return ret; }
+/******************************************************************************
- load_string [Internal]
- This is basically a copy of advapi32/reg.c's load_string. Necessary to
- avoid importing user32, which is higher level than kernel32. Helper for
- following load_indirect_string.
- */
+static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +{
You should probably use RegLoadMUIStringW instead of duplicating this code.
On Wed, 05 Dec 2018 19:45:20 +0100, Alexandre Julliard wrote:
@@ -1807,3 +1807,99 @@ BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, if(!IS_INTRESOURCE(lpName)) RtlFreeUnicodeString(&NameW); return ret; }
+/******************************************************************************
- load_string [Internal]
- This is basically a copy of advapi32/reg.c's load_string. Necessary to
- avoid importing user32, which is higher level than kernel32. Helper for
- following load_indirect_string.
- */
+static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +{
You should probably use RegLoadMUIStringW instead of duplicating this code.
Is it safe to call advapi32 functions from kernel32? From my point of view, kernel32 doesn't import advapi32 functions at this point.
Akihiro Sagawa
Akihiro Sagawa sagawa.aki@gmail.com writes:
On Wed, 05 Dec 2018 19:45:20 +0100, Alexandre Julliard wrote:
@@ -1807,3 +1807,99 @@ BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, if(!IS_INTRESOURCE(lpName)) RtlFreeUnicodeString(&NameW); return ret; }
+/******************************************************************************
- load_string [Internal]
- This is basically a copy of advapi32/reg.c's load_string. Necessary to
- avoid importing user32, which is higher level than kernel32. Helper for
- following load_indirect_string.
- */
+static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +{
You should probably use RegLoadMUIStringW instead of duplicating this code.
Is it safe to call advapi32 functions from kernel32? From my point of view, kernel32 doesn't import advapi32 functions at this point.
It has been moved to kernelbase.dll in recent versions, we should do the same, then it could be used from anywhere. In the meantime I think loading it explicitly from advapi32 would be acceptable.
On Thu, 06 Dec 2018 13:07:12 +0100, Alexandre Julliard wrote:
Akihiro Sagawa sagawa.aki@gmail.com writes:
On Wed, 05 Dec 2018 19:45:20 +0100, Alexandre Julliard wrote:
@@ -1807,3 +1807,99 @@ BOOL WINAPI UpdateResourceA( HANDLE hUpdate, LPCSTR lpType, LPCSTR lpName, if(!IS_INTRESOURCE(lpName)) RtlFreeUnicodeString(&NameW); return ret; }
+/******************************************************************************
- load_string [Internal]
- This is basically a copy of advapi32/reg.c's load_string. Necessary to
- avoid importing user32, which is higher level than kernel32. Helper for
- following load_indirect_string.
- */
+static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +{
You should probably use RegLoadMUIStringW instead of duplicating this code.
Is it safe to call advapi32 functions from kernel32? From my point of view, kernel32 doesn't import advapi32 functions at this point.
It has been moved to kernelbase.dll in recent versions, we should do the same, then it could be used from anywhere. In the meantime I think loading it explicitly from advapi32 would be acceptable.
That's sounds good. I'll prepare revised patch.
Akihiro Sagawa