aboutsummaryrefslogtreecommitdiff
path: root/src/FileStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FileStream.cpp')
-rw-r--r--src/FileStream.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/FileStream.cpp b/src/FileStream.cpp
index c73223c..84f36c0 100644
--- a/src/FileStream.cpp
+++ b/src/FileStream.cpp
@@ -652,6 +652,19 @@ static bool BaseHttp_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
DWORD dwFileSize = 0;
DWORD dwDataSize;
DWORD dwIndex = 0;
+ TCHAR StatusCode[0x08];
+
+ // Check if the file succeeded to open
+ dwDataSize = sizeof(StatusCode);
+ if(HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE, StatusCode, &dwDataSize, &dwIndex))
+ {
+ if(_tcscmp(StatusCode, _T("200")))
+ {
+ InternetCloseHandle(hRequest);
+ SetLastError(ERROR_FILE_NOT_FOUND);
+ return false;
+ }
+ }
// Check if the MPQ has Last Modified field
dwDataSize = sizeof(ULONGLONG);