wwyyxx26
驱动牛犊
驱动牛犊
  • 注册日期2009-01-12
  • 最后登录2010-04-21
  • 粉丝0
  • 关注0
  • 积分11分
  • 威望101点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2033回复:2

新手,安装好驱动后,在将其卸载,再安装,win32应用程序里createfile就不行了

楼主#
更多 发布于:2010-03-24 16:00
我写了一个驱动,和win32应用程序,
安装好驱动后,在将其卸载,再安装,win32应用程序里createfile就不行了

DriverEntry部分是:

extern "C" NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING RegistryPath)
{
    KdPrint(("wyx Enter DriverEntry\n"));
    pDriverObject->DriverExtension->AddDevice = HelloWDMAddDevice;     //DriverExtension是固定定义的,还有DeviceExtension是自己定义的

    pDriverObject->MajorFunction[IRP_MJ_PNP]=HelloWDMPnp;
    pDriverObject->MajorFunction[IRP_MJ_CREATE]=HelloWDMCreateFile;
    pDriverObject->MajorFunction[IRP_MJ_CLOSE]=HelloWDMCloseFile;//
    pDriverObject->MajorFunction[IRP_MJ_READ]=HelloWDMReadFile;//
    pDriverObject->MajorFunction[IRP_MJ_WRITE]=HelloWDMWriteFile;
    pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]=HelloWDMIOControl;//HelloWDMDispatchRoutine

    pDriverObject->DriverUnload = HelloWDMUnload;
    KdPrint(("wyx Leave DriverEntry\n"));
    return STATUS_SUCCESS;
}



inf文件是:
;--------- Version Section ---------------------------------------------------

[Version]
Signature="$CHICAGO$";
Provider=wyx
DriverVer=11/1/2007,3.0.0.3

; If device fits one of the standard classes, use the name and GUID here,
; otherwise create your own device class and GUID as this example shows.

Class=wwyyDevice
ClassGUID={EF2962F0-0D55-4bff-B8AA-2221EE8A79B0}


;--------- SourceDiskNames and SourceDiskFiles Section -----------------------

; These sections identify source disks and files for installation. They are
; shown here as an example, but commented out.

[SourceDisksNames]
1 = "HellowyxWDM",Disk1,,

[SourceDisksFiles]
wwyyHelloWDM.sys = 1,Debug,

;--------- ClassInstall/ClassInstall32 Section -------------------------------

; Not necessary if using a standard class

; 9X Style
[ClassInstall]
Addreg=Class_AddReg

; NT Style
[ClassInstall32]
Addreg=Class_AddReg

[Class_AddReg]
HKR,,,,%DeviceClassName%
HKR,,Icon,,"-3"

;--------- DestinationDirs Section -------------------------------------------

[DestinationDirs]
YouMark_Files_Driver = 10,System32\Drivers

;--------- Manufacturer and Models Sections ----------------------------------

[Manufacturer]
%MfgName%=Mfg0

[Mfg0]
%DeviceDesc%=YouMark_DDI, USB\VEN_9990&DEV_9991

; --------- Windows NT -----------------

[YouMark_DDI.NT]
CopyFiles=YouMark_Files_Driver
AddReg=YouMark_NT_AddReg

[YouMark_DDI.NT.Services]
Addservice = wwHelloWDM, 0x00000002, YouMark_AddService

[YouMark_AddService]
DisplayName = %SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\wwyyHelloWDM.sys

[YouMark_NT_AddReg]
HKLM, "System\CurrentControlSet\Services\wwHelloWDM\Parameters",\
"BreakOnEntry", 0x00010001, 0


; --------- Files (common) -------------

[YouMark_Files_Driver]
wwyyHelloWDM.sys

;--------- Strings Section ---------------------------------------------------

[Strings]
ProviderName="wyxx"
MfgName="wyx Soft"
DeviceDesc="Hello World WDM!"
DeviceClassName="wyx_Device"
SvcDesc="WYX"




能看出问题不???


wwyyxx26
驱动牛犊
驱动牛犊
  • 注册日期2009-01-12
  • 最后登录2010-04-21
  • 粉丝0
  • 关注0
  • 积分11分
  • 威望101点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2010-03-25 09:29
已找到问题
moran2004
驱动牛犊
驱动牛犊
  • 注册日期2009-07-03
  • 最后登录2010-06-17
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望101点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2010-05-27 10:15
我也遇到该问题,你共享您的解决方案吗?
游客

返回顶部