#ifndef _NTPSAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
* The _PROCESS_DEVICEMAP_INFORMATION_EX structure contains information about a process's device map.
*/
typedef struct _PROCESS_DEVICEMAP_INFORMATION_EX
{
union
{
struct
{
HANDLE DirectoryHandle; // A handle to a directory object that can be set as the new device map for the process. This handle must have DIRECTORY_TRAVERSE access.
} Set;
struct
{
ULONG DriveMap; // A bitmask that indicates which drive letters are currently in use in the process's device map.
UCHAR DriveType[32]; // A value that indicates the type of each drive (e.g., local disk, network drive, etc.). // DRIVE_* WinBase.h
} Query;
};
ULONG Flags; // PROCESS_LUID_DOSDEVICES_ONLY
} PROCESS_DEVICEMAP_INFORMATION_EX, *PPROCESS_DEVICEMAP_INFORMATION_EX;
View code on GitHub
This structure defines information about the process's DOS Devices map.
NtQueryInformationProcess
with ProcessDeviceMap
(23)NtSetInformationProcess
with ProcessDeviceMap
(23)A handle to a directory object to set as the new device map for the process. The handle must grant DIRECTORY_TRAVERSE
access.
A bit mask defining which drive letters are currently in use in the process's device map. Bit 0 corresponds to A:
, bit 1 to B:
, and so on.
An array where each element defines the type of the drive associated with the specified letter. The value is meaningful only when the corresponding bit is set in the DriveMap
field.
The possible values are defined in SDK in WinBase.h
:
DRIVE_UNKNOWN
(0) - the type of the drive is unknown.DRIVE_NO_ROOT_DIR
(1) - the letter points to a directory on another drive.DRIVE_REMOVABLE
(2) - the drive is a removable media.DRIVE_FIXED
(3) - the drive is a fixed disk.DRIVE_REMOTE
(4) - the drive is a remote device.DRIVE_CDROM
(5) - the drive is a CD-ROM.DRIVE_RAMDISK
(6) - the drive is a RAM disk.A bit mask of flags that control the operation.
PROCESS_LUID_DOSDEVICES_ONLY
- perform a query only for devices defined for the current process or logon session, ignoring entries from the global DOS Devices directory.