Here is the prototype:
NTSYSAPI
NTSTATUS
NTAPI
NtQueryObject(
IN HANDLE hObject,
IN OBJECT_INFO_CLASS ObjectInfoClass,
OUT PVOID Buffer,
IN ULONG BufferSize,
OUT PULONG BytesReturned
);
following are the defines for ObjectInfoClass and associated Buffers.
typedef enum _OBJECT_INFO_CLASS {
ObjectBasicInfo,
ObjectNameInfo,
ObjectTypeInfo,
ObjectAllTypesInfo,
ObjectProtectionInfo
} OBJECT_INFO_CLASS;
typedef struct ObjectBasicInfo_t {
char Unknown1[8];
ULONG HandleCount;
ULONG ReferenceCount;
ULONG PagedQuota;
ULONG NonPagedQuota;
char Unknown2[32];
} OBJECT_BASIC_INFO, *POBJECT_BASIC_INFO;
typedef struct ObjectNameInfo_t {
UNICODE_STRING ObjectName;
WCHAR ObjectNameBuffer[1];
} OBJECT_NAME_INFO, *POBJECT_NAME_INFO;
typedef struct ObjectTypeInfo_t {
UNICODE_STRING ObjectTypeName;
char Unknown[0x58];
WCHAR ObjectTypeNameBuffer[1];
} OBJECT_TYPE_INFO, *POBJECT_TYPE_INFO;
typedef struct ObjectAllTypeInfo_t {
ULONG NumberOfObjectTypes;
OBJECT_TYPE_INFO ObjectsTypeInfo[1];
} OBJECT_ALL_TYPES_INFO, *POBJECT_ALL_TYPES_INFO;
typedef struct ObjectProtectionInfo_t {
BOOLEAN bInherit;
BOOLEAN bProtectHandle;
} OBJECT_PROTECTION_INFO, *POBJECT_PROTECTION_INFO;
Prakash Bilodi
----- Original Message -----
From: Alexey V. Prokoptchuk
To: File Systems Developers
Sent: Wednesday, March 22, 2000 10:04 AM
Subject: [ntfsd] How to obtain a device type?
> Hi all
>
> Anybody knows how I can obtain information about device?
> For example - \Device\Harddisk0
>
> How I can know exactly that this device is a block device?
> I need to collect information about all valid block devices in Windows NT
> but I have too few information abou Native API. I have some prototypes of
> functions like NtOpenDirectoryObject(), NtQueryDirectoryObject etc. but
> these functions not gives me all information that I need.
> I found function NtQueryObject in NTDLL.DLL and I think that this function
> probably can help me but I havenât its prototype.
>
> Thanks in advance
>
>
>
> Best regards, Alex Pro (Alexey Prokoptchuk),
> System Administrator
> Contact phone - +380-6452 99622
> ICQ - 17815755
>
>
>
> â
> You are currently subscribed to ntfsd as: xxxxx@interactivesi.com
> To unsubscribe send a blank email to $subst(âEmail.Unsubâ)
>
>