Hi all ‘smart’ guys !
I’ve try to get of the LanmanRedirector device object by call ObReferenceObjectByName.
My sake is getting device object of it and attach with netware drives.
The my code was looked at next manner:
WCHAR wszLinkPath = L"\Device\LanmanRedirector";
UNICODE_STRING szLinkPath;
PDRIVER_OBJECT lpDriverObject;
PDEVICE_OBJECT lpDeviceObject;
NTSTATUS Status;
RtlInitUnicodeString(&szLinkPath,wszLinkPath);
InitializeObjectAttributes( &ObjectAttributes,&szLinkPath,OBJ_CASE_INSENSITIVE,
NULL,NULL);
ObReferenceObjectByName(&szLinkPath, OBJ_CASE_INSENSITIVE, NULL, 0,
*IoDeviceObjectType, KernelMode, NULL, &lpDeviceObject);
The last of call always returns 0xC0000024L = STATUS_OBJECT_TYPE_MISMATCH
Changing of lpDeviceObject to lpDriverObject and of IoDeviceObjectType to IoDriverObjectType
was bring same result.
Do anybody can say to me, which POBJECT_TYPE i must use for mentioned call for succesfull
implement of attaching with netware drives. Waiting until Of oser Process context does occured
is unacceptable.