| 862 | } |
| 863 | |
| 864 | bool WINAPI SFileFinishFile(HANDLE hFile) |
| 865 | { |
| 866 | TMPQFile * hf = (TMPQFile *)hFile; |
| 867 | DWORD dwErrCode = ERROR_SUCCESS; |
| 868 | |
| 869 | // Check the proper parameters |
| 870 | if(!IsValidFileHandle(hFile)) |
| 871 | dwErrCode = ERROR_INVALID_HANDLE; |
| 872 | if(hf->bIsWriteHandle == false) |
| 873 | dwErrCode = ERROR_INVALID_HANDLE; |
| 874 | |
| 875 | // Finish the file |
| 876 | if(dwErrCode == ERROR_SUCCESS) |
| 877 | dwErrCode = SFileAddFile_Finish(hf); |
| 878 | |
| 879 | // Deal with errors |
| 880 | if(dwErrCode != ERROR_SUCCESS) |
| 881 | SetLastError(dwErrCode); |
| 882 | return (dwErrCode == ERROR_SUCCESS); |
| 883 | } |
| 884 | |
| 885 | //----------------------------------------------------------------------------- |
| 886 | // Adds a file to the archive |
no test coverage detected