ReactOS  0.4.15-dev-1184-g23e04ae
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 
54  case DLL_PROCESS_ATTACH:
55  DisableThreadLibraryCalls( hinstDLL );
56  break;
57  }
58  return TRUE;
59 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static IN DWORD IN LPVOID lpvReserved
#define FALSE
Definition: types.h:117
#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 
75  mi = HeapAlloc(GetProcessHeap(), 0, sizeof(monitorinfo_t));
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) {
89  HeapFree(GetProcessHeap(), 0, mi);
90  return NULL;
91  }
92 
93  TRACE("=> %p (%u monitors installed)\n", mi, mi->installed);
94  return mi;
95 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
static MONITORINFO mi
Definition: win.c:7339
unsigned char * LPBYTE
Definition: typedefs.h:53
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
WINBOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitor, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
#define HeapFree(x, y, z)
Definition: compat.h:483
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ 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);
109  HeapFree(GetProcessHeap(), 0, mi);
110  }
111 }
static MONITORINFO mi
Definition: win.c:7339
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
#define HeapFree(x, y, z)
Definition: compat.h:483

◆ 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;
137  LPWSTR nameW;
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 }
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
static MONITORINFO mi
Definition: win.c:7339
#define lstrlenW
Definition: compat.h:498
#define FALSE
Definition: types.h:117
#define debugstr_w
Definition: kernel32.h:32
GLuint index
Definition: glext.h:6031
static const WCHAR nameW[]
Definition: main.c:46
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:500
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ntprint  )