Alexandre Julliard : user32: Store window station objects under the session directory.

Alexandre Julliard julliard at winehq.org
Mon Jul 18 09:22:34 CDT 2016


Module: wine
Branch: master
Commit: 911e59c1333be238cc504bd9c3e06131e1204882
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=911e59c1333be238cc504bd9c3e06131e1204882

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul 18 15:38:42 2016 +0900

user32: Store window station objects under the session directory.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/winstation.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c
index 61add76..673917c 100644
--- a/dlls/user32/winstation.c
+++ b/dlls/user32/winstation.c
@@ -59,8 +59,10 @@ static BOOL CALLBACK enum_names_WtoA( LPWSTR name, LPARAM lparam )
 static HANDLE get_winstations_dir_handle(void)
 {
     static HANDLE handle = NULL;
-    static const WCHAR basenameW[] = {'\\','W','i','n','d','o','w','s','\\',
+    static const WCHAR basenameW[] = {'\\','S','e','s','s','i','o','n','s','\\','%','u',
+                                      '\\','W','i','n','d','o','w','s','\\',
                                       'W','i','n','d','o','w','S','t','a','t','i','o','n','s',0};
+    WCHAR buffer[64];
     UNICODE_STRING str;
     OBJECT_ATTRIBUTES attr;
 
@@ -68,7 +70,8 @@ static HANDLE get_winstations_dir_handle(void)
     {
         HANDLE dir;
 
-        RtlInitUnicodeString( &str, basenameW );
+        sprintfW( buffer, basenameW, NtCurrentTeb()->Peb->SessionId );
+        RtlInitUnicodeString( &str, buffer );
         InitializeObjectAttributes( &attr, &str, 0, 0, NULL );
         NtOpenDirectoryObject( &dir, DIRECTORY_CREATE_OBJECT | DIRECTORY_TRAVERSE, &attr );
         if (InterlockedCompareExchangePointer( &handle, dir, 0 ) != 0) /* someone beat us here */




More information about the wine-cvs mailing list