mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
[CABINET]
- Really use random temporary file name svn path=/trunk/; revision=56048
This commit is contained in:
parent
18a6ac6ae4
commit
4a78d2e988
1 changed files with 8 additions and 5 deletions
|
@ -115,7 +115,7 @@ CCFDATAStorage::~CCFDATAStorage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG CCFDATAStorage::Create(const char* FileName)
|
ULONG CCFDATAStorage::Create()
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Creates the file
|
* FUNCTION: Creates the file
|
||||||
* ARGUMENTS:
|
* ARGUMENTS:
|
||||||
|
@ -124,13 +124,16 @@ ULONG CCFDATAStorage::Create(const char* FileName)
|
||||||
* Status of operation
|
* Status of operation
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
char tmpPath[MAX_PATH];
|
||||||
|
#endif
|
||||||
ASSERT(!FileCreated);
|
ASSERT(!FileCreated);
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (GetTempPath(MAX_PATH, FullName) == 0)
|
if (GetTempPath(MAX_PATH, tmpPath) == 0)
|
||||||
|
return CAB_STATUS_CANNOT_CREATE;
|
||||||
|
if(GetTempFileName(tmpPath, "cab", 0, FullName) == 0)
|
||||||
return CAB_STATUS_CANNOT_CREATE;
|
return CAB_STATUS_CANNOT_CREATE;
|
||||||
|
|
||||||
strcat(FullName, FileName);
|
|
||||||
|
|
||||||
/* Create file, overwrite if it already exists */
|
/* Create file, overwrite if it already exists */
|
||||||
FileHandle = CreateFile(FullName, // Create this file
|
FileHandle = CreateFile(FullName, // Create this file
|
||||||
|
@ -1529,7 +1532,7 @@ ULONG CCabinet::NewCabinet()
|
||||||
return CAB_STATUS_NOMEMORY;
|
return CAB_STATUS_NOMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ScratchFile->Create("~CAB.tmp");
|
Status = ScratchFile->Create();
|
||||||
|
|
||||||
CreateNewFolder = false;
|
CreateNewFolder = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue