ReactOS 0.4.16-dev-937-g7afcd2a
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#ifndef __REACTOS__
52 case DLL_WINE_PREATTACH:
53 return FALSE; /* prefer native version */
54#endif
55
57 DisableThreadLibraryCalls( hinstDLL );
58 break;
59 }
60 return TRUE;
61}
static DWORD const fdwReason
#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 69 of file ntprint.c.

70{
72 DWORD needed;
73 DWORD res;
74
75 TRACE("(%d, %s)\n", unknown1, debugstr_w(server));
76
78 if (!mi) {
79 /* FIXME: SetLastError() needed? */
80 return NULL;
81 }
82
83 /* Get the needed size for all Monitors */
84 res = EnumMonitorsW(server, 2, NULL, 0, &needed, &mi->installed);
86 mi->mi2 = HeapAlloc(GetProcessHeap(), 0, needed);
87 res = EnumMonitorsW(server, 2, (LPBYTE) mi->mi2, needed, &needed, &mi->installed);
88 }
89
90 if (!res) {
92 return NULL;
93 }
94
95 TRACE("=> %p (%u monitors installed)\n", mi, mi->installed);
96 return mi;
97}
#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
static MONITORINFO mi
Definition: win.c:7338
unsigned char * LPBYTE
Definition: typedefs.h:53
static rfbScreenInfoPtr server
Definition: vnc.c:74
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 104 of file ntprint.c.

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

◆ PSetupEnumMonitor()

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

Definition at line 136 of file ntprint.c.

137{
138 monitorinfo_t * mi = monitorinfo;
140 DWORD len;
141
142 TRACE("(%p, %u, %p, %p) => %d\n", mi, index, buffer, psize, psize ? *psize : 0);
143
144 if (index < mi->installed) {
145 nameW = mi->mi2[index].pName;
146 len = lstrlenW(nameW) + 1;
147 if (len <= *psize) {
148 memcpy(buffer, nameW, len * sizeof(WCHAR));
149 TRACE("#%u: %s\n", index, debugstr_w(buffer));
150 return TRUE;
151 }
152 *psize = len;
154 return FALSE;
155 }
157 return FALSE;
158}
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  )