本文整理汇总了C++中IoDeleteSymbolicLink函数的典型用法代码示例。如果您正苦于以下问题:C++ IoDeleteSymbolicLink函数的具体用法?C++ IoDeleteSymbolicLink怎么用?C++ IoDeleteSymbolicLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IoDeleteSymbolicLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HelloDDKUnload
VOID HelloDDKUnload (IN PDRIVER_OBJECT pDriverObject)
{
PDEVICE_OBJECT pNextObj;
KdPrint(("DriverB:Enter B DriverUnload\n"));
pNextObj = pDriverObject->DeviceObject;
while (pNextObj != NULL)
{
PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)
pNextObj->DeviceExtension;
//删除符号链接
UNICODE_STRING pLinkName = pDevExt->ustrSymLinkName;
IoDeleteSymbolicLink(&pLinkName);
pNextObj = pNextObj->NextDevice;
IoDeleteDevice( pDevExt->pDevice );
}
KdPrint(("DriverB:Enter B DriverUnload\n"));
}
示例2: driver_unload
static
VOID
NTAPI
driver_unload(IN PDRIVER_OBJECT DriverObject)
{
WCHAR deviceLinkBuffer[] = L"\\DosDevices\\"CO_DRIVER_NAME;
UNICODE_STRING deviceLinkUnicodeString;
co_manager_t *manager;
manager = DriverObject->DeviceObject->DeviceExtension;
if (manager) {
co_manager_unload(manager);
}
RtlInitUnicodeString(&deviceLinkUnicodeString, deviceLinkBuffer);
IoDeleteSymbolicLink(&deviceLinkUnicodeString);
IoDeleteDevice(DriverObject->DeviceObject);
}
示例3: BBUnload
VOID BBUnload( IN PDRIVER_OBJECT DriverObject )
{
UNICODE_STRING deviceLinkUnicodeString;
// Unregister notification
PsSetCreateProcessNotifyRoutine( BBProcessNotify, TRUE );
// Cleanup physical regions
BBCleanupProcessPhysList();
// Cleanup process mapping info
BBCleanupProcessTable();
RtlUnicodeStringInit( &deviceLinkUnicodeString, DOS_DEVICE_NAME );
IoDeleteSymbolicLink( &deviceLinkUnicodeString );
IoDeleteDevice( DriverObject->DeviceObject );
return;
}
示例4: DriverEntry
NTSTATUS DriverEntry(PDRIVER_OBJECT DrvObj, PUNICODE_STRING RegPath)
{
PDEVICE_OBJECT DevObj;
NTSTATUS status;
status = IoCreateDevice(DrvObj, 0, &deviceName, FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN,
FALSE, &DevObj);
if(NT_SUCCESS(status)) {
status = IoCreateSymbolicLink (&deviceLink, &deviceName);
DrvObj->MajorFunction[IRP_MJ_CREATE] = DtraceOpen;
DrvObj->MajorFunction[IRP_MJ_CLOSE] = DtraceClose;
DrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DtraceIoctl;
DrvObj->DriverUnload = DtraceUnload;
}
if (!NT_SUCCESS(status)) {
IoDeleteSymbolicLink(&deviceLink);
if(DevObj)
IoDeleteDevice( DevObj);
return status;
}
status = IoCreateSymbolicLink(&deviceHelperLink, &deviceName);
if (!NT_SUCCESS(status))
dprintf("DriverEntry: dtrace helper creation failed\n");
DtraceGetSystemHertz();
DtraceWinOSKernelModuleInfo();
DtraceWinOSInitFunctions();
if (DtraceWinOSHackData() == 0)
dprintf("DriverEntry: DtraceWinOSPortData() hack data failure\n");
if (PsSetLoadImageNotifyRoutine(ProcKernelModuleLoaded) != STATUS_SUCCESS)
dprintf("DriverEntry: failed to register PsSetLoadImageNotifyRoutine\n");
WorkItem1 = IoAllocateWorkItem(DevObj);
WorkItem2 = IoAllocateWorkItem(DevObj);
int_morecore();
(void) dtrace_load((void *) RegPath);
return status;
}
示例5: ParUnload
VOID
ParUnload(
IN PDRIVER_OBJECT DriverObject
)
/*++
Routine Description:
This routine loops through the device list and cleans up after
each of the devices.
Arguments:
DriverObject - Supplies the driver object.
Return Value:
None.
--*/
{
PDEVICE_OBJECT currentDevice;
PDEVICE_EXTENSION extension;
KEVENT event;
PARALLEL_INTERRUPT_SERVICE_ROUTINE interruptService;
PIRP irp;
IO_STATUS_BLOCK ioStatus;
while (currentDevice = DriverObject->DeviceObject) {
extension = currentDevice->DeviceExtension;
if (extension->CreatedSymbolicLink) {
IoDeleteSymbolicLink(&extension->SymbolicLinkName);
ExFreePool(extension->SymbolicLinkName.Buffer);
}
IoDeleteDevice(currentDevice);
}
}
示例6: DestroySoundDevice
NTSTATUS
DestroySoundDevice(
IN PDEVICE_OBJECT DeviceObject,
IN PCWSTR WideDosDeviceName,
IN UCHAR Index)
{
NTSTATUS Status;
UNICODE_STRING DosDeviceName;
/* Check for NULL parameters */
if ( ( ! WideDosDeviceName ) || ( ! DeviceObject ) )
{
DPRINT("Unexpected NULL parameter");
return STATUS_INVALID_PARAMETER;
}
/* Range-check */
if ( Index >= SOUND_MAX_DEVICES )
{
DPRINT("Device %d exceeds maximum", Index);
return STATUS_INVALID_PARAMETER;
}
Status = ConstructDeviceName(WideDosDeviceName, Index, &DosDeviceName);
if ( ! NT_SUCCESS(Status) )
{
return Status;
}
DPRINT("Deleting symlink %ws\n", DosDeviceName.Buffer);
Status = IoDeleteSymbolicLink(&DosDeviceName);
DPRINT("Status of symlink deletion is 0x%08x\n", Status);
/*
ASSERT(NT_SUCCESS(Status));
*/
IoDeleteDevice(DeviceObject);
return STATUS_SUCCESS;
}
示例7: XMountDrive
int XMountDrive(char driveLetter, char *directoryName)
{
#ifdef DEBUG
debugPrint("XMountDrive driveLetter=%c directoryName=%s\n", driveLetter, directoryName);
#endif
ANSI_STRING drive, device;
char driveBuffer[10];
sprintf(driveBuffer, "\\??\\%c:", driveLetter);
char *deviceBuffer;
// we allocate some memory here that never gets deallocated. Hopefully
// that won't be a problem because it only small and shouldn't happen often
deviceBuffer = (char *)malloc(200);
int rc = XConvertDOSFilenameToXBOX(directoryName, deviceBuffer);
if (rc != STATUS_SUCCESS)
return rc;
// we need to make sure it has a trailing slash
int len = strlen(deviceBuffer);
if (deviceBuffer[len-1] != '\\')
{
deviceBuffer[len] = '\\';
deviceBuffer[len+1] = 0;
}
RtlInitAnsiString(&drive, driveBuffer);
RtlInitAnsiString(&device, deviceBuffer);
IoDeleteSymbolicLink(&drive);
NTSTATUS status = IoCreateSymbolicLink(&drive, &device);
if (!NT_SUCCESS(status))
return RtlNtStatusToDosError(status);
else
{
setPartitionString(driveLetter, deviceBuffer);
return STATUS_SUCCESS;
}
}
示例8: DriverUnload
//-------------------------------------------------------------------------------------------------------------------
VOID DriverUnload(IN PDRIVER_OBJECT DriverObject)
{
UNICODE_STRING deviceLinkUnicodeString;
PDEVICE_EXTENSION extension;
PIRP pNewIrp = NULL;
ULONG m_size;
NTSTATUS ntStatus;
extension = DriverObject->DeviceObject->DeviceExtension;
// Create counted string version of our Win32 device name.
RtlInitUnicodeString(&deviceLinkUnicodeString, DOS_DEVICE_NAME);
// Delete the link from our device name to a name in the Win32 namespace.
IoDeleteSymbolicLink(&deviceLinkUnicodeString);
// Finally delete our device object
IoDeleteDevice(DriverObject->DeviceObject);
}
示例9: XFilter_Delete
//
// 删除一个设备
//
VOID
XFilter_Delete(
IN PDEVICE_OBJECT pDeviceObject
)
{
PXPACKET_DEVICE_EXTENSION pDeviceExtension;
UNICODE_STRING SymbolicLinkName;
pDeviceExtension = (PXPACKET_DEVICE_EXTENSION)pDeviceObject->DeviceExtension;
RtlInitUnicodeString(&SymbolicLinkName, XPACKET_XFILTER_DOS_DEVICE_NAME);
IoDeleteSymbolicLink( &SymbolicLinkName );
pDeviceExtension->ulNodeType = 0;
pDeviceExtension->ulNodeSize = 0;
IoDeleteDevice( pDeviceObject );
dprintf(("XFilter_Delete Success\n"));
}
示例10: RwPortsUnload
//
// Delete the associated device and return
//
static STDCALL void RwPortsUnload(IN PDRIVER_OBJECT DriverObject)
{
UNICODE_STRING DeviceLinkUnicodeString;
NTSTATUS ntStatus=STATUS_SUCCESS;
OutputDebugString ("rwports: entering RwPortsUnload");
OutputDebugString ("rwports: unmapping remaining memory");
RtlInitUnicodeString (&DeviceLinkUnicodeString, L"\\DosDevices\\rwports");
ntStatus = IoDeleteSymbolicLink (&DeviceLinkUnicodeString);
if (NT_SUCCESS(ntStatus))
{
IoDeleteDevice (DriverObject->DeviceObject);
}
else
{
OutputDebugString ("rwports: IoDeleteSymbolicLink failed");
}
OutputDebugString ("rwports: leaving RwPortsUnload");
}
示例11: UnloadDriver
VOID UnloadDriver(PDRIVER_OBJECT DriverObject)
{
UNICODE_STRING uniLinkName;
PDEVICE_OBJECT CurrentDeviceObject;
PDEVICE_OBJECT NextDeviceObject;
RtlInitUnicodeString(&uniLinkName,LINK_NAME);
IoDeleteSymbolicLink(&uniLinkName);
if (DriverObject->DeviceObject!=NULL)
{
CurrentDeviceObject = DriverObject->DeviceObject;
while(CurrentDeviceObject!=NULL)
{
NextDeviceObject = CurrentDeviceObject->NextDevice;
IoDeleteDevice(CurrentDeviceObject);
CurrentDeviceObject = NextDeviceObject;
}
}
DbgPrint("UnloadDriver\r\n");
}
示例12: my_unload
/******************************************************************************
* Driver unload handler *
******************************************************************************/
static VOID DDKAPI
my_unload(PDRIVER_OBJECT DriverObject)
{
ANSI_STRING SymbolicLinkNameA;
UNICODE_STRING SymbolicLinkNameW;
DbgPrint("DriverUnload called\r\n");
PsSetCreateProcessNotifyRoutine(create_process_watcher, TRUE);
PsRemoveLoadImageNotifyRoutine(load_image_watcher);
RtlInitString(&SymbolicLinkNameA, MY_DOSDEVICE_NAME);
RtlAnsiStringToUnicodeString(&SymbolicLinkNameW, &SymbolicLinkNameA, TRUE);
IoDeleteSymbolicLink(&SymbolicLinkNameW);
IoDeleteDevice(DriverObject->DeviceObject);
for (int i = 0; i < ENT_CNT; ++i)
if(g_proc_table[i].pid)
DbgPrint("Registered process stays: %d\r\n", g_proc_table[i].pid);
}
示例13: AWEAllocUnload
VOID
AWEAllocUnload(IN PDRIVER_OBJECT DriverObject)
{
PDEVICE_OBJECT device_object = DriverObject->DeviceObject;
UNICODE_STRING sym_link;
KdPrint(("AWEAlloc: Unload.\n"));
PAGED_CODE();
RtlInitUnicodeString(&sym_link, AWEALLOC_SYMLINK_NAME);
IoDeleteSymbolicLink(&sym_link);
while (device_object != NULL)
{
PDEVICE_OBJECT next_device = device_object->NextDevice;
IoDeleteDevice(device_object);
device_object = next_device;
}
}
示例14: DDK_Unload
VOID DDK_Unload (IN PDRIVER_OBJECT pDriverObject)
{
PDEVICE_OBJECT pDev;//用来取得要删除设备对象
UNICODE_STRING symLinkName; //
UnHook();
if (ishook)
{//unhook
__asm //去掉页面保护
{
cli
mov eax,cr0
and eax,not 10000h //and eax,0FFFEFFFFh
mov cr0,eax
}
pcur->E9= oldCode.E9;//1字节
pcur->JMPADDR= oldCode.JMPADDR;//4字节
__asm //恢复页保护
{
mov eax,cr0
or eax,10000h //or eax,not 0FFFEFFFFh
mov cr0,eax
sti
}
} //end unhook
pDev=pDriverObject->DeviceObject;
IoDeleteDevice(pDev); //删除设备
//取符号链接名字
RtlInitUnicodeString(&symLinkName,L"\\??\\My_DriverLinkName");
//删除符号链接
IoDeleteSymbolicLink(&symLinkName);
KdPrint(("驱动成功被卸载...OK-----------")); //sprintf,printf
//取得要删除设备对象
//删掉所有设备
DbgPrint("卸载成功");
}
示例15: DokanUnload
VOID
DokanUnload(
__in PDRIVER_OBJECT DriverObject
)
/*++
Routine Description:
This routine gets called to remove the driver from the system.
Arguments:
DriverObject - the system supplied driver object.
Return Value:
NTSTATUS
--*/
{
PDEVICE_OBJECT deviceObject = DriverObject->DeviceObject;
WCHAR symbolicLinkBuf[] = DOKAN_GLOBAL_SYMBOLIC_LINK_NAME;
UNICODE_STRING symbolicLinkName;
PAGED_CODE();
DDbgPrint("==> DokanUnload\n");
if (GetIdentifierType(deviceObject->DeviceExtension) == DGL) {
DDbgPrint(" Delete Global DeviceObject\n");
RtlInitUnicodeString(&symbolicLinkName, symbolicLinkBuf);
IoDeleteSymbolicLink(&symbolicLinkName);
IoDeleteDevice(deviceObject);
}
ExDeleteNPagedLookasideList(&DokanIrpEntryLookasideList);
DDbgPrint("<== DokanUnload\n");
return;
}