diff win/edge.cpp @ 2127:663467f6eee4

Code cleanup: Add constants to header for dark mode, buffer sizes and Unicode support. Windows and OS/2 can both be built without Unicode support for legacy platforms and apps. Some new Windows features require Unicode (notifications, edge) and Unicode is buggy on OS/2. Can now check if Unicode is supported with the DW_FEATURE_UTF8_UNICODE feature test. Dark mode constants added DW_DARK_MODE_DISABLED/BASIC/FULL/FORCED. Win: Include dw.h in the WinToast glue for the constants, and improve safety in Edge glue.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 28 Jun 2020 20:34:25 +0000
parents f9a2fc59611c
children a8b55524b1b2
line wrap: on
line diff
--- a/win/edge.cpp	Sun Jun 28 05:39:08 2020 +0000
+++ b/win/edge.cpp	Sun Jun 28 20:34:25 2020 +0000
@@ -226,11 +226,12 @@
 
 BOOL EdgeBrowser::Detect(LPWSTR AppID)
 {
-	WCHAR tempdir[MAX_PATH+1] = {0};
+	// Combine two buffer lengths, ".WebView2\" (10) and a NULL
+	WCHAR tempdir[MAX_PATH+_DW_APP_ID_SIZE+11] = {0};
 
 	GetTempPathW(MAX_PATH, tempdir);
 	wcscat(tempdir, AppID);
-	wcscat(tempdir, L"\\");
+	wcscat(tempdir, L".WebView2\\");
 	CreateDirectoryW(tempdir, NULL);
 
 	CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr,