资源简介
windows2000设备驱动程序设计指南(配套光盘),老资料,看论坛有人要5分,现免费提供给大家。
代码片段和文件信息
// Testor for Chapter 11 Timer-based Parallel Port Driver
#include
#include
int main() {
HANDLE hDevice;
BOOL status;
printf(“Beginning test of Timer-based Parallel Port Driver (CH11)...\n“);
hDevice =CreateFile(“\\\\.\\TMRPP1“
GENERIC_READ | GENERIC_WRITE
0 // share mode none
NULL // no security
OPEN_EXISTING
FILE_ATTRIBUTE_NORMAL
NULL ); // no template
if (hDevice == INVALID_HANDLE_VALUE)
{
printf(“Failed to obtain file handle to device: “
“%s with Win32 error code: %d\n“
“TMRPP1“ GetLastError() );
return 1;
}
printf(“Succeeded in obtaining handle to TMRPP1 device.\n“);
printf(“Attempting write to device...\n“);
char outBuffer[20];
for (DWORD i=0; i outBuffer[i] = (char)i;
DWORD outCount = sizeof(outBuffer);
DWORD bW;
status =WriteFile(hDevice outBuffer outCount &bW NULL);
if (!status)
{
printf(“Failed on call to WriteFile - error: %d\n“
GetLastError() );
return 2;
}
if (outCount == bW)
{
printf(“Succeeded in writing %d bytes\n“ outCount);
printf(“OutBuffer was: \n“);
for (i=0; i printf(“%02X “ (UCHAR)outBuffer[i]);
printf(“\n“);
}
else
{
printf(“Failed to write the correct number of bytes.\n“
“Attempted to write %d bytes but WriteFile reported %d bytes.\n“
outCount bW);
return 3;
}
printf(“Attempting to read from device...\n“);
char inBuffer[80];
DWORD inCount = sizeof(inBuffer);
DWORD bR;
status =ReadFile(hDevice inBuffer inCount &bR NULL);
if (!status)
{
printf(“Failed on call to ReadFile - error: %d\n“
GetLastError() );
return 4;
}
if (bR == bW)
{
printf(“Succeeded in reading %d bytes\n“ bR);
printf(“Buffer was: \n“);
for (i=0; i
printf(“%02X “ (UCHAR)inBuffer[i]);
printf(“\n“);
}
else
{
printf(“Failed to read the correct number of bytes.\n“
“Should have read %d bytes but ReadFile reported %d bytes.\n“
bW inCount);
return 5;
}
printf(“Attempting to close device TMRPP1...\n“);
status =CloseHandle(hDevice);
if (!status)
{
printf(“Failed on call to CloseHandle - error: %d\n“
GetLastError() );
return 6;
}
printf(“Succeeded in closing device...exiting normally\n“);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-04-02 13:09 Chap11\
目录 0 2008-04-02 13:09 Chap11\Testor\
目录 0 2008-04-02 13:09 Chap11\Testor\Debug\
文件 155711 2000-09-08 13:33 Chap11\Testor\Debug\Testor.exe
文件 2369 2004-08-17 21:17 Chap11\Testor\Testor.cpp
文件 4284 2000-04-25 06:12 Chap11\Testor\Testor.dsp
文件 535 2000-04-25 05:49 Chap11\Testor\Testor.dsw
文件 33792 2004-08-17 21:17 Chap11\Testor\Testor.ncb
文件 53760 2004-08-17 21:17 Chap11\Testor\Testor.opt
目录 0 2008-04-02 13:09 Chap11\TimerPP\
目录 0 2008-04-02 13:09 Chap11\TimerPP\Debug\
文件 148480 2000-09-10 12:33 Chap11\TimerPP\Debug\TimerPP.pdb
文件 8258 2000-09-10 12:33 Chap11\TimerPP\Debug\TimerPP.SYS
文件 19883 2000-09-12 05:42 Chap11\TimerPP\Driver.cpp
文件 2186 2000-09-08 13:43 Chap11\TimerPP\Driver.h
文件 269 1995-07-17 20:59 Chap11\TimerPP\MAKEFILE
文件 117 2000-09-12 05:42 Chap11\TimerPP\Sources
文件 4376 2000-09-09 00:04 Chap11\TimerPP\TimerPP.dsp
文件 732 2000-09-08 13:33 Chap11\TimerPP\TimerPP.dsw
文件 312 2000-09-08 13:25 Chap11\TimerPP\TimerPP.reg
文件 3667 2000-09-04 03:25 Chap11\TimerPP\Unicode.cpp
文件 1308 2000-09-04 03:24 Chap11\TimerPP\Unicode.h
目录 0 2008-04-02 13:09 Chap12\
目录 0 2008-04-02 13:09 Chap12\DMASlave\
目录 0 2008-04-02 13:09 Chap12\DMASlave\Debug\
文件 148480 2000-09-11 07:06 Chap12\DMASlave\Debug\DMASlave.pdb
文件 7748 2000-09-11 07:06 Chap12\DMASlave\Debug\DMASlave.SYS
文件 4256 2000-09-09 02:24 Chap12\DMASlave\DMASlave.dsp
文件 539 2000-09-09 00:56 Chap12\DMASlave\DMASlave.dsw
文件 21747 2000-09-12 05:46 Chap12\DMASlave\Driver.cpp
文件 1224 2000-09-09 02:23 Chap12\DMASlave\Driver.h
............此处省略278个文件信息
相关资源
- Jenkins项目自动化构建详细搭建、配置
- pstool 工具
- 截长图,截gif动图软件,Windows最轻好
- Windows补丁 KB2533623
- QT+ffmpeg+多摄像头+实时Ubuntu直接可用(
- QXDM-QCAT-QPM.1.0.77.2.Windows-AnyCPU.exe
- System.Drawing.dll;System.Windows.Forms.dll.
- myeclipse 2017 ci 1 windows版本 破解文件
- windows基于nginx搭建rtmp流服务器
- libiconv for windows库
- API VIEWER 2004
- Xshell3b0281Windows平台下中文版SSH连接工
- nMaker 4.0 原Windows N in 1 Maker 制作多合一
- WindowsServer2016管理员操作手册
- Windows7扫雷文件
- Windows端Frp服务器一键搭建
- DOS_Windows汇编语言程序设计教程PPT
- bison-2.4.1-setup.exe
- Windows N in 1 Maker 4.0 nMaker4.0制作多合一
- keithley2000系列中文版说明
- 华科2000-15年机试题目+王道pdf
- Windows+Server+2008中安装Exchange+Server+20
- myeclipse(windows)-2016-CI-7破解文件
- stegdetect for windows
- window 网络调试助手 tcp/udp
- Rootkits-Subverting_the_Windows_Kernel
- windows版基于nginx点播视频服务器rtmp
- spy4win For windows7 64位
- 国内服务器ngrok32位Windows系统
- instantclient-odbc-windows.x64-11.2.0.3.0.zip
评论
共有 条评论