- Fix handling of %2, %3, ... and lower case format characters in
[wine/testsucceed.git] / dlls / shlwapi / stopwatch.c
blob173d9a0c50bf749c5161a297c885266fc332f160
1 /*
2 * Stopwatch Functions
4 * Copyright 2004 Jon Griffiths
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * NOTES
21 * These functions probably never need to be implemented unless we
22 * A) Rewrite explorer from scratch, and
23 * B) Want to use a substandard API to tune its performance.
26 #include "config.h"
27 #include "wine/port.h"
29 #include <stdarg.h>
30 #include <string.h>
31 #include <stdlib.h>
33 #define NONAMELESSUNION
34 #define NONAMELESSSTRUCT
35 #include "wine/unicode.h"
36 #include "windef.h"
37 #include "winbase.h"
38 #include "wingdi.h"
39 #include "winuser.h"
40 #include "winreg.h"
41 #define NO_SHLWAPI_STREAM
42 #include "shlwapi.h"
43 #include "wine/debug.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(shell);
47 /*************************************************************************
48 * @ [SHLWAPI.241]
50 * Get the current performance monitoring mode.
52 * PARAMS
53 * None.
55 * RETURNS
56 * The current performance monitoring mode. This is zero if monitoring
57 * is disabled (the default).
59 * NOTES
60 * If this function returns 0, no further StopWatch functions should be called.
62 DWORD WINAPI StopWatchMode()
64 FIXME("() stub!\n");
65 return 0;
68 /*************************************************************************
69 * @ [SHLWAPI.242]
71 * Write captured performance nodes to a log file.
73 * PARAMS
74 * None.
76 * RETURNS
77 * Nothing.
79 void WINAPI StopWatchFlush()
81 FIXME("() stub!\n");
85 /*************************************************************************
86 * @ [SHLWAPI.243]
88 * Write a performance event to a log file
90 * PARAMS
91 * dwClass [I] Class of event
92 * lpszStr [I] Text of event to log
93 * dwUnknown [I] Unknown
94 * dwMode [I] Mode flags
95 * dwTimeStamp [I] Timestamp
97 * RETURNS
98 * Success: ERROR_SUCCESS.
99 * Failure: A standard Win32 error code indicating the failure.
101 DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
102 DWORD dwMode, DWORD dwTimeStamp)
104 FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_a(lpszStr),
105 dwUnknown, dwMode, dwTimeStamp);
106 return ERROR_SUCCESS;
109 /*************************************************************************
110 * @ [SHLWAPI.244]
112 * See StopWatchA.
114 DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
115 DWORD dwMode, DWORD dwTimeStamp)
117 char szBuff[MAX_PATH];
119 if(!WideCharToMultiByte(0, 0, lpszStr, -1, szBuff, MAX_PATH, 0, 0))
120 return ERROR_NOT_ENOUGH_MEMORY;
122 return StopWatchA(dwClass, szBuff, dwUnknown, dwMode, dwTimeStamp);
125 /*************************************************************************
126 * @ [SHLWAPI.245]
128 * Log a shell frame event.
130 * PARAMS
131 * hWnd [I] Window having the event
132 * pvUnknown1 [I] Unknown
133 * bUnknown2 [I] Unknown
134 * pClassWnd [I] Window of class to log
136 * RETURNS
137 * Nothing.
139 void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)
141 FIXME("(%p,%p,%d,%p) stub!\n", hWnd, pvUnknown1, bUnknown2 ,pClassWnd);
144 /* FIXME: Parameters for @246:StopWatch_CheckMsg unknown */
146 /*************************************************************************
147 * @ [SHLWAPI.247]
149 * Log the start of an applet.
151 * PARAMS
152 * lpszName [I] Name of the applet
154 * RETURNS
155 * Nothing.
157 void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName)
159 FIXME("(%s) stub!\n", debugstr_a(lpszName));
162 /* FIXME: Parameters for @248:StopWatch_MarkSameFrameStart unknown */
164 /*************************************************************************
165 * @ [SHLWAPI.249]
167 * Log a java applet stopping.
169 * PARAMS
170 * lpszEvent [I] Name of the event (applet)
171 * hWnd [I] Window running the applet
172 * dwReserved [I] Unused
174 * RETURNS
175 * Nothing.
177 void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved)
179 FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);
182 /*************************************************************************
183 * @ [SHLWAPI.250]
185 * Read the performance counter.
187 * PARAMS
188 * None.
190 * RETURNS
191 * The low 32 bits of the current performance counter reading.
193 DWORD WINAPI GetPerfTime()
195 static LONG64 iCounterFreq = 0;
196 LARGE_INTEGER iCounter;
198 TRACE("()\n");
200 if (!iCounterFreq)
201 QueryPerformanceFrequency((LARGE_INTEGER*)&iCounterFreq);
203 QueryPerformanceCounter(&iCounter);
204 iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq;
205 return iCounter.u.LowPart;
208 /* FIXME: Parameters for @251:StopWatch_DispatchTime unknown */
210 /*************************************************************************
211 * @ [SHLWAPI.252]
213 * Set an as yet unidentified performance value.
215 * PARAMS
216 * dwUnknown [I] Value to set
218 * RETURNS
219 * dwUnknown.
221 DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown)
223 FIXME("(%ld) stub!\n", dwUnknown);
225 return dwUnknown;
228 /* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */