ReactOS 0.4.16-dev-1040-g85afe48
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#ifndef __REACTOS__
41 case DLL_WINE_PREATTACH:
42 return FALSE; /* prefer native version */
43#endif
46 break;
47 }
48
49 return TRUE;
50}
51
52static WCHAR *strdupAW(const char *str)
53{
54 WCHAR *ret = NULL;
55 if (str)
56 {
58 if (!(ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) return NULL;
60 }
61 return ret;
62}
63
64/*************************************************************
65 * InstallPerfDllA (loadperf.@)
66 */
68{
69 DWORD ret;
70 LPWSTR computerW = NULL, iniW = NULL;
71
72 if (computer && !(computerW = strdupAW(computer))) return ERROR_OUTOFMEMORY;
73 if (ini && !(iniW = strdupAW(ini)))
74 {
75 HeapFree(GetProcessHeap(), 0, computerW);
76 return ERROR_OUTOFMEMORY;
77 }
78
79 ret = InstallPerfDllW(computerW, iniW, flags);
80
81 HeapFree(GetProcessHeap(), 0, computerW);
82 HeapFree(GetProcessHeap(), 0, iniW);
83
84 return ret;
85}
86
87/*************************************************************
88 * InstallPerfDllW (loadperf.@)
89 */
91{
92 FIXME("(%s, %s, %lx)\n", debugstr_w(computer), debugstr_w(ini), flags);
93 return ERROR_SUCCESS;
94}
95
96/*************************************************************
97 * LoadPerfCounterTextStringsA (loadperf.@)
98 *
99 * NOTES
100 * See LoadPerfCounterTextStringsW
101 */
103{
104 DWORD ret;
105 LPWSTR cmdlineW = NULL;
106
107 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
108
110
111 HeapFree(GetProcessHeap(), 0, cmdlineW);
112
113 return ret;
114}
115
116/*************************************************************
117 * LoadPerfCounterTextStringsW (loadperf.@)
118 *
119 * PARAMS
120 * cmdline [in] Last argument in command line - ini file to be used
121 * quiet [in] FALSE - the function may write to stdout
122 *
123 */
125{
126 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
127
128 return ERROR_SUCCESS;
129}
130
131/*************************************************************
132 * UnloadPerfCounterTextStringsA (loadperf.@)
133 *
134 * NOTES
135 * See UnloadPerfCounterTextStringsW
136 */
138{
139 DWORD ret;
140 LPWSTR cmdlineW = NULL;
141
142 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
143
145
146 HeapFree(GetProcessHeap(), 0, cmdlineW);
147
148 return ret;
149}
150
151/*************************************************************
152 * UnloadPerfCounterTextStringsW (loadperf.@)
153 *
154 * PARAMS
155 * cmdline [in] Last argument in command line - application counters to be removed
156 * quiet [in] FALSE - the function may write to stdout
157 *
158 */
160{
161 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
162
163 return ERROR_SUCCESS;
164}
static DWORD const fdwReason
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#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:90
DWORD WINAPI InstallPerfDllA(LPCSTR computer, LPCSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:67
DWORD WINAPI UnloadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:52
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