ReactOS 0.4.16-dev-297-gc569aee
ntprint.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wingdi.h"
#include "winnls.h"
#include "winver.h"
#include "winspool.h"
#include "wine/debug.h"
Include dependency graph for ntprint.c:

Go to the source code of this file.

Classes

struct  monitorinfo_t
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ntprint)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HANDLE WINAPI PSetupCreateMonitorInfo (DWORD unknown1, WCHAR *server)
 
VOID WINAPI PSetupDestroyMonitorInfo (HANDLE monitorinfo)
 
BOOL WINAPI PSetupEnumMonitor (HANDLE monitorinfo, DWORD index, LPWSTR buffer, LPDWORD psize)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file ntprint.c.

Function Documentation

◆ DllMain()

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

Definition at line 45 of file ntprint.c.

46{
47 TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
48
49 switch(fdwReason)
50 {
51 case DLL_WINE_PREATTACH:
52 return FALSE; /* prefer native version */
53
55 DisableThreadLibraryCalls( hinstDLL );
56 break;
57 }
58 return TRUE;
59}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static IN DWORD IN LPVOID lpvReserved
#define TRACE(s)
Definition: solgame.cpp:4

◆ PSetupCreateMonitorInfo()

HANDLE WINAPI PSetupCreateMonitorInfo ( DWORD  unknown1,
WCHAR server 
)

Definition at line 67 of file ntprint.c.

68{
70 DWORD needed;
71 DWORD res;
72
73 TRACE("(%d, %s)\n", unknown1, debugstr_w(server));
74
76 if (!mi) {
77 /* FIXME: SetLastError() needed? */
78 return NULL;
79 }
80
81 /* Get the needed size for all Monitors */
82 res = EnumMonitorsW(server, 2, NULL, 0, &needed, &mi->installed);
84 mi->mi2 = HeapAlloc(GetProcessHeap(), 0, needed);
85 res = EnumMonitorsW(server, 2, (LPBYTE) mi->mi2, needed, &needed, &mi->installed);
86 }
87
88 if (!res) {
90 return NULL;
91 }
92
93 TRACE("=> %p (%u monitors installed)\n", mi, mi->installed);
94 return mi;
95}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
#define debugstr_w
Definition: kernel32.h:32
unsigned char * LPBYTE
Definition: typedefs.h:53
static rfbScreenInfoPtr server
Definition: vnc.c:74
static MONITORINFO mi
Definition: win.c:7338
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WINBOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitor, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)

◆ PSetupDestroyMonitorInfo()

VOID WINAPI PSetupDestroyMonitorInfo ( HANDLE  monitorinfo)

Definition at line 102 of file ntprint.c.

103{
104 monitorinfo_t * mi = monitorinfo;
105
106 TRACE("(%p)\n", mi);
107 if (mi) {
108 if (mi->installed) HeapFree(GetProcessHeap(), 0, mi->mi2);
110 }
111}

◆ PSetupEnumMonitor()

BOOL WINAPI PSetupEnumMonitor ( HANDLE  monitorinfo,
DWORD  index,
LPWSTR  buffer,
LPDWORD  psize 
)

Definition at line 134 of file ntprint.c.

135{
136 monitorinfo_t * mi = monitorinfo;
138 DWORD len;
139
140 TRACE("(%p, %u, %p, %p) => %d\n", mi, index, buffer, psize, psize ? *psize : 0);
141
142 if (index < mi->installed) {
143 nameW = mi->mi2[index].pName;
144 len = lstrlenW(nameW) + 1;
145 if (len <= *psize) {
146 memcpy(buffer, nameW, len * sizeof(WCHAR));
147 TRACE("#%u: %s\n", index, debugstr_w(buffer));
148 return TRUE;
149 }
150 *psize = len;
152 return FALSE;
153 }
155 return FALSE;
156}
static const WCHAR nameW[]
Definition: main.c:49
#define index(s, c)
Definition: various.h:29
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define lstrlenW
Definition: compat.h:750
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ntprint  )