msvcrt/tests: Remove a space before a '\n'.
[wine/gsoc-2012-control.git] / dlls / loadperf / loadperf_main.c
blob35ce891cebc0665bf2cd80db313353fcb13ebaca
1 /*
2 * Implementation of loadperf.dll
4 * Copyright 2009 Andrey Turkin
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.
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.
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
21 #include "config.h"
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "winnls.h"
29 #include "wine/debug.h"
31 #include "loadperf.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(loadperf);
35 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
37 TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
39 switch(fdwReason)
41 case DLL_WINE_PREATTACH:
42 return FALSE; /* prefer native version */
43 case DLL_PROCESS_ATTACH:
44 DisableThreadLibraryCalls(hinstDLL);
45 break;
46 case DLL_PROCESS_DETACH:
47 break;
50 return TRUE;
53 static WCHAR *strdupAW(const char *str)
55 WCHAR *ret = NULL;
56 if (str)
58 INT len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
59 if (!(ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) return NULL;
60 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
62 return ret;
65 /*************************************************************
66 * InstallPerfDllA (loadperf.@)
68 DWORD WINAPI InstallPerfDllA(LPCSTR computer, LPCSTR ini, ULONG_PTR flags)
70 DWORD ret;
71 LPWSTR computerW = NULL, iniW = NULL;
73 if (computer && !(computerW = strdupAW(computer))) return ERROR_OUTOFMEMORY;
74 if (ini && !(iniW = strdupAW(ini)))
76 HeapFree(GetProcessHeap(), 0, computerW);
77 return ERROR_OUTOFMEMORY;
80 ret = InstallPerfDllW(computerW, iniW, flags);
82 HeapFree(GetProcessHeap(), 0, computerW);
83 HeapFree(GetProcessHeap(), 0, iniW);
85 return ret;
88 /*************************************************************
89 * InstallPerfDllW (loadperf.@)
91 DWORD WINAPI InstallPerfDllW(LPCWSTR computer, LPCWSTR ini, ULONG_PTR flags)
93 FIXME("(%s, %s, %lx)\n", debugstr_w(computer), debugstr_w(ini), flags);
94 return ERROR_SUCCESS;
97 /*************************************************************
98 * LoadPerfCounterTextStringsA (loadperf.@)
100 * NOTES
101 * See LoadPerfCounterTextStringsW
103 DWORD WINAPI LoadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
105 DWORD ret;
106 LPWSTR cmdlineW = NULL;
108 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
110 ret = LoadPerfCounterTextStringsW(cmdlineW, quiet);
112 HeapFree(GetProcessHeap(), 0, cmdlineW);
114 return ret;
117 /*************************************************************
118 * LoadPerfCounterTextStringsW (loadperf.@)
120 * PARAMS
121 * cmdline [in] Last argument in command line - ini file to be used
122 * quiet [in] FALSE - the function may write to stdout
125 DWORD WINAPI LoadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
127 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
129 return ERROR_SUCCESS;
132 /*************************************************************
133 * UnloadPerfCounterTextStringsA (loadperf.@)
135 * NOTES
136 * See UnloadPerfCounterTextStringsW
138 DWORD WINAPI UnloadPerfCounterTextStringsA(LPCSTR cmdline, BOOL quiet)
140 DWORD ret;
141 LPWSTR cmdlineW = NULL;
143 if (cmdline && !(cmdlineW = strdupAW(cmdline))) return ERROR_OUTOFMEMORY;
145 ret = UnloadPerfCounterTextStringsW(cmdlineW, quiet);
147 HeapFree(GetProcessHeap(), 0, cmdlineW);
149 return ret;
152 /*************************************************************
153 * UnloadPerfCounterTextStringsW (loadperf.@)
155 * PARAMS
156 * cmdline [in] Last argument in command line - application counters to be removed
157 * quiet [in] FALSE - the function may write to stdout
160 DWORD WINAPI UnloadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL quiet)
162 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), quiet);
164 return ERROR_SUCCESS;