diff options
author | Ladislav <Zezula> | 2013-09-01 08:33:13 +0200 |
---|---|---|
committer | Ladislav <Zezula> | 2013-09-01 08:33:13 +0200 |
commit | 1e1e441c5e4104f77a3effafe67363c7113bf6bc (patch) | |
tree | a369208a91540731784ee759d97577084eed42ca /src | |
parent | 8207b80371412df167e9757a04d18bddf656206f (diff) |
+ Fixed bug in Windows 8
+ Minors
Diffstat (limited to 'src')
-rw-r--r-- | src/FileStream.cpp | 2 | ||||
-rw-r--r-- | src/SCompression.cpp | 5 | ||||
-rw-r--r-- | src/SFileAddFile.cpp | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/FileStream.cpp b/src/FileStream.cpp index 90bd176..8c49bfa 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -465,7 +465,7 @@ static bool BaseFile_Open( #ifdef PLATFORM_WINDOWS { ULARGE_INTEGER FileSize; - DWORD dwWriteAccess = (dwStreamFlags & STREAM_FLAG_READ_ONLY) ? 0 : GENERIC_ALL; + DWORD dwWriteAccess = (dwStreamFlags & STREAM_FLAG_READ_ONLY) ? 0 : GENERIC_READ | GENERIC_WRITE; DWORD dwWriteShare = (dwStreamFlags & STREAM_FLAG_WRITE_SHARE) ? FILE_SHARE_WRITE : 0; // Open the file diff --git a/src/SCompression.cpp b/src/SCompression.cpp index dc09be7..b8ac3d3 100644 --- a/src/SCompression.cpp +++ b/src/SCompression.cpp @@ -236,6 +236,7 @@ static void Compress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu { TDataInfo Info; // Data information char * work_buf = STORM_ALLOC(char, CMP_BUFFER_SIZE);// Pklib's work buffer +// char * work_buf = (char *)malloc(CMP_BUFFER_SIZE); // Pklib's work buffer unsigned int dict_size; // Dictionary size unsigned int ctype = CMP_BINARY; // Compression type @@ -253,8 +254,8 @@ static void Compress_PKLIB(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBu // // Set the dictionary size // - // Diablo I ues fixed dictionary size of CMP_IMPLODE_DICT_SIZE3 - // Starcraft uses the variable dictionary size based on algorithm below + // Diablo I uses fixed dictionary size of CMP_IMPLODE_DICT_SIZE3 + // Starcraft I uses the variable dictionary size based on algorithm below // if (cbInBuffer < 0x600) diff --git a/src/SFileAddFile.cpp b/src/SFileAddFile.cpp index b2b2fd2..57bae82 100644 --- a/src/SFileAddFile.cpp +++ b/src/SFileAddFile.cpp @@ -1270,7 +1270,8 @@ bool WINAPI SFileSetAddFileCallback(HANDLE hMpq, SFILE_ADDFILE_CALLBACK AddFileC { TMPQArchive * ha = (TMPQArchive *) hMpq; - if (!IsValidMpqHandle(ha)) { + if (!IsValidMpqHandle(ha)) + { SetLastError(ERROR_INVALID_HANDLE); return false; } |