set svn:eol-style to native
[reactos.git] / reactos / lib / shlwapi / stopwatch.c
index 406c082..4e092a4 100644 (file)
-/*\r
- * Stopwatch Functions\r
- *\r
- * Copyright 2004 Jon Griffiths\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- *\r
- * NOTES\r
- * These functions probably never need to be implemented unless we\r
- * A) Rewrite explorer from scratch, and\r
- * B) Want to use a substandard API to tune its performance.\r
- */\r
-\r
-#include "config.h"\r
-#include "wine/port.h"\r
-\r
-#include <stdarg.h>\r
-#include <string.h>\r
-#include <stdlib.h>\r
-\r
-#define NONAMELESSUNION\r
-#define NONAMELESSSTRUCT\r
-#include "windef.h"\r
-#include "winbase.h"\r
-#include "winreg.h"\r
-#include "winternl.h"\r
-#include "wine/debug.h"\r
-\r
-WINE_DEFAULT_DEBUG_CHANNEL(shell);\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.241]\r
- *\r
- * Get the current performance monitoring mode.\r
- *\r
- * PARAMS\r
- *  None.\r
- *\r
- * RETURNS\r
- *  The current performance monitoring mode. This is zero if monitoring\r
- *  is disabled (the default).\r
- *\r
- * NOTES\r
- *  If this function returns 0, no further StopWatch functions should be called.\r
- */\r
-DWORD WINAPI StopWatchMode()\r
-{\r
-  FIXME("() stub!\n");\r
-  return 0;\r
-}\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.242]\r
- *\r
- * Write captured performance nodes to a log file.\r
- *\r
- * PARAMS\r
- *  None.\r
- *\r
- * RETURNS\r
- *  Nothing.\r
- */\r
-void WINAPI StopWatchFlush()\r
-{\r
-  FIXME("() stub!\n");\r
-}\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.244]\r
- *\r
- * Write a performance event to a log file\r
- *\r
- * PARAMS\r
- *  dwClass     [I] Class of event\r
- *  lpszStr     [I] Text of event to log\r
- *  dwUnknown   [I] Unknown\r
- *  dwMode      [I] Mode flags\r
- *  dwTimeStamp [I] Timestamp\r
- *\r
- * RETURNS\r
- *  Success: ERROR_SUCCESS.\r
- *  Failure: A standard Win32 error code indicating the failure.\r
- */\r
-DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,\r
-                        DWORD dwMode, DWORD dwTimeStamp)\r
-{\r
-    FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr),\r
-        dwUnknown, dwMode, dwTimeStamp);\r
-  return ERROR_SUCCESS;\r
-}\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.243]\r
- *\r
- * See StopWatchW.\r
- */\r
-DWORD WINAPI StopWatchA(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,\r
-                        DWORD dwMode, DWORD dwTimeStamp)\r
-{   DWORD retval;\r
-    UNICODE_STRING szStrW;\r
-\r
-    if(lpszStr) RtlCreateUnicodeStringFromAsciiz(&szStrW, lpszStr);\r
-    else szStrW.Buffer = NULL;\r
-\r
-    retval = StopWatchW(dwClass, szStrW.Buffer, dwUnknown, dwMode, dwTimeStamp);\r
-\r
-    RtlFreeUnicodeString(&szStrW);\r
-    return retval;\r
-}\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.245]\r
- *\r
- * Log a shell frame event.\r
- *\r
- * PARAMS\r
- *  hWnd       [I] Window having the event\r
- *  pvUnknown1 [I] Unknown\r
- *  bUnknown2  [I] Unknown\r
- *  pClassWnd  [I] Window of class to log\r
- *\r
- * RETURNS\r
- *  Nothing.\r
- */\r
-void WINAPI StopWatch_TimerHandler(HWND hWnd, PVOID pvUnknown1, BOOL bUnknown2, HWND *pClassWnd)\r
-{\r
-  FIXME("(%p,%p,%d,%p) stub!\n", hWnd, pvUnknown1, bUnknown2 ,pClassWnd);\r
-}\r
-\r
-/* FIXME: Parameters for @246:StopWatch_CheckMsg unknown */\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.247]\r
- *\r
- * Log the start of an applet.\r
- *\r
- * PARAMS\r
- *  lpszName [I] Name of the applet\r
- *\r
- * RETURNS\r
- *  Nothing.\r
- */\r
-void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName)\r
-{\r
-  FIXME("(%s) stub!\n", debugstr_a(lpszName));\r
-}\r
-\r
-/* FIXME: Parameters for @248:StopWatch_MarkSameFrameStart unknown */\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.249]\r
- *\r
- * Log a java applet stopping.\r
- *\r
- * PARAMS\r
- *  lpszEvent  [I] Name of the event (applet)\r
- *  hWnd       [I] Window running the applet\r
- *  dwReserved [I] Unused\r
- *\r
- * RETURNS\r
- *  Nothing.\r
- */\r
-void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved)\r
-{\r
-  FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);\r
-}\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.250]\r
- *\r
- * Read the performance counter.\r
- *\r
- * PARAMS\r
- *  None.\r
- *\r
- * RETURNS\r
- *  The low 32 bits of the current performance counter reading.\r
- */\r
-DWORD WINAPI GetPerfTime()\r
-{\r
-  static LONG64 iCounterFreq = 0;\r
-  LARGE_INTEGER iCounter;\r
-\r
-  TRACE("()\n");\r
-\r
-  if (!iCounterFreq)\r
-   QueryPerformanceFrequency((LARGE_INTEGER*)&iCounterFreq);\r
-\r
-  QueryPerformanceCounter(&iCounter);\r
-  iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq;\r
-  return iCounter.u.LowPart;\r
-}\r
-\r
-/* FIXME: Parameters for @251:StopWatch_DispatchTime unknown */\r
-\r
-/*************************************************************************\r
- *      @      [SHLWAPI.252]\r
- *\r
- * Set an as yet unidentified performance value.\r
- *\r
- * PARAMS\r
- *  dwUnknown [I] Value to set\r
- *\r
- * RETURNS\r
- *  dwUnknown.\r
- */\r
-DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown)\r
-{\r
-  FIXME("(%ld) stub!\n", dwUnknown);\r
-\r
-  return dwUnknown;\r
-}\r
-\r
-/* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */\r
+/*
+ * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * 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.
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "windef.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "winternl.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
+
+/*************************************************************************
+ *      @      [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.
+ */
+DWORD WINAPI StopWatchMode()
+{
+  FIXME("() stub!\n");
+  return 0;
+}
+
+/*************************************************************************
+ *      @      [SHLWAPI.242]
+ *
+ * Write captured performance nodes to a log file.
+ *
+ * PARAMS
+ *  None.
+ *
+ * RETURNS
+ *  Nothing.
+ */
+void WINAPI StopWatchFlush()
+{
+  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)
+{
+    FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr),
+        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)
+{
+  FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved);
+}
+
+/*************************************************************************
+ *      @      [SHLWAPI.250]
+ *
+ * Read the performance counter.
+ *
+ * PARAMS
+ *  None.
+ *
+ * RETURNS
+ *  The low 32 bits of the current performance counter reading.
+ */
+DWORD WINAPI GetPerfTime()
+{
+  static LONG64 iCounterFreq = 0;
+  LARGE_INTEGER iCounter;
+
+  TRACE("()\n");
+
+  if (!iCounterFreq)
+   QueryPerformanceFrequency((LARGE_INTEGER*)&iCounterFreq);
+
+  QueryPerformanceCounter(&iCounter);
+  iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq;
+  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)
+{
+  FIXME("(%ld) stub!\n", dwUnknown);
+
+  return dwUnknown;
+}
+
+/* FIXME: Parameters for @253:StopWatchExA, 254:StopWatchExW unknown */