存档

文章标签 ‘函数’
2,288 views

创建有导出函数的内核驱动程序

2010年2月27日

testsys.def

;testsys.def : Declares the module parameters for the DLL.

; LIBRARY      "testsys"

EXPORTS
    ; Explicit exports can go here
    SDK_ExportFunction1		@1
    SDK_ExportFunction2		@2

testsys.h

#ifndef _TESTSYS_H
#define _TESTSYS_H 1

extern void NTAPI SDK_ExportFunction1(ULONG nIndex) ;
extern void NTAPI SDK_ExportFunction2();

#endif

testsys.c

#include <ntddk.h>
#include "testsys.h"

void NTAPI SDK_ExportFunction1(ULONG nIndex)
{
    return ;
}

void NTAPI SDK_ExportFunction2()
{
    return ;
}

#pragma code_seg("INIT")
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
	return STATUS_SUCCESS ;
}
#pragma code_seg()

阅读全文…

内核编程 , , ,