ReactOS  0.4.15-dev-1397-g19779b3
loadperf_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "wine/debug.h"
#include "loadperf.h"
Include dependency graph for loadperf_main.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (loadperf)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static WCHARstrdupAW (const char *str)
 
DWORD WINAPI InstallPerfDllA (LPCSTR computer, LPCSTR ini, ULONG_PTR flags)
 
DWORD WINAPI InstallPerfDllW (LPCWSTR computer, LPCWSTR ini, ULONG_PTR flags)
 
DWORD WINAPI LoadPerfCounterTextStringsA (LPCSTR cmdline, BOOL quiet)
 
DWORD WINAPI LoadPerfCounterTextStringsW (LPCWSTR cmdline, BOOL quiet)
 
DWORD WINAPI UnloadPerfCounterTextStringsA (LPCSTR cmdline, BOOL quiet)
 
DWORD WINAPI UnloadPerfCounterTextStringsW (LPCWSTR cmdline, BOOL quiet)
 

Function Documentation

◆ DllMain()

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

Definition at line 34 of file loadperf_main.c.

35 {
36  TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
37 
38  switch(fdwReason)
39  {
40  case DLL_WINE_PREATTACH:
41  return FALSE; /* prefer native version */
42  case DLL_PROCESS_ATTACH:
43  DisableThreadLibraryCalls(hinstDLL);
44  break;
45  }
46 
47  return TRUE;
48 }
#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

◆ InstallPerfDllA()

DWORD WINAPI InstallPerfDllA ( LPCSTR  computer,
LPCSTR  ini,
ULONG_PTR  flags 
)

Definition at line 65 of file loadperf_main.c.

66 {
67  DWORD ret;
68  LPWSTR computerW = NULL, iniW = NULL;
69 
70  if (computer && !(computerW = strdupAW(computer))) return ERROR_OUTOFMEMORY;
71  if (ini && !(iniW = strdupAW(ini)))
72  {
73  HeapFree(GetProcessHeap(), 0, computerW);
74  return ERROR_OUTOFMEMORY;
75  }
76 
77  ret = InstallPerfDllW(computerW, iniW, flags);
78 
79  HeapFree(GetProcessHeap(), 0, computerW);
80  HeapFree(GetProcessHeap(), 0, iniW);
81 
82  return ret;
83 }
DWORD WINAPI InstallPerfDllW(LPCWSTR computer, LPCWSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:88
TConfig ini
Definition: tnconfig.cpp:45
#define GetProcessHeap()
Definition: compat.h:595
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ InstallPerfDllW()

DWORD WINAPI InstallPerfDllW ( LPCWSTR  computer,
LPCWSTR  ini,
ULONG_PTR  flags 
)

Definition at line 88 of file loadperf_main.c.

89 {
90  FIXME("(%s, %s, %lx)\n", debugstr_w(computer), debugstr_w(ini), flags);
91  return ERROR_SUCCESS;
92 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
TConfig ini
Definition: tnconfig.cpp:45
GLbitfield flags
Definition: glext.h:7161

Referenced by InstallPerfDllA().

◆ LoadPerfCounterTextStringsA()

DWORD WINAPI LoadPerfCounterTextStringsA ( LPCSTR  cmdline,
BOOL  quiet 
)

Definition at line 100 of file loadperf_main.c.

101 {
102  DWORD ret;
103  LPWSTR cmdlineW = NULL;
104 
105  if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
106 
107  ret = LoadPerfCounterTextStringsW(cmdlineW, quiet);
108 
109  HeapFree(GetProcessHeap(), 0, cmdlineW);
110 
111  return ret;
112 }
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define GetProcessHeap()
Definition: compat.h:595
DWORD WINAPI LoadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ LoadPerfCounterTextStringsW()

DWORD WINAPI LoadPerfCounterTextStringsW ( LPCWSTR  cmdline,
BOOL  quiet 
)

Definition at line 122 of file loadperf_main.c.

123 {
124  FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
125 
126  return ERROR_SUCCESS;
127 }
#define ERROR_SUCCESS
Definition: deptool.c:10
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111

Referenced by LoadPerfCounterTextStringsA(), and wmain().

◆ strdupAW()

static WCHAR* strdupAW ( const char str)
static

Definition at line 50 of file loadperf_main.c.

51 {
52  WCHAR *ret = NULL;
53  if (str)
54  {
55  INT len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
56  if (!(ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) return NULL;
58  }
59  return ret;
60 }
#define CP_ACP
Definition: compat.h:109
int32_t INT
Definition: typedefs.h:58
const WCHAR * str
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by InstallPerfDllA(), LoadPerfCounterTextStringsA(), and UnloadPerfCounterTextStringsA().

◆ UnloadPerfCounterTextStringsA()

DWORD WINAPI UnloadPerfCounterTextStringsA ( LPCSTR  cmdline,
BOOL  quiet 
)

Definition at line 135 of file loadperf_main.c.

136 {
137  DWORD ret;
138  LPWSTR cmdlineW = NULL;
139 
140  if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
141 
142  ret = UnloadPerfCounterTextStringsW(cmdlineW, quiet);
143 
144  HeapFree(GetProcessHeap(), 0, cmdlineW);
145 
146  return ret;
147 }
DWORD WINAPI UnloadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define GetProcessHeap()
Definition: compat.h:595
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ UnloadPerfCounterTextStringsW()

DWORD WINAPI UnloadPerfCounterTextStringsW ( LPCWSTR  cmdline,
BOOL  quiet 
)

Definition at line 157 of file loadperf_main.c.

158 {
159  FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
160 
161  return ERROR_SUCCESS;
162 }
#define ERROR_SUCCESS
Definition: deptool.c:10
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111

Referenced by UnloadPerfCounterTextStringsA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( loadperf  )