Windows
Fax Service
不翼而飞
文档版本
版本
创建时间
创建人
备注
1.0.0.1
2003-9-10
郑 昀
第一稿
Implementation Scope:
本文档将说明Windows FaxService莫名其妙地不在服务列表中显示,而且手工注册faxsvc.exe也不行。本文档介绍了一种巧妙的招数恢复它。
适用操作系统:Windows 2000 Advanced Server(SP4)
现象
由于需要调用Windows自带的FaxServer虚拟打印功能,我们需要在一台服务器上调用FaxServer的COM组件。
在服务器A上,我们很容易就找到了FaxService服务,它的信息如下:
Description: 帮助您发送和接收传真
Path: C:\WINNT\system32\faxsvc.exe
但是,在服务器B上,服务列表中却没有这个服务。对比了两台服务器的system32路径下的传真相关文件,一模一样。手工在B上运行faxsvc –service命令,也没有效果。
没有这个FaxSvc服务,我们就无法进行虚拟打印。调用
pFaxSvr.CreateInstance(__uuidof(FaxServer)
时就会失败。
那到底差在哪儿呢?什么导致服务无法注册,而且没有任何错误报告呢?
这时候,如果运行B服务器的%systemroot%/system32目录下的faxserv.msc控制台文件,将会得到这个错误报告:
Impossible to estabilsh a connection with the fax service management. it's possible the fax service management is not running or the computer name is wrong
解决步骤
按照我的这个步骤做,你就一切Okay了。
从已经有FaxSvc服务的正常机器上,导出注册表项
HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Services
Fax
然后在服务器B的注册表中导入这一项。
或者你直接把下面表格中的文字保存为“faxsvc.reg”,直接运行即可。
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax]
"Type"=dword:00000110
"Start"=dword:00000003
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,66,
00,61,00,78,00,73,00,76,00,63,00,2e,00,65,00,78,00,65,00,00,00
"DisplayName"="Fax Service"
"DependOnService"=hex(7):54,00,61,00,70,00,69,00,53,00,72,00,76,00,00,00,52,00,
70,00,63,00,53,00,73,00,00,00,50,00,6c,00,75,00,67,00,50,00,6c,00,61,00,79,
00,00,00,53,00,70,00,6f,00,6f,00,6c,00,65,00,72,00,00,00,00,00
"DependOnGroup"=hex(7):00,00
"ObjectName"="LocalSystem"
"Description"="帮助您发送和接收传真"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax\Performance]
"Open"=hex(2):4f,00,70,00,65,00,6e,00,46,00,61,00,78,00,50,00,65,00,72,00,66,
00,6f,00,72,00,6d,00,61,00,6e,00,63,00,65,00,44,00,61,00,74,00,61,00,00,00
"Close"=hex(2):43,00,6c,00,6f,00,73,00,65,00,46,00,61,00,78,00,50,00,65,00,72,
00,66,00,6f,00,72,00,6d,00,61,00,6e,00,63,00,65,00,44,00,61,00,74,00,61,00,
00,00
"Collect"=hex(2):43,00,6f,00,6c,00,6c,00,65,00,63,00,74,00,46,00,61,00,78,00,
50,00,65,00,72,00,66,00,6f,00,72,00,6d,00,61,00,6e,00,63,00,65,00,44,00,61,
00,74,00,61,00,00,00
"Library"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,
74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,66,
00,61,00,78,00,70,00,65,00,72,00,66,00,2e,00,64,00,6c,00,6c,00,00,00
"Last Counter"=dword:00000820
"Last Help"=dword:00000821
"First Counter"=dword:00000802
"First Help"=dword:00000803
"WbemAdapFileTime"=hex:00,a0,36,2a,1f,5b,bf,01
"WbemAdapFileSize"=dword:00001910
"WbemAdapStatus"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax\Security]
"Security"=hex:01,00,14,80,a0,01,00,00,ac,01,00,00,14,00,00,00,30,00,00,00,02,
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,
00,00,02,00,70,01,05,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,00,00,
14,00,14,00,00,00,01,01,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,01,00,00,00,
00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Fax\Enum]
"0"="Root\\LEGACY_FAX\\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
确认输入注册表成功之后,重新启动服务器。这时候,Fax Service就在服务列表中出现了。你也可以正常调用它了。
只不过这种方式搞出来的faxsvc,察看服务属性时,会蹦出一个错误对话框“配置管理器:指定的设备实例句柄和目前设备不一致。”:
不过不影响使用。
总结:
A novice asked the master: "I have a program that sometimes runs and sometimes aborts. I have followed the rules of programming, yet I am totally baffled. What is the reason for this?"
一个初学者问大师:“我的一个程序有时正常有时不正常。我已经完全遵循编程的规则,而且我完全被它弄糊涂了,到底是什么原因会导致这样呢?”
The master replied: "You are confused because you do not understand the Tao. Only a fool expects rational behavior from his fellow humans. Why do you expect it from a machine that humans have constructed? Computers simulate determinism; only the Tao is perfect.
大师说:“你困惑是因为你不了解道。只有傻瓜才会相信只要遵循别人所说就能得到想当然的结果。为什么你要从一个人类自己构造的机器中去得到想当然的结果呢?计算机只是决定论的产物;只有道才是唯一完美的。
The rules of programming are transitory; only the Tao is eternal. Therefore you must contemplate the Tao before you receive enlightenment."
任何编程的规则都只适合于特定的情况,只有道才是永恒不变的。所以在你受到指引之前要先去思考道。”
"But how will I know when I have received enlightenment?" asked the novice.
“但是我怎么知道我何时受到指引呢?”
"Your program will then run correctly," replied the master.
“当你的程序正确运行时”。大师说。
Disclaimers:
本文档所包含的信息代表了在发布之日,zhengyun对所讨论问题的当前看法。本文档不应理解为zhengyun一方的承诺,zhengyun不保证所给信息在发布之日以后的准确性。
本文档仅供参考。
用户必须遵守所有适用的版权法。在不对版权法所规定的权利加以限制的情况下,如未得到 zhengyun和CSDN.Net明确的书面许可,不得出于任何目的、以任何形式或手段(电子的、机械的、影印、录制等等)复制、传播本文的任何部分,也不得将其存储或引入到检索系统中。
Written by zhengyun (at) tomosoft.com