-
-
IoCreateSymbolicLink失败,请教原因
-
发表于:
2011-4-2 18:23
7769
-
IoCreateSymbolicLink失败,请教原因
NTSTATUS status;
PDEVICE_OBJECT device = NULL;
UNICODE_STRING device_name = RTL_CONSTANT_STRING(L"\\Device\\MyCDO");
UNICODE_STRING symb_link = RTL_CONSTANT_STRING(L"\\DosDevices\\MyCDOSL");
status = IoCreateDevice(
DriverObject,
NULL,
&device_name,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&device);
if (!NT_SUCCESS(status))
{
KdPrint(("Create MyCDO Device Object failed\n"));
return (status);
}
KdPrint(("Create MyCDO Device Object success\n"));
status =
IoCreateSymbolicLink(&symb_link,&device_name);
if (!NT_SUCCESS(status))
{
KdPrint(("create the Device Object link failed\n"));
IoDeleteDevice(device);
return (status);
}
KdPrint(("Create the Device Object link success\n"));
device->Flags &= ~DO_DEVICE_INITIALIZING;
return status;
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)