"Hello World"만 디버그에 인쇄하는 간단한 드라이버를 작성했습니다. 나는 빈 드라이버 프로젝트를 생성하기 위해 WDK 8 비주얼 스튜디오 2012 RC를 사용하고 follwing을 코드 작성 :드라이버 설치 및 실행 방법
#include <NTDDK.h>
extern "C" NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath)
{
pRegistryPath = pRegistryPath; //unused
DbgPrint("Hello World!");
pDriverObject->DriverUnload = NULL;
return STATUS_SUCCESS;
}
내가 WIN7 64에 컴파일 된 적이 있습니다. 이 드라이버를 설치하고 실행하기 위해서는 .inf 파일을 작성해야하지만, 나는 그것을 조정할 수는 없다고 읽었습니다. WDK 8에서 예제 .inf 파일을 가져 와서 .sys 파일과 일치하도록 변경했지만 내 가상 박스 win7 x64 :-)가 망가졌습니다. 그래서 VS2012에서 필터 드라이버 프로젝트를 만들고 .inf 파일을 가져 와서 내 .sys 파일과 일치하도록 변경했습니다. 설치 한 후에는 아무 것도하지 않았습니다. 나는
net start MyDriver
로 만든 새 서비스를 실행하는 시도했지만 아무것도 디버그에 인쇄되지 않았으며 또한 나는 컴퓨터 -에 MyDriver> Manage-> 서비스를 볼 수 없습니다. 디버그 (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx)로 인쇄되는 내용을 보려면 DebugView를 사용하고 있습니다.
당연히 나는 acctualy가 뭔가를하는 드라이버를 쓰고 싶지만 그 동안 운전 방법을 알고 싶다.
내가 VS2012에서 가져다가 변경되었습니다 .inf 파일
은 이것이다 :;;;
;;; MyDriver2
;;;
[Version]
Signature = "$Windows NT$"
; TODO - Change the Class and ClassGuid to match the Load Order Group value, see http://msdn.microsoft.com/en-us/windows/hardware/gg462963
; Class = "ActivityMonitor" ;This is determined by the work this filter driver does
; ClassGuid = {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2} ;This value is determined by the Load Order Group value
Class = "ActivityMonitor"
ClassGuid = {b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2}
Provider = %ManufacturerName%
DriverVer = 08/13/2012,1.0.0.0
;CatalogFile = MyDriver2.cat
[DestinationDirs]
DefaultDestDir = 12
MiniFilter.DriverFiles = 12 ;%windir%\system32\drivers
;;
;; Default install sections
;;
[DefaultInstall]
OptionDesc = %ServiceDescription%
CopyFiles = MiniFilter.DriverFiles
[DefaultInstall.Services]
AddService = %ServiceName%,,MiniFilter.Service
;;
;; Default uninstall sections
;;
[DefaultUninstall]
DelFiles = MiniFilter.DriverFiles
[DefaultUninstall.Services]
DelService = %ServiceName%,0x200 ;Ensure service is stopped before deleting
;
; Services Section
;
[MiniFilter.Service]
DisplayName = %ServiceName%
Description = %ServiceDescription%
ServiceBinary = %12%\%DriverName%.sys ;%windir%\system32\drivers\
Dependencies = "FltMgr"
ServiceType = 2 ;SERVICE_FILE_SYSTEM_DRIVER
StartType = 3 ;SERVICE_DEMAND_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
; TODO - Change the Load Order Group value, see http://connect.microsoft.com/site221/content/content.aspx?ContentID=2512
; LoadOrderGroup = "FSFilter Activity Monitor"
LoadOrderGroup = "filter"
AddReg = MiniFilter.AddRegistry
;
; Registry Modifications
;
[MiniFilter.AddRegistry]
HKR,,"DebugFlags",0x00010001 ,0x0
HKR,,"SupportedFeatures",0x00010001,0x3
HKR,"Instances","DefaultInstance",0x00000000,%DefaultInstance%
HKR,"Instances\"%Instance1.Name%,"Altitude",0x00000000,%Instance1.Altitude%
HKR,"Instances\"%Instance1.Name%,"Flags",0x00010001,%Instance1.Flags%
;
; Copy Files
;
[MiniFilter.DriverFiles]
%DriverName%.sys
[SourceDisksFiles]
MyDriver2.sys = 1,,
[SourceDisksNames]
1 = %DiskId1%,,,
;;
;; String Section
;;
[Strings]
; TODO - Add your manufacturer
ManufacturerName = "Template"
ServiceDescription = "MyDriver2 Mini-Filter Driver"
ServiceName = "MyDriver2"
DriverName = "MyDriver2"
DiskId1 = "MyDriver2 Device Installation Disk"
;Instances specific information.
DefaultInstance = "MyDriver2 Instance"
Instance1.Name = "MyDriver2 Instance"
; TODO - Change the altitude value, see http://connect.microsoft.com/site221/content/content.aspx?ContentID=2512
;Instance1.Altitude = "370030"
Instance.Altitude = "370030"
Instance1.Flags = 0x0 ; Allow all attachments
I 설치하고 내 드라이버를 실행하는 wdreg.exe를 사용하여 시도가 말했다 "INF 파일에서 제조업체 섹션을 찾기 실패". (from http://www.jungo.com/st/support/documentation/windriver/10.3.0/wdpci_manual.mhtml/dyn_windows.html) .inf 파일 (일부 Microsoft 책과 많은 Google)에 대해 많은 내용을 읽었으며 .inf 파일을 수정하는 방법을 아직 모릅니다.
내 드라이버를 실행하는 간단한 방법이 있다면 그것에 대해 듣고 싶습니다. 실행 방법을 알게되면 실제 제품을 디버깅하는 것이 쉬울 것입니다.
감사합니다.
EDIT : 테스트 모드 (http://www.ngohq.com/home.php?page=dseo)에서 Driver Signature Enforcement Overrider를 사용하여 .sys 파일을 또한 처리합니다.
감사합니다. 나는 그것을 시도 할 것이다. – assafmo