[SHELL-EXPERIMENTS]
[reactos.git] / dll / win32 / kernel32 / client / console / readwrite.c
index f1818a0..e231b41 100644 (file)
  * Read functions *
  ******************/
 
-DWORD
-WINAPI
-GetConsoleInputExeNameW(DWORD nBufferLength, LPWSTR lpBuffer);
-
 static
 BOOL
 IntReadConsole(IN HANDLE hConsoleInput,
@@ -58,26 +54,12 @@ IntReadConsole(IN HANDLE hConsoleInput,
     ReadConsoleRequest->Unicode       = bUnicode;
 
     /*
-     * Retrieve the current console executable name string and length (always
-     * in UNICODE format).
-     * FIXME: Do not use GetConsoleInputExeNameW but use something else...
+     * Retrieve the (current) Input EXE name string and length,
+     * not NULL-terminated (always in UNICODE format).
      */
-    // 1- Get the exe name length in characters, including NULL character.
     ReadConsoleRequest->ExeLength =
-        (USHORT)GetConsoleInputExeNameW(0, (PWCHAR)ReadConsoleRequest->StaticBuffer);
-    // 2- Get the exe name (GetConsoleInputExeNameW returns 1 in case of success).
-    if (GetConsoleInputExeNameW(ReadConsoleRequest->ExeLength,
-                                (PWCHAR)ReadConsoleRequest->StaticBuffer) != 1)
-    {
-        // Nothing
-        ReadConsoleRequest->ExeLength = 0;
-    }
-    else
-    {
-        // Remove the NULL character, and convert in number of bytes.
-        ReadConsoleRequest->ExeLength--;
-        ReadConsoleRequest->ExeLength *= sizeof(WCHAR);
-    }
+        GetCurrentExeName((PWCHAR)ReadConsoleRequest->StaticBuffer,
+                          sizeof(ReadConsoleRequest->StaticBuffer));
 
     /*** For DEBUGGING purposes ***/
     {
@@ -181,7 +163,7 @@ IntReadConsole(IN HANDLE hConsoleInput,
     }
     _SEH2_END;
 
-    /* Check for sanity */
+    /* FIXME: Check for sanity */
 /*
     if (!NT_SUCCESS(Status) && pInputControl)
     {
@@ -1185,9 +1167,7 @@ IntFillConsoleOutputCode(IN HANDLE hConsoleOutput,
  * Read functions *
  ******************/
 
-/*--------------------------------------------------------------
- *    ReadConsoleW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1207,9 +1187,7 @@ ReadConsoleW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *    ReadConsoleA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1229,9 +1207,7 @@ ReadConsoleA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     PeekConsoleInputW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1250,9 +1226,7 @@ PeekConsoleInputW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     PeekConsoleInputA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1271,9 +1245,7 @@ PeekConsoleInputA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleInputW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1292,9 +1264,7 @@ ReadConsoleInputW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleInputA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1313,9 +1283,7 @@ ReadConsoleInputA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleInputExW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1335,9 +1303,7 @@ ReadConsoleInputExW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleInputExA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1357,9 +1323,7 @@ ReadConsoleInputExA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleOutputW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1379,9 +1343,7 @@ ReadConsoleOutputW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleOutputA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1401,9 +1363,7 @@ ReadConsoleOutputA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *      ReadConsoleOutputCharacterW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1423,9 +1383,7 @@ ReadConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleOutputCharacterA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1445,9 +1403,7 @@ ReadConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     ReadConsoleOutputAttribute
- *
+/*
  * @implemented
  */
 BOOL
@@ -1471,9 +1427,7 @@ ReadConsoleOutputAttribute(IN HANDLE hConsoleOutput,
  * Write functions *
  *******************/
 
-/*--------------------------------------------------------------
- *    WriteConsoleW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1493,9 +1447,7 @@ WriteConsoleW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *    WriteConsoleA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1515,9 +1467,7 @@ WriteConsoleA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleInputW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1536,9 +1486,7 @@ WriteConsoleInputW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleInputA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1557,9 +1505,7 @@ WriteConsoleInputA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleInputVDMW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1578,9 +1524,7 @@ WriteConsoleInputVDMW(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleInputVDMA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1599,9 +1543,7 @@ WriteConsoleInputVDMA(IN HANDLE hConsoleInput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleOutputW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1621,9 +1563,7 @@ WriteConsoleOutputW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleOutputA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1643,9 +1583,7 @@ WriteConsoleOutputA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleOutputCharacterW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1665,9 +1603,7 @@ WriteConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleOutputCharacterA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1687,9 +1623,7 @@ WriteConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     WriteConsoleOutputAttribute
- *
+/*
  * @implemented
  */
 BOOL
@@ -1709,9 +1643,7 @@ WriteConsoleOutputAttribute(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *    FillConsoleOutputCharacterW
- *
+/*
  * @implemented
  */
 BOOL
@@ -1733,9 +1665,7 @@ FillConsoleOutputCharacterW(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *    FillConsoleOutputCharacterA
- *
+/*
  * @implemented
  */
 BOOL
@@ -1757,9 +1687,7 @@ FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput,
 }
 
 
-/*--------------------------------------------------------------
- *     FillConsoleOutputAttribute
- *
+/*
  * @implemented
  */
 BOOL