From 8132707bce02a70dab50062d7f038380ed885179 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Fri, 19 Jan 2007 07:00:29 -0600 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 5a0c5cb1d6a..f92d37ad95e 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1281,6 +1281,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, 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 filename, DWORD access, DWORD sharing, 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 a79d227f5b6..a9b91428707 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -162,6 +162,8 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATTRIB 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 handle, ACCESS_MASK access, POBJECT_ATTRIB 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;