Release 9.12.
[wine.git] / dlls / shlwapi / stopwatch.c
blob8a5d07b14e4305f15b9281c364d3686306be8366
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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 <stdarg.h>
27 #include <string.h>
28 #include <stdlib.h>
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winreg.h"
33 #include "winternl.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(shell);
38 /*************************************************************************
39 * @ [SHLWAPI.241]
41 * Get the current performance monitoring mode.
43 * PARAMS
44 * None.
46 * RETURNS
47 * The current performance monitoring mode. This is zero if monitoring
48 * is disabled (the default).
50 * NOTES
51 * If this function returns 0, no further StopWatch functions should be called.
53 DWORD WINAPI StopWatchMode(void)
55 FIXME("() stub!\n");
56 return 0;
59 /*************************************************************************
60 * @ [SHLWAPI.242]
62 * Write captured performance nodes to a log file.
64 * PARAMS
65 * None.
67 * RETURNS
68 * Nothing.
70 void WINAPI StopWatchFlush(void)
72 FIXME("() stub!\n");
75 /*************************************************************************
76 * @ [SHLWAPI.244]
78 * Write a performance event to a log file
80 * PARAMS
81 * dwClass [I] Class of event
82 * lpszStr [I] Text of event to log
83 * dwUnknown [I] Unknown
84 * dwMode [I] Mode flags
85 * dwTimeStamp [I] Timestamp
87 * RETURNS
88 * Success: ERROR_SUCCESS.
89 * Failure: A standard Win32 error code indicating the failure.
91 DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
92 DWORD dwMode, DWORD dwTimeStamp)
94 FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr),
95 dwUnknown, dwMode, dwTimeStamp);
96 return ERROR_SUCCESS;
99 /*************************************************************************
100 * @ [SHLWAPI.243]
102 * See StopWatchW.
104 DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
105 DWORD dwMode, DWORD dwTimeStamp)
106 { DWORD retval;
107 UNICODE_STRING szStrW;
109 if(lpszStr) RtlCreateUnicodeStringFromAsciiz(&szStrW, lpszStr);
110 else szStrW.Buffer = NULL;
112 retval = StopWatchW(dwClass, szStrW.Buffer, dwUnknown, dwMode, dwTimeStamp);
114 RtlFreeUnicodeString(&szStrW);
115 return retval;
118 /*************************************************************************
119 * @ [SHLWAPI.245]
121 * Log a shell frame event.
123 * PARAMS
124 * hWnd [I] Window having the event
125 * pvUnknown1 [I] Unknown
126 * bUnknown2 [I] Unknown
127 * pClassWnd [I] Window of class to log
129 * RETURNS
130 * Nothing.
132 void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)
134 FIXME("(%p,%p,%d,%p) stub!\n", hWnd, pvUnknown1, bUnknown2 ,pClassWnd);
137 /* FIXME: Parameters for @246:StopWatch_CheckMsg unknown */
139 /*************************************************************************
140 * @ [SHLWAPI.247]
142 * Log the start of an applet.
144 * PARAMS
145 * lpszName [I] Name of the applet
147 * RETURNS
148 * Nothing.
150 void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName)
152 FIXME("(%s) stub!\n", debugstr_a(lpszName));
155 /* FIXME: Parameters for @248:StopWatch_MarkSameFrameStart unknown */
157 /*************************************************************************
158 * @ [SHLWAPI.249]
160 * Log a java applet stopping.
162 * PARAMS
163 * lpszEvent [I] Name of the event (applet)
164 * hWnd [I] Window running the applet
165 * dwReserved [I] Unused
167 * RETURNS
168 * Nothing.
170 void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved)
172 FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);
175 /*************************************************************************
176 * @ [SHLWAPI.250]
178 * Read the performance counter.
180 * PARAMS
181 * None.
183 * RETURNS
184 * The low 32 bits of the current performance counter reading.
186 DWORD WINAPI GetPerfTime(void)
188 static LARGE_INTEGER iCounterFreq = { {0} };
189 LARGE_INTEGER iCounter;
191 TRACE("()\n");
193 if (!iCounterFreq.QuadPart)
194 QueryPerformanceFrequency(&iCounterFreq);
196 QueryPerformanceCounter(&iCounter);
197 iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq.QuadPart;
198 return iCounter.u.LowPart;
201 /* FIXME: Parameters for @251:StopWatch_DispatchTime unknown */
203 /*************************************************************************
204 * @ [SHLWAPI.252]
206 * Set an as yet unidentified performance value.
208 * PARAMS
209 * dwUnknown [I] Value to set
211 * RETURNS
212 * dwUnknown.
214 DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown)
216 FIXME("(%ld) stub!\n", dwUnknown);
218 return dwUnknown;
221 /* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */