- UID
- 1821
- 精华
- 积分
- 3249
- 威望
- 点
- 宅币
- 个
- 贡献
- 次
- 宅之契约
- 份
- 最后登录
- 1970-1-1
- 在线时间
- 小时
|
- /*simple.c*/
- #include <ntdef.h>
- #include <ntddk.h>
- #include <wchar.h>
- /*注册个 safecrt 回调函数*/
- void __cdecl _invalid_parameter(
- const wchar_t *pszExpression,
- const wchar_t *pszFunction,
- const wchar_t *pszFile,
- unsigned int nLine,
- unsigned int *pReserved
- )
- {
-
- }
- /*test */
- void foo()
- {
- static wchar_t buf[256];
- swprintf_s(&buf,L"%s\n",L"0xaa55.com");
- }
- /**/
- NTSTATUS __stdcall
- DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath)
- {
- foo();
- return STATUS_DEVICE_CONFIGURATION_ERROR;
- }
复制代码
- #sources
- MINORCOMP=simple
- TARGETNAME=simple
- TARGETTYPE=DRIVER
- #TARGETPATH=..\..\sys
- MSC_WARNING_LEVEL=/W3
- SOURCES=simple.c
- #BUFFER_OVERFLOW_CHECKS=0
- TARGETLIBS= $(CRT_LIB_PATH)\safecrtnt.lib
复制代码 |
|