Author: greatlrd Date: Thu Apr 20 08:36:18 2006 New Revision: 21670
URL: http://svn.reactos.ru/svn/reactos?rev=21670&view=rev Log: bug 1346 : patch from w3seek : Support SE_FILE_OBJECT in GetNamedSecurityInfo
Modified: trunk/reactos/dll/win32/ntmarta/ntmarta.c (contents, props changed) trunk/reactos/dll/win32/ntmarta/ntmarta.def (props changed) trunk/reactos/dll/win32/ntmarta/ntmarta.h (props changed) trunk/reactos/dll/win32/ntmarta/ntmarta.rc (props changed)
Modified: trunk/reactos/dll/win32/ntmarta/ntmarta.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/ntmarta/ntmarta.c?... ============================================================================== --- trunk/reactos/dll/win32/ntmarta/ntmarta.c (original) +++ trunk/reactos/dll/win32/ntmarta/ntmarta.c Thu Apr 20 08:36:18 2006 @@ -437,6 +437,7 @@ BOOL Write) { LPWSTR lpPath; + NTSTATUS Status; ACCESS_MASK DesiredAccess = (ACCESS_MASK)0; DWORD Ret = ERROR_SUCCESS;
@@ -496,6 +497,45 @@ /* open a handle to the path depending on the object type */ switch (ObjectType) { + case SE_FILE_OBJECT: + { + IO_STATUS_BLOCK IoStatusBlock; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING FileName; + + if (!RtlDosPathNameToNtPathName_U(pObjectName, + &FileName, + NULL, + NULL)) + { + Ret = ERROR_INVALID_NAME; + goto Cleanup; + } + + InitializeObjectAttributes(&ObjectAttributes, + &FileName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtOpenFile(Handle, + DesiredAccess, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT); + + RtlFreeHeap(RtlGetProcessHeap(), + 0, + FileName.Buffer); + + if (!NT_SUCCESS(Status)) + { + Ret = RtlNtStatusToDosError(Status); + } + break; + } + case SE_REGISTRY_KEY: { static const struct @@ -679,6 +719,9 @@ break;
case SE_FILE_OBJECT: + NtClose(Handle); + break; + case SE_KERNEL_OBJECT: case SE_WINDOW_OBJECT: CloseHandle(Handle);
Propchange: trunk/reactos/dll/win32/ntmarta/ntmarta.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
Propchange: trunk/reactos/dll/win32/ntmarta/ntmarta.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
Propchange: trunk/reactos/dll/win32/ntmarta/ntmarta.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
Propchange: trunk/reactos/dll/win32/ntmarta/ntmarta.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*