ReactOS 0.4.17-dev-357-ga8f14ff
stopwatch.c
Go to the documentation of this file.
1/*
2 * Stopwatch Functions
3 *
4 * Copyright 2004 Jon Griffiths
5 *
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.
10 *
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.
15 *
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
19 *
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.
24 */
25
26#include <stdarg.h>
27#include <string.h>
28#include <stdlib.h>
29
30#include "windef.h"
31#include "winbase.h"
32#include "winreg.h"
33#include "winternl.h"
34#include "wine/debug.h"
35
37
38/*************************************************************************
39 * @ [SHLWAPI.241]
40 *
41 * Get the current performance monitoring mode.
42 *
43 * PARAMS
44 * None.
45 *
46 * RETURNS
47 * The current performance monitoring mode. This is zero if monitoring
48 * is disabled (the default).
49 *
50 * NOTES
51 * If this function returns 0, no further StopWatch functions should be called.
52 */
54{
55 FIXME("() stub!\n");
56 return 0;
57}
58
59/*************************************************************************
60 * @ [SHLWAPI.242]
61 *
62 * Write captured performance nodes to a log file.
63 *
64 * PARAMS
65 * None.
66 *
67 * RETURNS
68 * Nothing.
69 */
71{
72 FIXME("() stub!\n");
73}
74
75/*************************************************************************
76 * @ [SHLWAPI.244]
77 *
78 * Write a performance event to a log file
79 *
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
86 *
87 * RETURNS
88 * Success: ERROR_SUCCESS.
89 * Failure: A standard Win32 error code indicating the failure.
90 */
91DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
92 DWORD dwMode, DWORD dwTimeStamp)
93{
94 FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr),
95 dwUnknown, dwMode, dwTimeStamp);
96 return ERROR_SUCCESS;
97}
98
99/*************************************************************************
100 * @ [SHLWAPI.243]
101 *
102 * See StopWatchW.
103 */
104DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
105 DWORD dwMode, DWORD dwTimeStamp)
106{ DWORD retval;
107 UNICODE_STRING szStrW;
108
109 if(lpszStr) RtlCreateUnicodeStringFromAsciiz(&szStrW, lpszStr);
110 else szStrW.Buffer = NULL;
111
112 retval = StopWatchW(dwClass, szStrW.Buffer, dwUnknown, dwMode, dwTimeStamp);
113
114 RtlFreeUnicodeString(&szStrW);
115 return retval;
116}
117
118/*************************************************************************
119 * @ [SHLWAPI.245]
120 *
121 * Log a shell frame event.
122 *
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
128 *
129 * RETURNS
130 * Nothing.
131 */
132void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)
133{
134 FIXME("(%p,%p,%d,%p) stub!\n", hWnd, pvUnknown1, bUnknown2 ,pClassWnd);
135}
136
137/* FIXME: Parameters for @246:StopWatch_CheckMsg unknown */
138
139/*************************************************************************
140 * @ [SHLWAPI.247]
141 *
142 * Log the start of an applet.
143 *
144 * PARAMS
145 * lpszName [I] Name of the applet
146 *
147 * RETURNS
148 * Nothing.
149 */
151{
152 FIXME("(%s) stub!\n", debugstr_a(lpszName));
153}
154
155/* FIXME: Parameters for @248:StopWatch_MarkSameFrameStart unknown */
156
157/*************************************************************************
158 * @ [SHLWAPI.249]
159 *
160 * Log a java applet stopping.
161 *
162 * PARAMS
163 * lpszEvent [I] Name of the event (applet)
164 * hWnd [I] Window running the applet
165 * dwReserved [I] Unused
166 *
167 * RETURNS
168 * Nothing.
169 */
171{
172 FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);
173}
174
175/*************************************************************************
176 * @ [SHLWAPI.250]
177 *
178 * Read the performance counter.
179 *
180 * PARAMS
181 * None.
182 *
183 * RETURNS
184 * The low 32 bits of the current performance counter reading.
185 */
187{
188 static LARGE_INTEGER iCounterFreq = { {0} };
189 LARGE_INTEGER iCounter;
190
191 TRACE("()\n");
192
193 if (!iCounterFreq.QuadPart)
194 QueryPerformanceFrequency(&iCounterFreq);
195
196 QueryPerformanceCounter(&iCounter);
197 iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq.QuadPart;
198 return iCounter.u.LowPart;
199}
200
201/* FIXME: Parameters for @251:StopWatch_DispatchTime unknown */
202
203/*************************************************************************
204 * @ [SHLWAPI.252]
205 *
206 * Set an as yet unidentified performance value.
207 *
208 * PARAMS
209 * dwUnknown [I] Value to set
210 *
211 * RETURNS
212 * dwUnknown.
213 */
215{
216 FIXME("(%ld) stub!\n", dwUnknown);
217
218 return dwUnknown;
219}
220
221/* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown)
Definition: stopwatch.c:214
DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown, DWORD dwMode, DWORD dwTimeStamp)
Definition: stopwatch.c:91
void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved)
Definition: stopwatch.c:170
DWORD WINAPI StopWatchMode(void)
Definition: stopwatch.c:53
void WINAPI StopWatchFlush(void)
Definition: stopwatch.c:70
DWORD WINAPI GetPerfTime(void)
Definition: stopwatch.c:186
DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown, DWORD dwMode, DWORD dwTimeStamp)
Definition: stopwatch.c:104
void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName)
Definition: stopwatch.c:150
void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)
Definition: stopwatch.c:132
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2513 u
int retval
Definition: wcstombs.cpp:91
#define WINAPI
Definition: msvc.h:6