Rob Shearman : kernel32: Handle the SECURITY_* flags passed into CreateFileW by filling out the SECURITY_QUALITY_OF_SERVICE structure and passing it to NtCreateFile .

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 22 07:05:21 CST 2007


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Jan 19 07:00:29 2007 -0600

kernel32: Handle the SECURITY_* flags passed into CreateFileW by filling out the SECURITY_QUALITY_OF_SERVICE structure and passing it to NtCreateFile.

Print a fixme in NtCreateFile if the SECURITY_QUALITY_OF_SERVICE
structure is specified, since it isn't handled yet.

---

 dlls/kernel32/file.c |   12 +++++++++++-
 dlls/ntdll/file.c    |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 5a0c5cb..f92d37a 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -1281,6 +1281,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filen
     static const WCHAR bkslashes_with_dotW[] = {'\\','\\','.','\\',0};
     static const WCHAR coninW[] = {'C','O','N','I','N','$',0};
     static const WCHAR conoutW[] = {'C','O','N','O','U','T','$',0};
+    SECURITY_QUALITY_OF_SERVICE qos;
 
     static const UINT nt_disposition[5] =
     {
@@ -1406,7 +1407,16 @@ HANDLE WINAPI CreateFileW( LPCWSTR filen
     attr.Attributes = OBJ_CASE_INSENSITIVE;
     attr.ObjectName = &nameW;
     attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
-    attr.SecurityQualityOfService = NULL;
+    if (attributes & SECURITY_SQOS_PRESENT)
+    {
+        qos.Length = sizeof(qos);
+        qos.ImpersonationLevel = (attributes >> 16) & 0x3;
+        qos.ContextTrackingMode = attributes & SECURITY_CONTEXT_TRACKING ? SECURITY_DYNAMIC_TRACKING : SECURITY_STATIC_TRACKING;
+        qos.EffectiveOnly = attributes & SECURITY_EFFECTIVE_ONLY ? TRUE : FALSE;
+        attr.SecurityQualityOfService = &qos;
+    }
+    else
+        attr.SecurityQualityOfService = NULL;
 
     if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT;
 
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index a79d227..a9b9142 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -162,6 +162,8 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
     if (attr->ObjectName->Length > sizeof(pipeW) &&
         !memicmpW( attr->ObjectName->Buffer, pipeW, sizeof(pipeW)/sizeof(WCHAR) ))
     {
+        if (attr->SecurityQualityOfService)
+            FIXME("SecurityQualityOfService ignored\n");
         SERVER_START_REQ( open_named_pipe )
         {
             req->access = access;
@@ -182,6 +184,8 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
     if (attr->ObjectName->Length > sizeof(mailslotW) &&
         !memicmpW( attr->ObjectName->Buffer, mailslotW, sizeof(mailslotW)/sizeof(WCHAR) ))
     {
+        if (attr->SecurityQualityOfService)
+            FIXME("SecurityQualityOfService ignored\n");
         SERVER_START_REQ( open_mailslot )
         {
             req->access = access & GENERIC_WRITE;




More information about the wine-cvs mailing list