写作的Windows端口监视器基础 [英] Writing Windows Port Monitor Basics

查看:316
本文介绍了写作的Windows端口监视器基础的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到如何写一个打印机端口监视器一个基本的例子,教程,或博客文章。我下载了Windows DDK中,并通过localmon挖,但现在看来,这个样本是更复杂的不仅仅是螺母和螺栓的基础知识,并从我的理解它是比,因为它如何处理注册表项和OEM端口监视器有点不同端口枚举。有谁知道一个博客文章,教程,甚至是书,通过基本code走到读者得到一个和去的?我发现讲的是概念上的东西,几个环节,但没有什么是手code。

I'm trying to find a basic example, tutorial, or blog post on how to write a printer port monitor. I downloaded the Windows DDK and dug through localmon, but it appears that this sample is much more complex than just the nuts and bolts basics and from my understanding it is a bit different than an OEM port monitor because of how it handles the registry key and port enumeration. Does anyone know of a blog post, tutorial, or even book that walks the reader through the basic code to get one up and going? I've found a few links talking about the conceptual stuff, but nothing that is hands on code.

推荐答案

我写我的距离的规格中,有没有真正许多API的实现。

I wrote mine from the specs, there aren't really that many API's to implement.

一件事情,regularaly绊倒人组成的EnumPorts,后台处理程序为所有的端口分配足够的内存,不只是你的。所以,你需要确保你填写从后台处理程序缓冲区末尾的字符串,不要把它们的结构后直。

The one thing that regularaly trips people up is EnumPorts, the spooler allocates enough memory for ALL the ports, not just yours. So you need to make sure you fill any strings from the end of the spoolers buffer, don't put them straight after your structures.

它不会在规格这么说,但你可以放心地把用户界面和服务器功能在同一个DLL。

It doesn't say so in the specs but you can safely put the UI and Server functions in the same DLL.

也有可能创建一个支持NT和后来的Windows 2000类型的端口监视器单端口监视器。

It's also possible to create a single port monitor that supports NT and the later Windows 2000 type port monitors.

在雷德曼的code更容易比localmon例如阅读,这是值得的,然后再开始。这是相当不错的,因为你可以在VS编译它,你并不需要使用DDK来构建它。

The code in RedMon is much easier to read than the localmon example, it's worth looking at before you start. It's quite nice because you can compile it in VS, you don't need to use the DDK to build it.

这篇关于写作的Windows端口监视器基础的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆