Here is the book question:Modify the CatFile function in the program so that it uses  WriteConsole rather than WriteFile when the standard output handle  is associated with a console.And here is my solution:static VOID CatFile(HANDLE hInFile, HANDLE hOutFile){    DWORD nIn, nOut;    TCHAR buffer[BUF_SIZE];    LPTSTR pBuffer = &buffer[0];    while (ReadFile(hInFile, buffer, BUF_SIZE, &nIn, NULL) &&        (nIn != 0) &&        (WriteFile(hOutFile, buffer, nIn, &nOut, NULL) || WriteConsole(hOutFile, pBuffer, _tcslen(pBuffer), &nOut, NULL)));    return;}The part from the || sign in the code above is my addition to the code.My question is to know if that would work once WriteFile wouldn't be TRUE since hOutFile is a handle of a console?Another part of the question is just about the WriteConsole function: are these the correct arguments?
Is my WriteConsole solution correct?
c;windows;console