mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added PhQueryFullAttributesFileWin32
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5282 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -1375,6 +1375,12 @@ NTSTATUS PhCreateFileWin32Ex(
|
||||
__out_opt PULONG CreateStatus
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
NTSTATUS PhQueryFullAttributesFileWin32(
|
||||
__in PWSTR FileName,
|
||||
__out PFILE_NETWORK_OPEN_INFORMATION FileInformation
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
NTSTATUS PhDeleteFileWin32(
|
||||
__in PWSTR FileName
|
||||
|
||||
@@ -189,6 +189,43 @@ NTSTATUS PhCreateFileWin32Ex(
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries file attributes.
|
||||
*
|
||||
* \param FileName The Win32 file name.
|
||||
* \param FileInformation A variable that receives the file information.
|
||||
*/
|
||||
NTSTATUS PhQueryFullAttributesFileWin32(
|
||||
__in PWSTR FileName,
|
||||
__out PFILE_NETWORK_OPEN_INFORMATION FileInformation
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
UNICODE_STRING fileName;
|
||||
OBJECT_ATTRIBUTES oa;
|
||||
|
||||
if (!RtlDosPathNameToNtPathName_U(
|
||||
FileName,
|
||||
&fileName,
|
||||
NULL,
|
||||
NULL
|
||||
))
|
||||
return STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
|
||||
InitializeObjectAttributes(
|
||||
&oa,
|
||||
&fileName,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
|
||||
status = NtQueryFullAttributesFile(&oa, FileInformation);
|
||||
RtlFreeHeap(RtlProcessHeap(), 0, fileName.Buffer);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a file.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user