@@ -132,7 +132,7 @@ static bool BaseFile_Create(TFileStream * pStream)
132
132
return true ;
133
133
}
134
134
135
- static bool BaseFile_Open (TFileStream * pStream, const TCHAR * szFileName, DWORD dwStreamFlags)
135
+ static bool BaseFile_Open (TFileStream * pStream, const char * szFileName, DWORD dwStreamFlags)
136
136
{
137
137
#ifdef STORMLIB_WINDOWS
138
138
{
@@ -669,7 +669,7 @@ static void BaseMap_Init(TFileStream * pStream)
669
669
// -----------------------------------------------------------------------------
670
670
// Local functions - base HTTP file support
671
671
672
- static const TCHAR * BaseHttp_ExtractServerName (const TCHAR * szFileName, TCHAR * szServerName)
672
+ static const char * BaseHttp_ExtractServerName (const char * szFileName, char * szServerName)
673
673
{
674
674
// Check for HTTP
675
675
if (!_tcsnicmp (szFileName, _T (" http://" ), 7 ))
@@ -692,7 +692,7 @@ static const TCHAR * BaseHttp_ExtractServerName(const TCHAR * szFileName, TCHAR
692
692
return szFileName;
693
693
}
694
694
695
- static bool BaseHttp_Open (TFileStream * pStream, const TCHAR * szFileName, DWORD dwStreamFlags)
695
+ static bool BaseHttp_Open (TFileStream * pStream, const char * szFileName, DWORD dwStreamFlags)
696
696
{
697
697
#ifdef STORMLIB_WINDOWS
698
698
@@ -714,7 +714,7 @@ static bool BaseHttp_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
714
714
0 );
715
715
if (pStream->Base .Http .hInternet != NULL )
716
716
{
717
- TCHAR szServerName[MAX_PATH];
717
+ char szServerName[MAX_PATH];
718
718
DWORD dwFlags = INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE;
719
719
720
720
// Initiate connection with the server
@@ -739,7 +739,7 @@ static bool BaseHttp_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
739
739
DWORD dwFileSize = 0 ;
740
740
DWORD dwDataSize;
741
741
DWORD dwIndex = 0 ;
742
- TCHAR StatusCode[0x08 ];
742
+ char StatusCode[0x08 ];
743
743
744
744
// Check if the file succeeded to open
745
745
dwDataSize = sizeof (StatusCode);
@@ -816,7 +816,7 @@ static bool BaseHttp_Read(
816
816
HINTERNET hRequest;
817
817
LPCTSTR szFileName;
818
818
LPBYTE pbBuffer = (LPBYTE)pvBuffer;
819
- TCHAR szRangeRequest[0x80 ];
819
+ char szRangeRequest[0x80 ];
820
820
DWORD dwStartOffset = (DWORD)ByteOffset ;
821
821
DWORD dwEndOffset = dwStartOffset + dwBytesToRead;
822
822
@@ -1090,13 +1090,13 @@ static STREAM_INIT StreamBaseInit[4] =
1090
1090
// The stream structure is created as flat block, variable length
1091
1091
// The file name is placed after the end of the stream structure data
1092
1092
static TFileStream * AllocateFileStream (
1093
- const TCHAR * szFileName,
1093
+ const char * szFileName,
1094
1094
size_t StreamSize,
1095
1095
DWORD dwStreamFlags)
1096
1096
{
1097
1097
TFileStream * pMaster = NULL ;
1098
1098
TFileStream * pStream;
1099
- const TCHAR * szNextFile = szFileName;
1099
+ const char * szNextFile = szFileName;
1100
1100
size_t FileNameSize;
1101
1101
1102
1102
// Sanity check
@@ -1107,7 +1107,7 @@ static TFileStream * AllocateFileStream(
1107
1107
// In that case, we use the part after "*" as master file name
1108
1108
while (szNextFile[0 ] != 0 && szNextFile[0 ] != _T (' *' ))
1109
1109
szNextFile++;
1110
- FileNameSize = (size_t )((szNextFile - szFileName) * sizeof (TCHAR ));
1110
+ FileNameSize = (size_t )((szNextFile - szFileName) * sizeof (char ));
1111
1111
1112
1112
// If we have a next file, we need to open it as master stream
1113
1113
// Note that we don't care if the master stream exists or not,
@@ -1126,7 +1126,7 @@ static TFileStream * AllocateFileStream(
1126
1126
}
1127
1127
1128
1128
// Allocate the stream structure for the given stream type
1129
- pStream = (TFileStream *)STORM_ALLOC (BYTE, StreamSize + FileNameSize + sizeof (TCHAR ));
1129
+ pStream = (TFileStream *)STORM_ALLOC (BYTE, StreamSize + FileNameSize + sizeof (char ));
1130
1130
if (pStream != NULL )
1131
1131
{
1132
1132
// Zero the entire structure
@@ -1135,9 +1135,9 @@ static TFileStream * AllocateFileStream(
1135
1135
pStream->dwFlags = dwStreamFlags;
1136
1136
1137
1137
// Initialize the file name
1138
- pStream->szFileName = (TCHAR *)((BYTE *)pStream + StreamSize);
1138
+ pStream->szFileName = (char *)((BYTE *)pStream + StreamSize);
1139
1139
memcpy (pStream->szFileName , szFileName, FileNameSize);
1140
- pStream->szFileName [FileNameSize / sizeof (TCHAR )] = 0 ;
1140
+ pStream->szFileName [FileNameSize / sizeof (char )] = 0 ;
1141
1141
1142
1142
// Initialize the stream functions
1143
1143
StreamBaseInit[dwStreamFlags & 0x03 ](pStream);
@@ -1440,7 +1440,7 @@ static bool FlatStream_CreateMirror(TBlockStream * pStream)
1440
1440
return true ;
1441
1441
}
1442
1442
1443
- static TFileStream * FlatStream_Open (const TCHAR * szFileName, DWORD dwStreamFlags)
1443
+ static TFileStream * FlatStream_Open (const char * szFileName, DWORD dwStreamFlags)
1444
1444
{
1445
1445
TBlockStream * pStream;
1446
1446
ULONGLONG ByteOffset = 0 ;
@@ -1860,7 +1860,7 @@ static bool PartStream_CreateMirror(TBlockStream * pStream)
1860
1860
}
1861
1861
1862
1862
1863
- static TFileStream * PartStream_Open (const TCHAR * szFileName, DWORD dwStreamFlags)
1863
+ static TFileStream * PartStream_Open (const char * szFileName, DWORD dwStreamFlags)
1864
1864
{
1865
1865
TBlockStream * pStream;
1866
1866
@@ -2177,7 +2177,7 @@ static bool MpqeStream_BlockRead(
2177
2177
return true ;
2178
2178
}
2179
2179
2180
- static TFileStream * MpqeStream_Open (const TCHAR * szFileName, DWORD dwStreamFlags)
2180
+ static TFileStream * MpqeStream_Open (const char * szFileName, DWORD dwStreamFlags)
2181
2181
{
2182
2182
TEncryptedStream * pStream;
2183
2183
@@ -2306,14 +2306,14 @@ static void Block4Stream_Close(TBlockStream * pStream)
2306
2306
return ;
2307
2307
}
2308
2308
2309
- static TFileStream * Block4Stream_Open (const TCHAR * szFileName, DWORD dwStreamFlags)
2309
+ static TFileStream * Block4Stream_Open (const char * szFileName, DWORD dwStreamFlags)
2310
2310
{
2311
2311
TBaseProviderData * NewBaseArray = NULL ;
2312
2312
ULONGLONG RemainderBlock;
2313
2313
ULONGLONG BlockCount;
2314
2314
ULONGLONG FileSize;
2315
2315
TBlockStream * pStream;
2316
- TCHAR * szNameBuff;
2316
+ char * szNameBuff;
2317
2317
size_t nNameLength;
2318
2318
DWORD dwBaseFiles = 0 ;
2319
2319
DWORD dwBaseFlags;
@@ -2340,7 +2340,7 @@ static TFileStream * Block4Stream_Open(const TCHAR * szFileName, DWORD dwStreamF
2340
2340
pStream->BlockRead = (BLOCK_READ)Block4Stream_BlockRead;
2341
2341
2342
2342
// Allocate work space for numeric names
2343
- szNameBuff = STORM_ALLOC (TCHAR , nNameLength + 4 );
2343
+ szNameBuff = STORM_ALLOC (char , nNameLength + 4 );
2344
2344
if (szNameBuff != NULL )
2345
2345
{
2346
2346
// Set the base flags
@@ -2441,7 +2441,7 @@ static TFileStream * Block4Stream_Open(const TCHAR * szFileName, DWORD dwStreamF
2441
2441
*/
2442
2442
2443
2443
TFileStream * FileStream_CreateFile (
2444
- const TCHAR * szFileName,
2444
+ const char * szFileName,
2445
2445
DWORD dwStreamFlags)
2446
2446
{
2447
2447
TFileStream * pStream;
@@ -2497,7 +2497,7 @@ TFileStream * FileStream_CreateFile(
2497
2497
*/
2498
2498
2499
2499
TFileStream * FileStream_OpenFile (
2500
- const TCHAR * szFileName,
2500
+ const char * szFileName,
2501
2501
DWORD dwStreamFlags)
2502
2502
{
2503
2503
DWORD dwProvider = dwStreamFlags & STREAM_PROVIDERS_MASK;
@@ -2533,7 +2533,7 @@ TFileStream * FileStream_OpenFile(
2533
2533
*
2534
2534
* \a pStream Pointer to an open stream
2535
2535
*/
2536
- const TCHAR * FileStream_GetFileName (TFileStream * pStream)
2536
+ const char * FileStream_GetFileName (TFileStream * pStream)
2537
2537
{
2538
2538
assert (pStream != NULL );
2539
2539
return pStream->szFileName ;
@@ -2546,7 +2546,7 @@ const TCHAR * FileStream_GetFileName(TFileStream * pStream)
2546
2546
* \a pdwStreamProvider Pointer to a DWORD variable that receives stream provider (STREAM_PROVIDER_XXX)
2547
2547
*/
2548
2548
2549
- size_t FileStream_Prefix (const TCHAR * szFileName, DWORD * pdwProvider)
2549
+ size_t FileStream_Prefix (const char * szFileName, DWORD * pdwProvider)
2550
2550
{
2551
2551
size_t nPrefixLength1 = 0 ;
2552
2552
size_t nPrefixLength2 = 0 ;
0 commit comments