ntoskrnl.exe: Specify the access rights when creating an object.

Dmitry Timoshkov dmitry at baikal.ru
Thu Jan 12 03:30:42 CST 2012


While investigating how to fix the file section access tests in kernel32 I've
found that some places in Wine deliberately create objects with access rights
set to 0, that leads to creation of potentially not accessible objects.

---
 dlls/ntoskrnl.exe/ntoskrnl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 4dbab40..e501b9d 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -541,7 +541,7 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
 
     SERVER_START_REQ( create_device )
     {
-        req->access     = 0;
+        req->access     = STANDARD_RIGHTS_ALL;
         req->attributes = 0;
         req->rootdir    = 0;
         req->manager    = wine_server_obj_handle( manager );
@@ -634,7 +634,7 @@ NTSTATUS WINAPI IoDeleteSymbolicLink( UNICODE_STRING *name )
     attr.SecurityDescriptor       = NULL;
     attr.SecurityQualityOfService = NULL;
 
-    if (!(status = NtOpenSymbolicLinkObject( &handle, 0, &attr )))
+    if (!(status = NtOpenSymbolicLinkObject( &handle, DELETE, &attr )))
     {
         SERVER_START_REQ( unlink_object )
         {
-- 
1.7.7.4




More information about the wine-patches mailing list