From bca84d5467bc0242da027d24082871d8df3053fd Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 29 Apr 2008 18:19:05 -0700 Subject: [PATCH] userenv: Initial implementation of CreateEnvironmentBlock. --- dlls/userenv/Makefile.in | 2 +- dlls/userenv/tests/userenv.c | 4 ++-- dlls/userenv/userenv_main.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dlls/userenv/Makefile.in b/dlls/userenv/Makefile.in index 946d2109b71..07bba8fa8a6 100644 --- a/dlls/userenv/Makefile.in +++ b/dlls/userenv/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = userenv.dll -IMPORTS = kernel32 +IMPORTS = kernel32 ntdll IMPORTLIB = userenv C_SRCS = \ diff --git a/dlls/userenv/tests/userenv.c b/dlls/userenv/tests/userenv.c index 9f9425ac7f9..c50b0a27554 100644 --- a/dlls/userenv/tests/userenv.c +++ b/dlls/userenv/tests/userenv.c @@ -41,7 +41,7 @@ static void test_create_env(void) expect(FALSE, r); r = CreateEnvironmentBlock((LPVOID) &env, NULL, FALSE); - todo_wine expect(TRUE, r); + expect(TRUE, r); r = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &htok); expect(TRUE, r); @@ -50,7 +50,7 @@ static void test_create_env(void) expect(FALSE, r); r = CreateEnvironmentBlock((LPVOID) &env2, htok, FALSE); - todo_wine expect(TRUE, r); + expect(TRUE, r); } START_TEST(userenv) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 0efea5c99ff..1eaaa7146f0 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -20,9 +20,12 @@ #include +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "windef.h" #include "winbase.h" #include "winreg.h" +#include "winternl.h" #include "userenv.h" #include "wine/debug.h" @@ -49,7 +52,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment, HANDLE hToken, BOOL bInherit ) { - FIXME("%p %p %d\n", lpEnvironment, hToken, bInherit ); + NTSTATUS r; + + TRACE("%p %p %d\n", lpEnvironment, hToken, bInherit ); + + if (!lpEnvironment) + return FALSE; + + r = RtlCreateEnvironment(bInherit, (WCHAR **)lpEnvironment); + if (r == STATUS_SUCCESS) + return TRUE; return FALSE; } -- 2.11.4.GIT