+
+ // expand the var expansions in the string unless disabled
+ if ( (dwType == REG_EXPAND_SZ) && !raw )
+ {
+ DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue, NULL, 0);
+ bool ok = dwExpSize != 0;
+ if ( ok )
+ {
+ wxString strExpValue;
+ ok = ::ExpandEnvironmentStrings
+ (
+ strValue,
+ strExpValue.GetWriteBuf(dwExpSize),
+ dwExpSize
+ ) != 0;
+ strExpValue.UngetWriteBuf();
+ strValue = strExpValue;
+ }
+
+ if ( !ok )
+ {
+ wxLogLastError(_T("ExpandEnvironmentStrings"));
+ }
+ }