ReactOS 0.4.17-dev-1071-gb2116d0
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
34static WCHAR *strdupAW(const char *str)
35{
36 WCHAR *ret = NULL;
37 if (str)
38 {
40 if (!(ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) return NULL;
42 }
43 return ret;
44}
45
46/*************************************************************
47 * InstallPerfDllA (loadperf.@)
48 */
50{
51 DWORD ret;
52 LPWSTR computerW = NULL, iniW = NULL;
53
54 if (computer && !(computerW = strdupAW(computer))) return ERROR_OUTOFMEMORY;
55 if (ini && !(iniW = strdupAW(ini)))
56 {
57 HeapFree(GetProcessHeap(), 0, computerW);
58 return ERROR_OUTOFMEMORY;
59 }
60
61 ret = InstallPerfDllW(computerW, iniW, flags);
62
63 HeapFree(GetProcessHeap(), 0, computerW);
64 HeapFree(GetProcessHeap(), 0, iniW);
65
66 return ret;
67}
68
69/*************************************************************
70 * InstallPerfDllW (loadperf.@)
71 */
73{
74 FIXME("(%s, %s, %Ix)\n", debugstr_w(computer), debugstr_w(ini), flags);
75 return ERROR_SUCCESS;
76}
77
78/*************************************************************
79 * LoadPerfCounterTextStringsA (loadperf.@)
80 *
81 * NOTES
82 * See LoadPerfCounterTextStringsW
83 */
85{
86 DWORD ret;
87 LPWSTR cmdlineW = NULL;
88
89 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
90
91 ret = LoadPerfCounterTextStringsW(cmdlineW, quiet);
92
93 HeapFree(GetProcessHeap(), 0, cmdlineW);
94
95 return ret;
96}
97
98/*************************************************************
99 * LoadPerfCounterTextStringsW (loadperf.@)
100 *
101 * PARAMS
102 * cmdline [in] Last argument in command line - ini file to be used
103 * quiet [in] FALSE - the function may write to stdout
104 *
105 */
107{
108 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
109
110 return ERROR_SUCCESS;
111}
112
113/*************************************************************
114 * UnloadPerfCounterTextStringsA (loadperf.@)
115 *
116 * NOTES
117 * See UnloadPerfCounterTextStringsW
118 */
120{
121 DWORD ret;
122 LPWSTR cmdlineW = NULL;
123
124 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
125
126 ret = UnloadPerfCounterTextStringsW(cmdlineW, quiet);
127
128 HeapFree(GetProcessHeap(), 0, cmdlineW);
129
130 return ret;
131}
132
133/*************************************************************
134 * UnloadPerfCounterTextStringsW (loadperf.@)
135 *
136 * PARAMS
137 * cmdline [in] Last argument in command line - application counters to be removed
138 * quiet [in] FALSE - the function may write to stdout
139 *
140 */
142{
143 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
144
145 return ERROR_SUCCESS;
146}
#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 GetProcessHeap()
Definition: compat.h:736
#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
return ret
Definition: mutex.c:147
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
DWORD WINAPI LoadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
DWORD WINAPI LoadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
Definition: loadperf_main.c:84
DWORD WINAPI InstallPerfDllW(LPCWSTR computer, LPCWSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:72
DWORD WINAPI InstallPerfDllA(LPCSTR computer, LPCSTR ini, ULONG_PTR flags)
Definition: loadperf_main.c:49
DWORD WINAPI UnloadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
static WCHAR * strdupAW(const char *str)
Definition: loadperf_main.c:34
DWORD WINAPI UnloadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
short WCHAR
Definition: pedump.c:58
const WCHAR * str
TCHAR * cmdline
Definition: stretchblt.cpp:32
TConfig ini
Definition: tnconfig.cpp:45
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WINAPI
Definition: msvc.h:6