ReactOS 0.4.15-dev-8236-g99f0937
main.c File Reference
#include <apitest.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winspool.h>
Include dependency graph for main.c:

Go to the source code of this file.


#define WIN32_NO_STATUS


PVOID GetWinprintFunc (const char *FunctionName)

Macro Definition Documentation


#define WIN32_NO_STATUS

Definition at line 10 of file main.c.

Function Documentation

◆ GetWinprintFunc()

PVOID GetWinprintFunc ( const char FunctionName)

Definition at line 17 of file main.c.

19 DWORD cbNeeded;
20 HMODULE hWinprint;
21 PVOID pFunc;
22 WCHAR wszWinprintPath[MAX_PATH];
24 // Build the path to the default Print Processor winprint.dll in the Print Processor directory.
25 if (!GetPrintProcessorDirectoryW(NULL, NULL, 1, (LPBYTE)wszWinprintPath, sizeof(wszWinprintPath), &cbNeeded))
26 {
27 skip("Could not determine the path to the Print Processor directory, last error is %lu!\n", GetLastError());
28 return NULL;
29 }
31 wcscat(wszWinprintPath, L"\\winprint.dll");
33 // Try loading it.
34 hWinprint = LoadLibraryW(wszWinprintPath);
35 if (!hWinprint)
36 {
38 {
39 skip("LoadLibraryW failed for %S with error %lu!\n", wszWinprintPath, GetLastError());
40 return NULL;
41 }
43 // winprint.dll does not exist prior to NT6.
44 // The default Print Processor is implemented in localspl.dll instead.
45 hWinprint = LoadLibraryW(L"localspl.dll");
46 if (!hWinprint)
47 {
48 skip("LoadLibraryW failed for localspl.dll with error %lu!\n", GetLastError());
49 return NULL;
50 }
51 }
53 // Get the function we are looking for.
54 pFunc = GetProcAddress(hWinprint, FunctionName);
55 if (!pFunc)
56 {
57 skip("GetProcAddress failed for %s with error %lu!\n", FunctionName, GetLastError());
58 return NULL;
59 }
61 return pFunc;
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
Definition: acpixf.h:1279
#define skip(...)
Definition: atltest.h:64
#define NULL
Definition: types.h:112
Definition: compat.h:104
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
#define LoadLibraryW(x)
Definition: compat.h:747
unsigned long DWORD
Definition: ntddk_ex.h:95
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WINBOOL WINAPI GetPrintProcessorDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().