ReactOS 0.4.15-dev-8119-g4fb2fdb
loadperf_main.c
Go to the documentation of this file.
1/*
2 * Implementation of loadperf.dll
3 *
4 * Copyright 2009 Andrey Turkin
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21
22#include <stdarg.h>
23
24#include "windef.h"
25#include "winbase.h"
26#include "winerror.h"
27#include "winnls.h"
28#include "wine/debug.h"
29
30#include "loadperf.h"
31
33
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 */
44 break;
45 }
46
47 return TRUE;
48}
49
50static WCHAR *strdupAW(const char *str)
51{
52 WCHAR *ret = NULL;
53 if (str)
54 {
56 if (!(ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) return NULL;
58 }
59 return ret;
60}
61
62/*************************************************************
63 * InstallPerfDllA (loadperf.@)
64 */
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}
84
85/*************************************************************
86 * InstallPerfDllW (loadperf.@)
87 */
89{
90 FIXME("(%s, %s, %lx)\n", debugstr_w(computer), debugstr_w(ini), flags);
91 return ERROR_SUCCESS;
92}
93
94/*************************************************************
95 * LoadPerfCounterTextStringsA (loadperf.@)
96 *
97 * NOTES
98 * See LoadPerfCounterTextStringsW
99 */
101{
102 DWORD ret;
103 LPWSTR cmdlineW = NULL;
104
105 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
106
108
109 HeapFree(GetProcessHeap(), 0, cmdlineW);
110
111 return ret;
112}
113
114/*************************************************************
115 * LoadPerfCounterTextStringsW (loadperf.@)
116 *
117 * PARAMS
118 * cmdline [in] Last argument in command line - ini file to be used
119 * quiet [in] FALSE - the function may write to stdout
120 *
121 */
123{
124 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
125
126 return ERROR_SUCCESS;
127}
128
129/*************************************************************
130 * UnloadPerfCounterTextStringsA (loadperf.@)
131 *
132 * NOTES
133 * See UnloadPerfCounterTextStringsW
134 */
136{
137 DWORD ret;
138 LPWSTR cmdlineW = NULL;
139
140 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
141
143
144 HeapFree(GetProcessHeap(), 0, cmdlineW);
145
146 return ret;
147}
148
149/*************************************************************
150 * UnloadPerfCounterTextStringsW (loadperf.@)
151 *
152 * PARAMS
153 * cmdline [in] Last argument in command line - application counters to be removed
154 * quiet [in] FALSE - the function may write to stdout
155 *
156 */
158{
159 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
160
161 return ERROR_SUCCESS;
162}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: debug.h:114
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_w
Definition: kernel32.h:32
static IN DWORD IN LPVOID lpvReserved
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: loadperf_main.c:34
DWORD WINAPI LoadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
DWORD WINAPI LoadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
DWORD WINAPI InstallPerfDllW(LPCWSTR computer, LPCWSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:88
DWORD WINAPI InstallPerfDllA(LPCSTR computer, LPCSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:65
DWORD WINAPI UnloadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:50
DWORD WINAPI UnloadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
TCHAR * cmdline
Definition: stretchblt.cpp:32
TConfig ini
Definition: tnconfig.cpp:45
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
int ret
#define WINAPI
Definition: msvc.h:6
static int quiet
Definition: xmllint.c:162
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185