EvtDeviceReportedMissing
EvtDeviceUsageNotificationEx
EvtDeviceWdmIrpDispatch
EvtDeviceWdmPostPoFxRegisterDevice
EvtDeviceWdmPrePoFxUnregisterDevice
WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WDF_DEVICE_PROPERTY_DATA
WDF_DEVICE_PROPERTY_DATA_INIT
WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS
WDF_EVENT_TYPE
WDF_IO_TYPE_CONFIG
WDF_IO_TYPE_CONFIG_INIT
WDF_POWER_FRAMEWORK_SETTINGS
WDF_POWER_FRAMEWORK_SETTINGS_INIT
WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
WDF_REMOVE_LOCK_OPTIONS
WDF_REMOVE_LOCK_OPTIONS_FLAGS
WDF_REMOVE_LOCK_OPTIONS_INIT
WdfDeviceAllocAndQueryInterfaceProperty method
WdfDeviceAllocAndQueryPropertyEx method
WdfDeviceAssignInterfaceProperty method
WdfDeviceAssignProperty method
WdfDeviceConfigureWdmIrpDispatchCallback method
WdfDeviceGetDeviceStackIoType method
WdfDeviceGetHardwareRegisterMappedAddress
WdfDeviceInitSetIoTypeEx method
WdfDeviceInitSetReleaseHardwareOrderOnFailure method
WdfDeviceInitSetRemoveLockOptions method
WdfDeviceMapIoSpace
WdfDeviceOpenDevicemapKey method
WdfDevicePostEvent
WdfDeviceQueryInterfaceProperty method
WdfDeviceQueryPropertyEx method
WdfDeviceReadFromHardware
WdfDeviceResumeIdleWithTag method
WdfDeviceStopIdleWithTag method
WdfDeviceUnmapIoSpace
WdfDeviceWdmAssignPowerFrameworkSettings method
WdfDeviceWdmDispatchIrp method
WdfDeviceWdmDispatchIrpToIoQueue method
WdfDeviceWriteToHardware
WdfFdoInitAllocAndQueryPropertyEx method
WdfFdoInitQueryPropertyEx method
展开 最小化

WdfDeviceCreateSymbolicLink 方法

The WdfDeviceCreateSymbolicLink method creates a symbolic link to a specified device.

语法

NTSTATUS WdfDeviceCreateSymbolicLink(
  [in]  WDFDEVICE Device,
  [in]  PCUNICODE_STRING SymbolicLinkName
);

参数

Device [in]

A handle to a framework device object.

SymbolicLinkName [in]

A pointer to a UNICODE_STRING structure that contains a user-visible name for the device.

返回值

If the operation succeeds, the WdfDeviceCreateSymbolicLink returns STATUS_SUCCCESS. Additional return values include:

返回代码说明
STATUS_INSUFFICIENT_RESOURCES

The system cannot allocate space to store the device name.

 

The method might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

评论

If a driver creates a symbolic link for a device, applications can use the symbolic link name to access the device. Typically, instead of providing symbolic links, framework-based drivers provide device interfaces that applications can use to access their devices.

If the device is removed unexpectedly (surprise-removed), the framework removes the symbolic link to the device. The driver can then use the symbolic link name for a new instance of the device.

示例

The following code example creates an MS-DOS device name that an application can use to access a device.

#define DOS_DEVICE_NAME  L"\\DosDevices\\MyDevice"
DECLARE_CONST_UNICODE_STRING(dosDeviceName, DOS_DEVICE_NAME);
NTSTATUS  status;

status = WdfDeviceCreateSymbolicLink(
                                     controlDevice,
                                     &dosDeviceName
                                     );
if (!NT_SUCCESS(status)) {
    goto Error;
}

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfdevice.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

PASSIVE_LEVEL

另请参见

UNICODE_STRING

 

 

社区附加资源

添加
显示:
© 2015 Microsoft