当前位置: 首页>>代码示例>>C++>>正文


C++ IoDeleteSymbolicLink函数代码示例

本文整理汇总了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"));
}
开发者ID:cutepig123,项目名称:GeneralUtility,代码行数:19,代码来源:Driver.cpp

示例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);
}
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:19,代码来源:interface.c

示例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;
}
开发者ID:Retord,项目名称:Blackbone,代码行数:19,代码来源:BlackBoneDrv.c

示例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;
}
开发者ID:KnowNo,项目名称:DTrace-win32,代码行数:43,代码来源:driver.c

示例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);
    }
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:42,代码来源:parvdm.c

示例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;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:42,代码来源:devname.c

示例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;
	}
}
开发者ID:vrichomme,项目名称:posix4msvc,代码行数:42,代码来源:nt_fileio.c

示例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); 
} 
开发者ID:RussianPenguin,项目名称:samples,代码行数:21,代码来源:driver.c

示例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"));
}
开发者ID:340211173,项目名称:hf-2011,代码行数:23,代码来源:XFilter.c

示例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");
}
开发者ID:Jonimoose,项目名称:tilp-libticables,代码行数:23,代码来源:rwports.c

示例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");
}
开发者ID:ChengChengCC,项目名称:Ark-tools,代码行数:20,代码来源:DpcTimerDrv.c

示例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);
}
开发者ID:ChCyrill,项目名称:BSUIR_labs,代码行数:23,代码来源:drvtest.c

示例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;
    }
}
开发者ID:sundiyone,项目名称:virtual-disk,代码行数:20,代码来源:awealloc.c

示例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("卸载成功");
}
开发者ID:bittoy,项目名称:driver-leaning,代码行数:41,代码来源:mini_ddk.cpp

示例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;
}
开发者ID:DieBagger,项目名称:MediaPortal-2,代码行数:41,代码来源:dokan.c


注:本文中的IoDeleteSymbolicLink函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。