summaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/sceutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/sceutil.cpp')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/sceutil.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/sceutil.cpp b/src/libs/dutil/WixToolset.DUtil/sceutil.cpp
index 4eede74f..590c937a 100644
--- a/src/libs/dutil/WixToolset.DUtil/sceutil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/sceutil.cpp
@@ -317,7 +317,7 @@ extern "C" HRESULT DAPI SceOpenDatabase(
317{ 317{
318 HRESULT hr = S_OK; 318 HRESULT hr = S_OK;
319 DWORD dwVersionFound = 0; 319 DWORD dwVersionFound = 0;
320 WCHAR wzTempDbFile[MAX_PATH]; 320 LPWSTR sczTempDbFile = NULL;
321 LPCWSTR wzPathToOpen = NULL; 321 LPCWSTR wzPathToOpen = NULL;
322 LPWSTR sczSchemaType = NULL; 322 LPWSTR sczSchemaType = NULL;
323 SCE_DATABASE *pNewSceDatabase = NULL; 323 SCE_DATABASE *pNewSceDatabase = NULL;
@@ -343,16 +343,16 @@ extern "C" HRESULT DAPI SceOpenDatabase(
343 // TODO: had trouble getting SQL CE to read a file read-only, so we're copying it to a temp path for now. 343 // TODO: had trouble getting SQL CE to read a file read-only, so we're copying it to a temp path for now.
344 if (fReadOnly) 344 if (fReadOnly)
345 { 345 {
346 hr = DirCreateTempPath(PathFile(sczFile), (LPWSTR)wzTempDbFile, _countof(wzTempDbFile)); 346 hr = DirCreateTempPath(PathFile(sczFile), &sczTempDbFile);
347 ExitOnFailure(hr, "Failed to get temp path"); 347 ExitOnFailure(hr, "Failed to get temp path");
348 348
349 hr = FileEnsureCopy(sczFile, (LPCWSTR)wzTempDbFile, TRUE); 349 hr = FileEnsureCopy(sczFile, sczTempDbFile, TRUE);
350 ExitOnFailure(hr, "Failed to copy file to temp path"); 350 ExitOnFailure(hr, "Failed to copy file to temp path");
351 351
352 hr = StrAllocString(&pNewSceDatabaseInternal->sczTempDbFile, (LPCWSTR)wzTempDbFile, 0); 352 hr = StrAllocString(&pNewSceDatabaseInternal->sczTempDbFile, sczTempDbFile, 0);
353 ExitOnFailure(hr, "Failed to copy temp db file path"); 353 ExitOnFailure(hr, "Failed to copy temp db file path");
354 354
355 wzPathToOpen = (LPCWSTR)wzTempDbFile; 355 wzPathToOpen = sczTempDbFile;
356 } 356 }
357 else 357 else
358 { 358 {
@@ -424,6 +424,7 @@ extern "C" HRESULT DAPI SceOpenDatabase(
424LExit: 424LExit:
425 ReleaseBSTR(rgdbpDataSourceProp[0].vValue.bstrVal); 425 ReleaseBSTR(rgdbpDataSourceProp[0].vValue.bstrVal);
426 ReleaseStr(sczSchemaType); 426 ReleaseStr(sczSchemaType);
427 ReleaseStr(sczTempDbFile);
427 ReleaseDatabase(pNewSceDatabase); 428 ReleaseDatabase(pNewSceDatabase);
428 429
429 return hr; 430 return hr;