Hi Zebediah, thanks for looking into this. Please
find my responses
inline below. I've already incorporated many things, but still have
some remaining questions and comments.
I would re-submit it soon, and include a "versioning" in the mail tag
as I've seen on other submissions (i.e., [PATCH v2]).
On Mon, Feb 10, 2020 at 4:38 AM Zebediah Figura <z.figura12(a)gmail.com> wrote:
Hello Frank, thanks for the patch.
With regard to the title, convention is to put the name of the component
first, followed by a colon, then a verb describing what the patch does,
so e.g. "kernelbase: Add SetEnvironmentStringsW()."
I have a few more comments inlined below which
might help improve the patch:
On 1/22/20 3:33 PM, Frank Uhlig wrote:
From: Frank Uhlig
<fuulish(a)users.noreply.github.com>
Signed-off-by: Frank Uhlig <uhlig.frank(a)gmail.com>
---
...ms-win-core-processenvironment-l1-1-0.spec | 2 +-
...ms-win-core-processenvironment-l1-2-0.spec | 2 +-
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/tests/environ.c | 61 +++++++++++++++++++
dlls/kernelbase/kernelbase.spec | 2 +-
dlls/kernelbase/process.c | 29 +++++++++
include/winbase.h | 1 +
7 files changed, 95 insertions(+), 4 deletions(-)
diff --git
a/dlls/api-ms-win-core-processenvironment-l1-1-0/api-ms-win-core-processenvironment-l1-1-0.spec
b/dlls/api-ms-win-core-processenvironment-l1-1-0/api-ms-win-core-processenvironment-l1-1-0.spec
index e3698d6efd..7a62b74390 100644
---
a/dlls/api-ms-win-core-processenvironment-l1-1-0/api-ms-win-core-processenvironment-l1-1-0.spec
+++
b/dlls/api-ms-win-core-processenvironment-l1-1-0/api-ms-win-core-processenvironment-l1-1-0.spec
@@ -15,7 +15,7 @@
@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW
@ stdcall SetCurrentDirectoryA(str) kernel32.SetCurrentDirectoryA
@ stdcall SetCurrentDirectoryW(wstr) kernel32.SetCurrentDirectoryW
-@ stub SetEnvironmentStringsW
+@ stdcall SetEnvironmentStringsW(ptr) kernel32.SetEnvironmentStringsW
@ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA
@ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW
@ stdcall SetStdHandle(long long) kernel32.SetStdHandle
diff --git
a/dlls/api-ms-win-core-processenvironment-l1-2-0/api-ms-win-core-processenvironment-l1-2-0.spec
b/dlls/api-ms-win-core-processenvironment-l1-2-0/api-ms-win-core-processenvironment-l1-2-0.spec
index 2c25ee1a07..c93d221c5e 100644
---
a/dlls/api-ms-win-core-processenvironment-l1-2-0/api-ms-win-core-processenvironment-l1-2-0.spec
+++
b/dlls/api-ms-win-core-processenvironment-l1-2-0/api-ms-win-core-processenvironment-l1-2-0.spec
@@ -17,7 +17,7 @@
@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW
@ stdcall SetCurrentDirectoryA(str) kernel32.SetCurrentDirectoryA
@ stdcall SetCurrentDirectoryW(wstr) kernel32.SetCurrentDirectoryW
-@ stub SetEnvironmentStringsW
+@ stdcall SetEnvironmentStringsW(ptr) kernel32.SetEnvironmentStringsW
@ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA
@ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW
@ stdcall SetStdHandle(long long) kernel32.SetStdHandle
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index be48ef1694..2b74a4182e 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1387,7 +1387,7 @@
# @ stub SetDynamicTimeZoneInformation
@ stdcall -import SetEndOfFile(long)
# @ stub SetEnvironmentStringsA
-# @ stub SetEnvironmentStringsW
+@ stdcall -import SetEnvironmentStringsW (ptr)
@ stdcall -import SetEnvironmentVariableA(str str)
@ stdcall -import SetEnvironmentVariableW(wstr wstr)
@ stdcall -import SetErrorMode(long)
diff --git a/dlls/kernel32/tests/environ.c b/dlls/kernel32/tests/environ.c
index 44a6a0cff0..53b2803e77 100644
--- a/dlls/kernel32/tests/environ.c
+++ b/dlls/kernel32/tests/environ.c
@@ -579,6 +579,66 @@ static void test_GetEnvironmentStringsW(void)
FreeEnvironmentStringsW(env2);
}
+static void test_SetEnvironmentStringsW(void)
+{
+ DWORD buf_len;
+ BOOL ret;
+ DWORD ret_size;
+
+ static WCHAR buf[256];
+
+ static WCHAR name[] = {'N','a','m','e',0};
+ static WCHAR value[] =
{'V','a','l','u','e',0};
+ static WCHAR env[] =
{'N','a','m','e','=','V','a','l','u','e',0};
+
+ static WCHAR eman[] = {'e','m','a','N',0};
+ static WCHAR eulav[] =
{'e','u','l','a','V',0};
+ static WCHAR vne[] =
{'e','m','a','N','=','e','u','l','a','V',0};
+
+ static WCHAR var[] = {'V','a','r',0};
+ static WCHAR val[] = {'V','a','l',0};
+ static WCHAR rav[] = {'r','a','V',0};
+ static WCHAR lav[] = {'l','a','V',0};
+ static WCHAR mul[] =
{'V','a','r','=','V','a','l','
','r','a','V','=','l','a','V',0};
+
+ static WCHAR empty[] = {'V','a','r','=',0};
You can use wide character string literals in tests (which should also
allow you to get rid of some of these declarations).
Didn't change this, b/c I was trying to keep the same style as already
there and described on the website
(
).