?? scpdemo.cpp
字號:
// SCPDemo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <winioctl.h>
#include "Driver.h"
#include "CharConvert.h"
int main(int argc, char* argv[])
{
// 驅動驅動程序完整目錄
char szPath[256];
char* p;
::GetFullPathName("CharConvert.SYS", 256, szPath, &p);
// 加載啟動內核驅動
CDriver driver(szPath, "slCharConvert");
if(driver.StartDriver())
{
printf(" CharConvert服務成功啟動 \n");
if(driver.OpenDevice())
{
printf(" 句柄已經打開 \n");
printf(" 請輸入一個數字(0~9):\n");
char c, strOut[16] = "";
// 接收數字輸入
scanf("%c", &c);
// 請求驅動程序轉化
if(driver.IoControl(CHAR_CONVERT, &c, 1, strOut, 2) != -1)
printf("轉化為:%s \n", strOut);
}
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -