ReactOS
0.4.16-dev-2613-g9533ad7
main.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Standard Print Processor API Tests
3
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4
* PURPOSE: Main functions
5
* COPYRIGHT: Copyright 2016 Colin Finck (colin@reactos.org)
6
*/
7
8
#include <
apitest.h
>
9
10
#define WIN32_NO_STATUS
11
#include <
windef.h
>
12
#include <
winbase.h
>
13
#include <
wingdi.h
>
14
#include <
winspool.h
>
15
16
PVOID
17
GetWinprintFunc
(
const
char
*
FunctionName
)
18
{
19
DWORD
cbNeeded;
20
HMODULE
hWinprint;
21
PVOID
pFunc;
22
WCHAR
wszWinprintPath[
MAX_PATH
];
23
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
}
30
31
wcscat
(wszWinprintPath,
L
"\\winprint.dll"
);
32
33
// Try loading it.
34
hWinprint =
LoadLibraryW
(wszWinprintPath);
35
if
(!hWinprint)
36
{
37
if
(
GetLastError
() !=
ERROR_MOD_NOT_FOUND
)
38
{
39
skip
(
"LoadLibraryW failed for %S with error %lu!\n"
, wszWinprintPath,
GetLastError
());
40
return
NULL
;
41
}
42
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
}
52
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
}
60
61
return
pFunc;
62
}
FunctionName
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
apitest.h
skip
#define skip(...)
Definition:
atltest.h:64
NULL
#define NULL
Definition:
types.h:112
ERROR_MOD_NOT_FOUND
#define ERROR_MOD_NOT_FOUND
Definition:
compat.h:104
GetProcAddress
#define GetProcAddress(x, y)
Definition:
compat.h:753
MAX_PATH
#define MAX_PATH
Definition:
compat.h:34
LoadLibraryW
#define LoadLibraryW(x)
Definition:
compat.h:747
L
#define L(x)
Definition:
resources.c:13
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
GetWinprintFunc
PVOID GetWinprintFunc(const char *FunctionName)
Definition:
main.c:17
WCHAR
short WCHAR
Definition:
pedump.c:58
wcscat
wcscat
Definition:
corecrt_wstring.h:101
LPBYTE
unsigned char * LPBYTE
Definition:
typedefs.h:53
winbase.h
GetLastError
DWORD WINAPI GetLastError(void)
Definition:
except.c:1042
windef.h
wingdi.h
winspool.h
GetPrintProcessorDirectoryW
WINBOOL WINAPI GetPrintProcessorDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded)
modules
rostests
apitests
winprint
main.c
Generated on Sat Apr 18 2026 06:18:52 for ReactOS by
1.9.6