ReactOS 0.4.15-dev-7704-gc07eb9f
main.c File Reference
#include "precomp.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

handle_t __RPC_USER WINSPOOL_HANDLE_bind (WINSPOOL_HANDLE wszName)
 
void __RPC_USER WINSPOOL_HANDLE_unbind (WINSPOOL_HANDLE wszName, handle_t hBinding)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
BOOL WINAPI SpoolerInit (VOID)
 

Variables

HANDLE hProcessHeap
 
HINSTANCE hinstWinSpool = NULL
 
CRITICAL_SECTION rtlCritSec
 

Function Documentation

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 74 of file main.c.

75{
76 TRACE("DllMain(%p, %lu, %p)\n", hinstDLL, fdwReason, lpvReserved);
77
78 switch (fdwReason)
79 {
83 hinstWinSpool = hinstDLL;
85 break;
86
89 break;
90 }
91
92 return TRUE;
93}
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved
HANDLE hProcessHeap
Definition: main.c:13
#define TRACE(s)
Definition: solgame.cpp:4
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
HINSTANCE hinstWinSpool
Definition: main.c:12
CRITICAL_SECTION rtlCritSec
Definition: main.c:13
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ midl_user_allocate()

void __RPC_FAR *__RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 62 of file main.c.

63{
65}
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLenum GLsizei len
Definition: glext.h:6722

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 68 of file main.c.

69{
71}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

◆ SpoolerInit()

BOOL WINAPI SpoolerInit ( VOID  )

Definition at line 96 of file main.c.

97{
98 BOOL bReturnValue = FALSE;
99 DWORD dwErrorCode;
100
101 TRACE("SpoolerInit()\n");
102
103 // Nothing to initialize here yet, but pass this call to the Spool Service as well.
105 {
106 dwErrorCode = _RpcSpoolerInit();
107 SetLastError(dwErrorCode);
108 bReturnValue = (dwErrorCode == ERROR_SUCCESS);
109 }
111 {
112 ERR("_RpcSpoolerInit failed with exception code %lu!\n", RpcExceptionCode());
113 }
115
116 return bReturnValue;
117}
#define ERR(fmt,...)
Definition: debug.h:110
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132
DWORD _RpcSpoolerInit(VOID)
Definition: init.c:11

◆ WINSPOOL_HANDLE_bind()

handle_t __RPC_USER WINSPOOL_HANDLE_bind ( WINSPOOL_HANDLE  wszName)

Definition at line 16 of file main.c.

17{
19 PWSTR wszStringBinding;
21
22 // Get us a string binding handle from the supplied connection information
23 Status = RpcStringBindingComposeW(NULL, L"ncalrpc", NULL, L"spoolss", NULL, &wszStringBinding);
24 if (Status != RPC_S_OK)
25 {
26 ERR("RpcStringBindingComposeW failed with status %ld!\n", Status);
27 return NULL;
28 }
29
30 // Get a handle_t binding handle from the string binding handle
31 Status = RpcBindingFromStringBindingW(wszStringBinding, &hBinding);
32 if (Status != RPC_S_OK)
33 {
34 ERR("RpcBindingFromStringBindingW failed with status %ld!\n", Status);
35 return NULL;
36 }
37
38 // Free the string binding handle
39 Status = RpcStringFreeW(&wszStringBinding);
40 if (Status != RPC_S_OK)
41 {
42 ERR("RpcStringFreeW failed with status %ld!\n", Status);
43 return NULL;
44 }
45
46 return hBinding;
47}
handle_t hBinding
Definition: ctx_c.c:54
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
#define L(x)
Definition: ntvdm.h:50
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
long RPC_STATUS
Definition: rpc.h:52
uint16_t * PWSTR
Definition: typedefs.h:56

◆ WINSPOOL_HANDLE_unbind()

void __RPC_USER WINSPOOL_HANDLE_unbind ( WINSPOOL_HANDLE  wszName,
handle_t  hBinding 
)

Definition at line 50 of file main.c.

51{
53
55 if (Status != RPC_S_OK)
56 {
57 ERR("RpcBindingFree failed with status %ld!\n", Status);
58 }
59}
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787

Variable Documentation

◆ hinstWinSpool

HINSTANCE hinstWinSpool = NULL

◆ hProcessHeap

HANDLE hProcessHeap

Definition at line 11 of file main.c.

◆ rtlCritSec

CRITICAL_SECTION rtlCritSec

Definition at line 13 of file main.c.

Referenced by DllMain(), IntProtectHandle(), and IntUnprotectHandle().