阅读:4214回复:7
IoCreateDevice(....) 的问题???(急)
在NDIS中间层驱动程序中到底能不能用IoCreateDevice(..)函数啊?
各位大虾指点一下,谢谢了!!! |
|
沙发#
发布于:2003-05-04 15:02
应该可以吧,我是新手。。。呵呵。。
|
|
板凳#
发布于:2003-05-05 11:01
在NDIS层不行,需用ndis.h中的函数NdisMRegisterDevice,这个问题讨论过无数遍了
|
|
地板#
发布于:2003-05-06 15:37
看看这个。
|
|
|
地下室#
发布于:2003-05-06 18:08
2003-05-06_w2k下的PassThru和用户态交互修改说明.doc
不能下啊? |
|
5楼#
发布于:2003-05-07 10:26
你看看主页上关于下载的修改配置说明,下载需要修改IE的Internet选项。我试了,可以下的。 :)
|
|
|
6楼#
发布于:2009-03-05 09:09
搜了点资料,也看不懂,希望有用,达人看一下吧
DDK的IoCreateDevice函数 IoCreateDevice The IoCreateDevice routine creates a device object for use by a driver. NTSTATUS IoCreateDevice( IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName OPTIONAL, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject ); Parameters DriverObject Pointer to the driver object for the caller. Each driver receives a pointer to its driver object in a parameter to its DriverEntry routine. WDM function and filter drivers also receive a driver object pointer in their AddDevice routines. DeviceExtensionSize Specifies the driver-determined number of bytes to be allocated for the device extension of the device object. The internal structure of the device extension is driver-defined. For more information about device extensions, see Device Extensions. DeviceName Optionally points to a buffer containing a zero-terminated Unicode string that names the device object. The string must be a full path name. WDM filter and function drivers do not name their device objects. For more information, see Named Device Objects. DeviceType Specifies one of the system-defined FILE_DEVICE_XXX constants that indicate the type of device (such as FILE_DEVICE_DISK, FILE_DEVICE_KEYBOARD, etc.) or a vendor-defined value for a new type of device. For more information, see Specifying Device Types. DeviceCharacteristics Specifies one or more system-defined constants, ORed together, that provide additional information about the driver's device. For a list of possible device characteristics, see DEVICE_OBJECT. For more information on how to specify device characteristics, see Specifying Device Characteristics. Most drivers specify FILE_DEVICE_SECURE_OPEN for this parameter. Exclusive Reserved for system use. Drivers set this parameter to FALSE. DeviceObject Pointer to a variable that receives a pointer to the newly created DEVICE_OBJECT structure. The DEVICE_OBJECT structure is allocated from nonpaged pool. Return Value IoCreateDevice returns STATUS_SUCCESS on success, or the appropriate NTSTATUS error code on failure. A partial list of the failure codes returned by this function include: STATUS_INSUFFICIENT_RESOURCES STATUS_OBJECT_NAME_EXISTS STATUS_OBJECT_NAME_COLLISION Headers Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h. Comments IoCreateDevice creates a device object and returns a pointer to the object. The caller is responsible for deleting the object when it is no longer needed by calling IoDeleteDevice. IoCreateDevice can only be used to create an unnamed device object, or a named device object for which a security descriptor is set by an INF file. Otherwise, drivers must use IoCreateDeviceSecure to create named device objects. For more information, see Creating a Device Object. The caller is responsible for setting certain members of the returned device object. For more information, see Initializing a Device Object and the device-type-specific documentation for your device. Be careful to specify the DeviceType and DeviceCharacteristics values in the correct parameters. Both parameters use system-defined FILE_XXX constants and some driver writers specify the values in the wrong parameters by mistake. Device objects for disks, tapes, CD-ROMs, and RAM disks are given a Volume Parameter Block (VPB) that is initialized to indicate that the volume has never been mounted on the device. If a driver's call to IoCreateDevice returns an error, the driver should release any resources that it allocated for that device. Callers of IoCreateDevice must be running at IRQL < DISPATCH_LEVEL. |
|
7楼#
发布于:2010-02-08 10:47
NDIS miniport and intermediate drivers should never call IoCreateDevice or IoCreateSymbolicLink. Instead, if an NDIS driver must create a device object, it should call NdisMRegisterDevice. Miniport and intermediate drivers should never attempt to stack the device object over the physical device object by calling IoAttachDevice.
ndis小端口和中间层驱动都不能使用IoCreateDevice和IoCreateSymbolicLink,而且最好也不要在近一层试图用IoAttachDevice来做IRP级别过滤,这些都是WIN不允许的。 |
|