ntdll: Call NtCreateSection with NULL attributes loading native dll

Nikolay Sivov bunglehead at gmail.com
Mon Jun 8 01:19:06 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=18798

Application in this bug knows too much about internal loading sequence
and doesn't expect not-NULL attributes in NtCreateSection. Anyway
zero structure used now, so it should be harmless to remove it.

Changelog:
    - Call NtCreateSection with NULL attributes loading native dll

>From 4405caca9f397ed06d42a828519f0196c18b177a Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Sat, 6 Jun 2009 23:27:21 +0400
Subject: Call NtCreateSection with NULL attributes loading native dll

---
 dlls/ntdll/loader.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 925261a..04de7ad 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1467,7 +1467,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
 {
     void *module;
     HANDLE mapping;
-    OBJECT_ATTRIBUTES attr;
     LARGE_INTEGER size;
     IMAGE_NT_HEADERS *nt;
     SIZE_T len = 0;
@@ -1476,16 +1475,8 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
 
     TRACE("Trying native dll %s\n", debugstr_w(name));
 
-    attr.Length                   = sizeof(attr);
-    attr.RootDirectory            = 0;
-    attr.ObjectName               = NULL;
-    attr.Attributes               = 0;
-    attr.SecurityDescriptor       = NULL;
-    attr.SecurityQualityOfService = NULL;
-    size.QuadPart = 0;
-
     status = NtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ,
-                              &attr, &size, PAGE_READONLY, SEC_IMAGE, file );
+                              NULL, &size, PAGE_READONLY, SEC_IMAGE, file );
     if (status != STATUS_SUCCESS) return status;
 
     module = NULL;
-- 
1.5.6.5







More information about the wine-patches mailing list