Trying to redirect cmd screen to a file, but i am gettind Invalid_User_Buffer in WriteFile. After more reading at Microsoft I'm not sure if the calls redirect to screen output to a file, or they redirect the file to the screen.
; create file
invoke CreateFile, ADDR lpszSave_File_Name,\
GENERIC_READ or GENERIC_WRITE,\
FILE_SHARE_READ or FILE_SHARE_WRITE,\
NULL, CREATE_ALWAYS,\
FILE_ATTRIBUTE_NORMAL, NULL
mov hSaveCreateFile ,eax
; reset StdOut to file
invoke SetStdHandle, STD_OUTPUT_HANDLE, hSaveCreateFile
mov hConOut, eax
; set for console out write
invoke WriteFile, hSaveCreateFile, hConOut, FileBufferSize, ADDR dwBytesRead, 0