⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 Programming the Microsoft Windows driver model.2nd 随书光盘。内有很多作者送的实用工具和随书源码。WDM编程
💻 CPP
字号:
// test.cpp : Defines the entry point for the console application.

// Copyright (C) 1999 by Walter Oney

// All rights reserved



#include "stdafx.h"

#include <winioctl.h>

#include "..\sys\ioctls.h"



int main(int argc, char* argv[])

	{

	HANDLE hdevice = CreateFile("\\\\.\\RESOURCE", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

	if (hdevice == INVALID_HANDLE_VALUE)

		{

		printf("Unable to open RESOURCE device - error %d\n", GetLastError());

		return 1;

		}



	DWORD junk;

	volatile DWORD version;



	version = 0;

	if (DeviceIoControl(hdevice, IOCTL_GET_VERSION, NULL, 0, (PVOID) &version, sizeof(version), &junk, NULL))

		printf("Using RESOURCE.SYS version %d.%2.2d\n", HIWORD(version), LOWORD(version));

	else

		printf("Error %d in IOCTL_GET_VERSION\n", GetLastError());



	CloseHandle(hdevice);

	return 0;

	}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -