성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Java - How to use the Foreign Funct...
[정성태] 제가 큰 실수를 했군요. ^^; Delegate를 통한 Bein...
[정성태] Working with Rust Libraries from C#...
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <div style='font-family: 맑은 고딕, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>Visual Studio 2010 - Device Driver 제작- Hello World 예제</div> <br /> 친숙한 Visual Studio 개발환경을 떠나지 않고 ^^ "Hello World" 예제를 만들어 볼까요?<br /> 저도 밑바닥부터는 "스스로" 알 수는 없으니, 방법을 찾아보았는데 다음의 글이 눈에 띄었습니다. ^^<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; width: 800px; background-color: #fbedbb; overflow-x: scroll; font-family: Consolas, Verdana;' > How to Configure Visual Studio 2008 for Compiling Drivers ; <a target='_tab' href='https://www.codeproject.com/Articles/31865/How-to-Configure-Visual-Studio-2008-for-Compiling'>https://www.codeproject.com/Articles/31865/How-to-Configure-Visual-Studio-2008-for-Compiling</a> </pre> <br /> 정확한 해결 방법이 될 것 같죠? ^^<br /> <br /> <hr style='width: 50%' /><br /> <br /> 일단, 기본적인 단계는 위의 글을 따르긴 했는데, Visual Studio 2010이기 때문에 나름대로 변경된 것이 있습니다. (Visual Studio 2008이라면, 위의 글에 나온 순서대로 따라하시면 됩니다.)<br /> <br /> 또한, x64 빌드를 기준으로 설정이 되었습니다.<br /> <br /> 1. Visual Studio 2010 설치<br /> <br /> 2. WDK 설치<br /> ; <a target='_tab' href='http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff'>http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff</a><br /> <br /> 3. "Win32 Project" 유형의 새 프로젝트를 생성하고,<br /> ; Applicaiton type - Windows application<br /> ; Additional Options: Empty project<br /> <br /> 4. 솔루션의 "Configuration Manager"를 통해서 'x64' 플랫폼을 추가<br /> <br /> <img border='1' alt='vs2010_dd_sample_1.png' src='/SysWebRes/bbs/vs2010_dd_sample_1.png' /><br /> <br /> 5. "Configuration Properties" / "General"<br /> ; Target Extension: .sys<br /> <br /> <img border='1' alt='vs2010_dd_sample_2.png' src='/SysWebRes/bbs/vs2010_dd_sample_2.png' /><br /> <br /> 6. "Configuration Properties" / "VC++ Directories"에 DDK의 include, lib, bin 폴더를 추가<br /> ; Executable Directories: D:\WinDDK\7600.16385.1\bin;$(ExecutablePath)<br /> ; Include Directories: D:\WinDDK\7600.16385.1\inc\ddk;D:\WinDDK\7600.16385.1\inc\api;D:\WinDDK\7600.16385.1\inc\crt<br /> ; Library Directories: D:\WinDDK\7600.16385.1\lib\win7\amd64<br /> <br /> <img border='1' alt='vs2010_dd_sample_3.png' src='/SysWebRes/bbs/vs2010_dd_sample_3.png' /><br /> <br /> 7. "Configuration Properties"에서 "Configuration" 설정을 "All Configurations"로 바꾼 후,<br /> 1. C/C++ - General - Debug Information Format = Program Database (/Zi)<br /> 2. C/C++ - Preprocessor - Preprocessor Definitions = _AMD64_<br /> 3. C/C++ - Code Generation - Enable C++ Exceptions = No<br /> 4. C/C++ - Code Generation - Basic Runtime Checks = Default<br /> 5. C/C++ - Code Generation - Buffer Security Check = No (/GS-)<br /> 6. C/C++ - Advanced - Calling Convention = __stdcall (/Gz)<br /> 7. C/C++ - Advanced - Compile As = Compile as C Code (/TC) [if you are going to use plain C]<br /> 8. Linker - General - Enable Incremental Linking = [<a target='_tab' href='http://connect.microsoft.com/VisualStudio/feedback/details/521389/specifying-driver-yes-in-linker-settings-does-not-work-any-more'>빈 문자열</a>]<br /> 9. Linker - Input - Additional Dependencies = ntoskrnl.lib;hal.lib (상속 받지 않음을 체크)<br /> 10. Linker - Input - Ignore All Default Libraries = Yes (/NODEFAULTLIB)<br /> 11. Linker - Manifest File - Generate Manifest = No<br /> 12. Linker - System - SubSystem = Native (/SUBSYSTEM:NATIVE)<br /> 13. Linker - System - Driver = Driver (/DRIVER)<br /> 14. Linker - Advanced - Entry Point = DriverEntry<br /> 15. Linker - Advanced - Base Address = 0x10000<br /> 16-1. Linker - Advanced - Randomized Base Address = [<a target='_tab' href='http://connect.microsoft.com/VisualStudio/feedback/details/521389/specifying-driver-yes-in-linker-settings-does-not-work-any-more'>빈 문자열</a>] <br /> 16-2. Linker - Advanced - Data Execution Prevention (DEP) = [<a target='_tab' href='http://connect.microsoft.com/VisualStudio/feedback/details/521389/specifying-driver-yes-in-linker-settings-does-not-work-any-more'>빈 문자열</a>]<br /> <br /> <img border='1' alt='vs2010_dd_sample_4.png' src='/SysWebRes/bbs/vs2010_dd_sample_4.png' /><br /> <br /> 6. 예제 코드 작성으로 마무리<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; width: 800px; background-color: #fbedbb; overflow-x: scroll; font-family: Consolas, Verdana;' > #include <ntddk.h> VOID DriverUnload( PDRIVER_OBJECT pDriverObject ) { DbgPrint("Driver Unload\n" ); } NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath) { DbgPrint("DriverEntry\n"); pDriverObject->DriverUnload = DriverUnload; return STATUS_SUCCESS; } </pre> <br /> 7. 빌드!<br /> <br /> <hr style='width: 50%' /><br /> <br /> 사실, 코딩을 Visual Studio 2010이라는 편집기를 이용하고 컴파일만 하는 것에 의미가 있을 뿐 "F5 디버깅"이 되는 것은 아니기 때문에 어차피 별도의 배포 스크립트는 만드는 것이 좋습니다. (설령 된다고 해도, Blue Screen이 자신의 개발 PC에서 뜨는 것이 유쾌하지는 않죠. ^^)<br /> <br /> <br /><br /><hr /><span style='color: Maroon'>[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1338
(왼쪽의 숫자를 입력해야 합니다.)