[KERNEL32]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 11 Aug 2013 17:06:19 +0000 (17:06 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 11 Aug 2013 17:06:19 +0000 (17:06 +0000)
Fix the prototype of the undocumented function SetConsolePalette (see http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844 and https://github.com/harbour/core/commit/d79a1b7b812cbde6ddf718ebfd6939a24f633e52 for a usage example); tested by Mysoft a.k.a. Grégory Macario Harbs.
Needed for modifying VGA palettes for NTVDM.

svn path=/trunk/; revision=59697

reactos/dll/win32/kernel32/client/console/console.c
reactos/include/psdk/wincon.h

index ddb7bdf..6b43874 100644 (file)
@@ -712,16 +712,19 @@ SetConsoleMenuClose(BOOL bEnable)
 
 /*
  * @unimplemented (Undocumented)
 
 /*
  * @unimplemented (Undocumented)
+ * @note See http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844
+ *       Usage example: https://github.com/harbour/core/commit/d79a1b7b812cbde6ddf718ebfd6939a24f633e52
  */
 BOOL
 WINAPI
  */
 BOOL
 WINAPI
-SetConsolePalette(DWORD Unknown0,
-                  DWORD Unknown1,
-                  DWORD Unknown2)
+SetConsolePalette(HANDLE hConsoleOutput,
+                  HPALETTE hPalette,
+                  UINT dwUsage)
 {
 {
-    DPRINT1("SetConsolePalette(0x%x, 0x%x, 0x%x) UNIMPLEMENTED!\n", Unknown0, Unknown1, Unknown2);
+    DPRINT1("SetConsolePalette(0x%x, 0x%x, %d) UNIMPLEMENTED!\n", hConsoleOutput, hPalette, dwUsage);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return FALSE;
+    // Return TRUE so that we don't fail when being used by NTVDM even if not implemented.
+    return TRUE;
 }
 
 /*
 }
 
 /*
index 11744dd..6552854 100644 (file)
@@ -473,6 +473,8 @@ BOOL WINAPI SetConsoleMenuClose(_In_ BOOL);
 BOOL WINAPI SetConsoleCursor(_In_ HANDLE, _In_ HCURSOR);
 /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ShowConsoleCursor.php */
 INT WINAPI ShowConsoleCursor(_In_ HANDLE, _In_ BOOL);
 BOOL WINAPI SetConsoleCursor(_In_ HANDLE, _In_ HCURSOR);
 /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ShowConsoleCursor.php */
 INT WINAPI ShowConsoleCursor(_In_ HANDLE, _In_ BOOL);
+/* Undocumented, see http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844 */
+BOOL WINAPI SetConsolePalette(_In_ HANDLE, _In_ HPALETTE, _In_ UINT);
 
 BOOL WINAPI WriteConsoleA(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);
 BOOL WINAPI WriteConsoleW(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);
 
 BOOL WINAPI WriteConsoleA(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);
 BOOL WINAPI WriteConsoleW(HANDLE,CONST VOID*,DWORD,LPDWORD,LPVOID);