勇芳软件工作室.汉化:  Printing > Print Spooler API > Printer Driver Installation >

AddMonitor

Previous pageReturn to chapter overviewNext page

描述

 

AddMonitor功能安装本地端口监视器并链接配置,数据和监视文件。

 

C++ 语法

 

BOOL AddMonitor(

__in  LPTSTR pName,

__in  DWORD Level,

__in  LPBYTE pMonitors

);

 

PowerBASIC 语法

 

FUNCTION AddMonitorA ( _

BYREF pName AS ASCIIZ, _

BYVAL Level AS DWORD, _

BYREF pMonitorInfo AS ANY _

) AS LONG

 

Unicode版本:

 

FUNCTION AddMonitorW ( _

BYREF pName AS WSTRINGZ, _

BYVAL Level AS DWORD, _

BYREF pMonitorInfo AS ANY _

) AS LONG

 

参数

 

pName

 

[in]指向指定要在其上安装监视器的服务器的名称的以null结尾的字符串的指针。对于仅支持本地安装监视器的系统,此字符串应为NULL。

 

Level

 

[in]指定pMonitors指向的结构的版本。该值必须为2。

 

pMonitors

 

[in]指向MONITOR_INFO_2结构的指针。如果pMonitors结构的pEnvironment成员为NULL,则使用调用者(客户端)的当前环境,而不是目标(服务器)。

 

Windows 95/98 / MepEnvironment不能为NULL。相反,建议的值为“Windows 4.0”。

 

请注意,如果环境与服务器的环境不匹配,则调用将失败,即只能添加为服务器体系结构编写的监视器。

 

返回值

 

如果函数成功,则返回值为非零值。

 

如果函数失败,返回值为零。

 

备注

 

来电者必须有SeLoadDriverPrivilege.

 

在应用程序调用{??989796114}函数之前,监视器所需的所有文件必须复制到SYSTEM32目录。

 

要确定当前安装的端口监视器,请调用EnumMonitors功能。

 

要删除由AddMonitor添加的监视器,请调用DeleteMonitor功能。

 

Windows 95/98 / Me:Microsoft Layer for Unicode支持AddMonitorW.

 

引用文件 #INCLUDE Once

 

WinSpool.inc(包括Windows.inc)