资源简介
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个文件信息
相关资源
- AE开发Windows最短路径分析
-
Windows em
bedded Compact 2013 应用开发调 - 黑苹果硬件兼容检测和查询软件
- Uninstall_Cortana_WINCLIENT.CN.rar
- VMware65_SLP_DeLLSLIC2.1
- Windows异步套接字网络编程
- WINDOWS98启动盘镜像Win98.IMA
- 用foobar2000听google音乐[更新一下]
- 仿windows记事本
- ubuntu9.10 可加载内核模块和字符设备驱
- windows7用的,非常漂亮的透明计时器
- windows下制作macOS安装U盘,绝对简单好
- keil vcom windows 7 64bit 驱动
- windows ce 系统的GPIO驱动程序
- TCP 发包工具(windows)
- 微软的可以删除系统卸不干净的软件
- windows下生成MD5值的工具(WinMD5)
- windows cygwin ns2安装步骤
- WinAPI 函数库(大全)
- PKU acm 1000题-2000题
- 联想拯救者恢复系统2000
- 解决在Windows XP SP2下不能显示验证码的
- 加快Windows XP操作系统开机速度
- Windows 1.0 软盘镜像
- Windows下访问LINUX的利器-SSH
- 欧瑞E2000 变频器使用说明
- CGCS2000高斯投影各投影带的定义文件
- ChilledWindows.exe(玩笑病毒)
- NDK-R12B windows-x86_64百度云盘
- windows3.2简体中文版,虚拟机文件
评论
共有 条评论