2005-07-31 12:11:56 +00:00
|
|
|
/*
|
|
|
|
* Stopwatch Functions
|
|
|
|
*
|
|
|
|
* Copyright 2004 Jon Griffiths
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2007-08-07 07:27:43 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-07-31 12:11:56 +00:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* These functions probably never need to be implemented unless we
|
|
|
|
* A) Rewrite explorer from scratch, and
|
|
|
|
* B) Want to use a substandard API to tune its performance.
|
|
|
|
*/
|
|
|
|
|
2013-12-27 13:34:32 +00:00
|
|
|
#include "precomp.h"
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.241]
|
|
|
|
*
|
|
|
|
* Get the current performance monitoring mode.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* None.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* The current performance monitoring mode. This is zero if monitoring
|
|
|
|
* is disabled (the default).
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* If this function returns 0, no further StopWatch functions should be called.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
DWORD WINAPI StopWatchMode(void)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
FIXME("() stub!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.242]
|
|
|
|
*
|
|
|
|
* Write captured performance nodes to a log file.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* None.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
void WINAPI StopWatchFlush(void)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
FIXME("() stub!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.244]
|
|
|
|
*
|
|
|
|
* Write a performance event to a log file
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwClass [I] Class of event
|
|
|
|
* lpszStr [I] Text of event to log
|
|
|
|
* dwUnknown [I] Unknown
|
|
|
|
* dwMode [I] Mode flags
|
|
|
|
* dwTimeStamp [I] Timestamp
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: ERROR_SUCCESS.
|
|
|
|
* Failure: A standard Win32 error code indicating the failure.
|
|
|
|
*/
|
|
|
|
DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
|
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
FIXME("(%d,%s,%d,%d,%d) stub!\n", dwClass, debugstr_w(lpszStr),
|
2005-07-31 12:11:56 +00:00
|
|
|
dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.243]
|
|
|
|
*
|
|
|
|
* See StopWatchW.
|
|
|
|
*/
|
|
|
|
DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
|
|
|
|
DWORD dwMode, DWORD dwTimeStamp)
|
|
|
|
{ DWORD retval;
|
|
|
|
UNICODE_STRING szStrW;
|
|
|
|
|
|
|
|
if(lpszStr) RtlCreateUnicodeStringFromAsciiz(&szStrW, lpszStr);
|
|
|
|
else szStrW.Buffer = NULL;
|
|
|
|
|
|
|
|
retval = StopWatchW(dwClass, szStrW.Buffer, dwUnknown, dwMode, dwTimeStamp);
|
|
|
|
|
|
|
|
RtlFreeUnicodeString(&szStrW);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.245]
|
|
|
|
*
|
|
|
|
* Log a shell frame event.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* hWnd [I] Window having the event
|
|
|
|
* pvUnknown1 [I] Unknown
|
|
|
|
* bUnknown2 [I] Unknown
|
|
|
|
* pClassWnd [I] Window of class to log
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%p,%d,%p) stub!\n", hWnd, pvUnknown1, bUnknown2 ,pClassWnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Parameters for @246:StopWatch_CheckMsg unknown */
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.247]
|
|
|
|
*
|
|
|
|
* Log the start of an applet.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpszName [I] Name of the applet
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName)
|
|
|
|
{
|
|
|
|
FIXME("(%s) stub!\n", debugstr_a(lpszName));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Parameters for @248:StopWatch_MarkSameFrameStart unknown */
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.249]
|
|
|
|
*
|
|
|
|
* Log a java applet stopping.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpszEvent [I] Name of the event (applet)
|
|
|
|
* hWnd [I] Window running the applet
|
|
|
|
* dwReserved [I] Unused
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*/
|
|
|
|
void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved)
|
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
FIXME("(%s,%p,0x%08x) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);
|
2005-07-31 12:11:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.250]
|
|
|
|
*
|
|
|
|
* Read the performance counter.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* None.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* The low 32 bits of the current performance counter reading.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
DWORD WINAPI GetPerfTime(void)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2016-03-05 10:20:00 +00:00
|
|
|
static LARGE_INTEGER iCounterFreq = { {0} };
|
2005-07-31 12:11:56 +00:00
|
|
|
LARGE_INTEGER iCounter;
|
|
|
|
|
|
|
|
TRACE("()\n");
|
|
|
|
|
2016-03-05 10:20:00 +00:00
|
|
|
if (!iCounterFreq.QuadPart)
|
|
|
|
QueryPerformanceFrequency(&iCounterFreq);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
QueryPerformanceCounter(&iCounter);
|
2016-03-05 10:20:00 +00:00
|
|
|
iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq.QuadPart;
|
2005-07-31 12:11:56 +00:00
|
|
|
return iCounter.u.LowPart;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Parameters for @251:StopWatch_DispatchTime unknown */
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.252]
|
|
|
|
*
|
|
|
|
* Set an as yet unidentified performance value.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* dwUnknown [I] Value to set
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* dwUnknown.
|
|
|
|
*/
|
|
|
|
DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown)
|
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
FIXME("(%d) stub!\n", dwUnknown);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
return dwUnknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */
|