mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 14:09:29 +02:00

* fix DirectoryExists which didn't yet work without System privileges * fix FileExists which didn't use the correct access flags + implement FindFirst/FindNext/FindClose which is conceptually based on the Find-mechanism of the Unix RTL as for the object hierarchy I can't use the same mechanism that Windows provides for filesystems (the function NtQueryDirectoryFile provides the possibility to pass a pattern, but I'm not using that functionality; maybe I'll update FindNext in the future to use this for speed up...). Note: The PChar "workaround" is needed, because string reallocation does currently not work... (maybe Reallocmem is buggy) - remove FindMatch which is only provided by Windows SysUtils and DOS units + add functions/constants/types which are used by Find* to the NDK includes - remove "packed" from file information types (Windows 7 didn't like the size otherwise) git-svn-id: trunk@21438 -
48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
{%MainUnit ndk.pas}
|
|
{
|
|
Native Development Kit for Native NT
|
|
|
|
This file is part of the Free Pascal run time library.
|
|
This unit contains functions for use with the Object Manager.
|
|
Copyright (c) 2010 by Sven Barth
|
|
|
|
See the file COPYING.FPC, included in this distribution,
|
|
for details about the copyright.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
**********************************************************************}
|
|
|
|
function NtOpenDirectoryObject(
|
|
FileHandle: PHANDLE;
|
|
DesiredAccess: ACCESS_MASK;
|
|
ObjectAttributes: POBJECT_ATTRIBUTES
|
|
): NTSTATUS; external ntdll;
|
|
|
|
function NtQueryDirectoryObject(
|
|
DirectoryHandle: HANDLE;
|
|
Buffer: PVOID;
|
|
BufferLength: ULONG;
|
|
ReturnSingleEntry: NT_BOOLEAN;
|
|
RestartScan: NT_BOOLEAN;
|
|
Context: PULONG;
|
|
ReturnLength: PULONG {OPTIONAL}
|
|
): NTSTATUS; external ntdll;
|
|
|
|
function NtQueryObject(
|
|
ObjectHandle: HANDLE;
|
|
ObjectInformationClass: OBJECT_INFORMATION_CLASS;
|
|
ObjectInformation: PVOID;
|
|
Length: ULONG;
|
|
ResultLength: PULONG {OPTIONAL}
|
|
): NTSTATUS; external ntdll;
|
|
|
|
function NtWaitForSingleObject(
|
|
_Object: HANDLE;
|
|
Alertable: NT_BOOLEAN;
|
|
Time: PLARGE_INTEGER
|
|
): NTSTATUS; external ntdll;
|
|
|