Symptoms
Client printer autocreation might fail if it is connecting to a server running Citrix Presentation Server 4.0 using specific native drivers or the Citrix Universal Printer Driver.
Event ID: 1116, AddPrinter() Error 0x3EB appears in the Application Event Log.
Converting 3EB from hex to decimal gives:
1003
Running the net helpmsg 1003 command from a command line gives the following output:
Cannot complete this function.
See CTX106683 – Event ID 1116 Printer auto-creation failure. Reason: AddPrinter() failed with status 0x5 for more information.
Cause 1
This error code is returned when the driver cannot be loaded by the spooler’s local print provider. This can be caused when the caller (in this case the Citrix Print Manager Service) does not provide sufficient privileges to perform this action.
Citrix Presentation Server 4.0 needs the Ctx_SmaUser privilege to call the OpenPrinterW() function for the client printer autocreation process. In Presentation Server 4.5, the account requiring this privilege is the Ctx_cpsvcuser.
To confirm, add the Ctx_SmaUser (or Ctx_cpsvcuser) to the local administrators group, or change the Citrix Print Manager Service to start with the Local System Account. If either of these changes allows for the successful creation of the client printers, a permissions problem is indicated.
Resolution 1
Tools such as Filemon and Regmon from Sysinternals can be used to isolate the permissions. Also consult CTX106393 - Required Permissions and Rights for the Ctx_SmaUser Account to confirm the correct configuration of the Ctx_SmaUser account. CTX113555 - Required Permissions and Rights for the Ctx_CpsvcUser Account provides required permissions details for the Ctx_cpsvcuser account in Presentation Server 4.5.
Cause 2
Additionally, if specific printer drivers that call the OpenPrinterW() function with a System Account privilege are used, client printer autocreation fails with Access Denied (0x5) in the OpenPrinterW() function.
For example:
0:007> kv
ChildEBP RetAddr Args to Child
00a2ee50 014db166 00e375e0 00a2ee6c 01537c90 WINSPOOL!OpenPrinterW+0x2 (FPO: [Non-Fpo])
00a2ee74 014daf5c 00e375e0 00000002 00000010 0x00a4fcf8
00a2ee8c 014d5508 00e375e0 00000003 00000001 0x00b3ebe7
00a2eea4 72ed2104 00e375e0 00000003 00000001 0x00c2dad6
00a2eef0 75fadff2 00e375e0 00000003 00000001 WINSPOOL!SpoolerPrinterEventNative+0x57 (FPO: [Non-Fpo])
00a2ef0c 75faf9d0 00e375e0 00000003 00000000 localspl!SplDriverEvent+0x21 (FPO: [Non-Fpo])
00a2ef30 75f9a9b4 00e2a920 00000003 00000000 localspl!PrinterDriverEvent+0x46 (FPO: [Non-Fpo])
00a2f3f8 75f982de 00000000 00000002 00e4ba40 localspl!SplAddPrinter+0x5f3 (FPO: [Non-Fpo])
00a2f424 73f37c8f 00000000 00000002 00e4ba40 localspl!LocalAddPrinterEx+0x2e (FPO: [Non-Fpo])
00a2f874 73f37b76 00000000 00000002 00e4ba40 SPOOLSS!AddPrinterExW+0x151 (FPO: [Non-Fpo])
00a2f890 01007e29 00000000 00000002 00e4ba40 SPOOLSS!AddPrinterW+0x17 (FPO: [Non-Fpo])
00a2f8ac 01006ec3 00000000 00e35e80 000aa8a8 spoolsv!YAddPrinter+0x75 (FPO: [Non-Fpo])
00a2f8d0 77c10f3b 00000000 00e35e80 000aa8a8 spoolsv!RpcAddPrinter+0x37 (FPO: [Non-Fpo])
00a2f8f8 77c823f7 01006e8c 00a2fae0 00000005 RPCRT4!Invoke+0x30
00a2fcf8 77c826ed 00000000 00000000 000d1134 RPCRT4!NdrStubCall2+0x299 (FPO: [Non-Fpo])
00a2fd14 77c109be 000d1134 000b84f0 000d1134 RPCRT4!NdrServerCall2+0x19 (FPO: [Non-Fpo])
00a2fd48 77c1093f 01002c47 000d1134 00a2fdec RPCRT4!DispatchToStubInCNoAvrf+0x38 (FPO: [Non-Fpo])
00a2fd9c 77c10865 00000005 00000000 0100d228 RPCRT4!RPC_INTERFACE::DispatchToStubWorker+0x117 (FPO: [Non-Fpo])
00a2fdc0 77c134b1 000d1134 00000000 0100d228 RPCRT4!RPC_INTERFACE::DispatchToStub+0xa3 (FPO: [Non-Fpo])
00a2fdfc 77c11bb3 000ccbe8 000ba7e8 000b9560 RPCRT4!LRPC_SCALL::DealWithRequestMessage+0x42c (FPO: [Non-Fpo])
0:007> g @$ra
eax=00000000 ebx=00000000 ecx=72ec5a19 edx=000004c2 esi=00a2efb0 edi=00000000
eip=014db166 esp=00a2ee64 ebp=00a2ee74 iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
0x014db166
014db166 85c0 test eax,eax
0:007> !teb
TEB at 7ffdc000
ExceptionList: 00a2eee0
StackBase: 00a30000
StackLimit: 00a28000
SubSystemTib: 00000000
FiberData: 00001e00
ArbitraryUserPointer: 00000000
Self: 7ffdc000
EnvironmentPointer: 00000000
ClientId: 00002498 . 00002314
RpcHandle: 00000000
Tls Storage: 00000000
PEB Address: 7ffda000
LastErrorValue: 5
LastStatusValue: c0000022
Count Owned Locks: 0
HardErrorMode: 0
Resolution 2
Contact the printer driver vendor.
Cause 3
The Citrix Universal Printer Driver has become corrupted or has been modified by a non-official certified (MS WHQL) Printer Driver. See CTX089874 – Troubleshooting and Explaining the Citrix Universal Print Driver.
Resolution 3
1. Reinstall the Citrix Universal Printer Driver using the repair function under Add or Remove Programs.
2. As a last resort, Citrix recommends using the Windows Server 2003 Resource Kit Tools Spooler Cleaner (Cleanspl.exe) to remove all print jobs, printers, printer drivers, and spool files from the system.
3. Attempt to reinstall the Citrix Universal Printer Driver.