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
29 #include "wine/debug.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
);
41 case DLL_WINE_PREATTACH
:
42 return FALSE
; /* prefer native version */
43 case DLL_PROCESS_ATTACH
:
44 DisableThreadLibraryCalls(hinstDLL
);
46 case DLL_PROCESS_DETACH
:
53 /*************************************************************
54 * LoadPerfCounterTextStringsA (loadperf.@)
57 * See LoadPerfCounterTextStringsW
59 DWORD WINAPI
LoadPerfCounterTextStringsA(LPCSTR cmdline
, BOOL quiet
)
62 LPWSTR cmdlineW
= NULL
;
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
= LoadPerfCounterTextStringsW(cmdlineW
, quiet
);
74 HeapFree(GetProcessHeap(), 0, cmdlineW
);
79 /*************************************************************
80 * LoadPerfCounterTextStringsW (loadperf.@)
83 * cmdline [in] Last argument in command line - ini file to be used
84 * quiet [in] FALSE - the function may write to stdout
87 DWORD WINAPI
LoadPerfCounterTextStringsW(LPCWSTR cmdline
, BOOL quiet
)
89 FIXME("(%s, %d): stub\n", debugstr_w(cmdline
), quiet
);
94 /*************************************************************
95 * UnloadPerfCounterTextStringsA (loadperf.@)
98 * See UnloadPerfCounterTextStringsW
100 DWORD WINAPI
UnloadPerfCounterTextStringsA(LPCSTR cmdline
, BOOL verbose
)
103 LPWSTR cmdlineW
= NULL
;
107 INT len
= MultiByteToWideChar(CP_ACP
, 0, cmdline
, -1, NULL
, 0);
108 cmdlineW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
109 if (!cmdlineW
) return ERROR_NOT_ENOUGH_MEMORY
;
110 MultiByteToWideChar(CP_ACP
, 0, cmdline
, -1, cmdlineW
, len
);
113 ret
= UnloadPerfCounterTextStringsW(cmdlineW
, verbose
);
115 HeapFree(GetProcessHeap(), 0, cmdlineW
);
120 /*************************************************************
121 * UnloadPerfCounterTextStringsW (loadperf.@)
124 * cmdline [in] Last argument in command line - application counters to be removed
125 * verbose [in] TRUE - the function may write to stdout
128 DWORD WINAPI
UnloadPerfCounterTextStringsW(LPCWSTR cmdline
, BOOL verbose
)
130 FIXME("(%s, %d): stub\n", debugstr_w(cmdline
), verbose
);
132 return ERROR_SUCCESS
;