VC6+VA來編輯和編譯開發驅動程式

來源:互聯網
上載者:User

1。建立一個空的Win32 Application,將驅動檔案(包括INCLUDE和SOURCES)加入工程

2。Tools-->Options-->Directories-->Executable files
加入:C:\WINDDK\7600.16385.0\BIN\X86\X86
編譯驅動的時候將該命令放在最上面;
編譯應用態程式的時候,將該命令放在最下面

3。Project-->Settings...

{C/C++}
[General]
Debug info:
Program Database

Preprocessor definitions:
_X86_=1,i386=1,STD_CALL,WIN32=100,_WIN32_WINNT=0x0501,WINVER=0x0501,_DEBUG

Project Options:
去掉GX /YX /pdbtype:sept 
MLd->MTd

[Code Generation]
Calling convention:
__stdcall
Use run-time library
Debug Multithreaded

[Preprocessor]
Additional include directories:
C:\WinDDK\7600.16385.0\inc,
C:\WinDDK\7600.16385.0\inc\api,
C:\WinDDK\7600.16385.0\inc\ddk,
C:\WinDDK\7600.16385.0\inc\crt


{Link}
[General]
Output file name:
name.sys
Object/library modules:
ntoskrnl.lib hal.lib usbd.lib wmilib.lib 
去掉"Link incrementally"的勾

[input]
Additional library path:
C:\WinDDK\7600.16385.0\lib,
C:\WinDDK\7600.16385.0\lib\crt\i386,
C:\WinDDK\7600.16385.0\lib\wnet\i386

[output]
Entry-point symbol:
DriverEntry

Project Options:
/machine:IX86 /driver /subsystem:native /SECTION:INIT,d
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
刪除如下選項:
/subsystem:windows

其實主要是為了利用VA編輯代碼的方便。編譯64位的程式或者WIN7等版本,可以直接使用WDK的編譯命令來編譯即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.