前言,本篇文章主要记录各种常用的代码格式。这些代码格式是方便创建空白文件时,减少一些重复的代码拼写。
驱动代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include <ntddk.h> void DriverUnload (PDRIVER_OBJECT pDriverObject) ;NTSTATUS DriverEntry (PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegPath) { DbgPrint("Hello World!\n" ); pDriverObject->DriverUnload = DriverUnload; return STATUS_SUCCESS; } void DriverUnload (PDRIVER_OBJECT pDriverObject) { DbgPrint("Bye!\n" ); }
VC6下的StdAfx.h头文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #if !defined(AFX_STDAFX_H__6C695132_E998_4352_A65E_EA4EB7B8E75A__INCLUDED_) #define AFX_STDAFX_H__6C695132_E998_4352_A65E_EA4EB7B8E75A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif #define WIN32_LEAN_AND_MEAN #include <stdio.h> #endif