[SPOOLSV, WINSPOOL]
authorColin Finck <colin@reactos.org>
Wed, 24 Jun 2015 09:51:29 +0000 (09:51 +0000)
committerColin Finck <colin@reactos.org>
Wed, 24 Jun 2015 09:51:29 +0000 (09:51 +0000)
Local Communication between winspool.drv and spoolsv.exe happens using the ncalrpc protocol. The ncacn_np endpoint is only available when sharing a printer. It's then used for receiving a remote call from win32spl.dll.
Reference: http://www.hsc.fr/ressources/articles/win_net_srv/msrpc_spoolss.html

This fixes e.g. testing a _RpcOpenPrinter call from our winspool.drv to a local printer under Windows.

svn path=/branches/colins-printing-for-freedom/; revision=68248

reactos/include/reactos/idl/winspool.idl
reactos/win32ss/printing/base/spoolsv/rpcserver.c
reactos/win32ss/printing/base/winspool/main.c

index ea8d3cc..736b532 100644 (file)
@@ -841,7 +841,7 @@ WINSPOOL_V2_UREPLY_PRINTER;
 [
     uuid(12345678-1234-ABCD-EF00-0123456789AB),
     version(1.0),
-    endpoint("ncacn_np:[\\pipe\\spoolss]"),
+    endpoint("ncalrpc:[spoolss]", "ncacn_np:[\\pipe\\spoolss]"),
     pointer_default(unique)
 ]
 
index 869353d..d5f8c92 100644 (file)
@@ -8,11 +8,11 @@
 #include "precomp.h"
 
 DWORD WINAPI
-RpcThreadProc(LPVOID lpParameter)
+LrpcThreadProc(LPVOID lpParameter)
 {
     RPC_STATUS Status;
 
-    Status = RpcServerUseProtseqEpW(L"ncacn_np", 20, L"\\pipe\\spoolss", NULL);
+    Status = RpcServerUseProtseqEpW(L"ncalrpc", 20, L"spoolss", NULL);
     if (Status != RPC_S_OK)
     {
         ERR("RpcServerUseProtseqEpW failed with status %ld!\n", Status);
index 016d807..624c177 100644 (file)
@@ -15,7 +15,7 @@ WINSPOOL_HANDLE_bind(WINSPOOL_HANDLE wszName)
     RPC_STATUS Status;
 
     // Get us a string binding handle from the supplied connection information
-    Status = RpcStringBindingComposeW(NULL, L"ncacn_np", wszName, L"\\pipe\\spoolss", NULL, &wszStringBinding);
+    Status = RpcStringBindingComposeW(NULL, L"ncalrpc", wszName, L"spoolss", NULL, &wszStringBinding);
     if (Status != RPC_S_OK)
     {
         ERR("RpcStringBindingComposeW failed with status %ld!\n", Status);