push bf834a7eef2241618d351018da1587a7ae2466d1
[wine/hacks.git] / dlls / loadperf / loadperf_main.c
blob8dbfab7c394109687d9a82d245bf710197d26133
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 /*************************************************************
54 * UnloadPerfCounterTextStringsA (loadperf.@)
56 * NOTES
57 * See UnloadPerfCounterTextStringsW
59 DWORD WINAPI UnloadPerfCounterTextStringsA(LPCSTR cmdline, BOOL verbose)
61 DWORD ret;
62 LPWSTR cmdlineW = NULL;
64 if (cmdline)
66 INT len = MultiByteToWideChar(CP_ACP, 0, cmdline, -1, NULL, 0);
67 cmdlineW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
68 if (!cmdlineW) return ERROR_NOT_ENOUGH_MEMORY;
69 MultiByteToWideChar(CP_ACP, 0, cmdline, -1, cmdlineW, len);
72 ret = UnloadPerfCounterTextStringsW(cmdlineW, verbose);
74 HeapFree(GetProcessHeap(), 0, cmdlineW);
76 return ret;
79 /*************************************************************
80 * UnloadPerfCounterTextStringsW (loadperf.@)
82 * PARAMS
83 * cmdline [in] Last argument in command line - application counters to be removed
84 * verbose [in] TRUE - the function may write to stdout
87 DWORD WINAPI UnloadPerfCounterTextStringsW(LPCWSTR cmdline, BOOL verbose)
89 FIXME("(%s, %d): stub\n", debugstr_w(cmdline), verbose);
91 return ERROR_SUCCESS;