@@ -56,9 +56,12 @@ public enum TYPE {
5656 private const int IMPORT_TIMEOUT = 60 ;
5757 private const string IMPORT_RESUME = "FLASHPOINTSECUREPLAYERREGISTRYSTATEIMPORTRESUME" ;
5858 private const string IMPORT_PAUSE = "FLASHPOINTSECUREPLAYERREGISTRYSTATEIMPORTPAUSE" ;
59+
5960 private readonly object activationLock = new object ( ) ;
6061 private readonly object deactivationLock = new object ( ) ;
62+
6163 private string fullPath = null ;
64+ private PathNames pathNames = null ;
6265 private EventWaitHandle resumeEventWaitHandle = new ManualResetEvent ( false ) ;
6366 private Dictionary < ulong , SortedList < DateTime , RegistryStateElement > > modificationsQueue = null ;
6467 private Dictionary < ulong , string > kcbModificationKeyNames = null ;
@@ -770,6 +773,7 @@ public async Task StartImportAsync(string templateName, BINARY_TYPE binaryType)
770773
771774 try {
772775 modificationsElement . RegistryStates . BinaryType = binaryType ;
776+ pathNames = new PathNames ( ) ;
773777 resumeEventWaitHandle . Reset ( ) ;
774778 modificationsQueue = new Dictionary < ulong , SortedList < DateTime , RegistryStateElement > > ( ) ;
775779 kcbModificationKeyNames = new Dictionary < ulong , string > ( ) ;
@@ -824,9 +828,11 @@ public async Task StartImportAsync(string templateName, BINARY_TYPE binaryType)
824828 } catch {
825829 kernelSession . Dispose ( ) ;
826830 kernelSession = null ;
831+ pathNames = null ;
827832 ImportStarted = false ;
828833 }
829834 } catch {
835+ pathNames = null ;
830836 ImportStarted = false ;
831837 }
832838 }
@@ -878,6 +884,7 @@ private async Task StopImportAsync(bool sync) {
878884 } finally {
879885 kernelSession . Dispose ( ) ;
880886 kernelSession = null ;
887+ pathNames = null ;
881888 ImportStarted = false ;
882889 }
883890 }
@@ -1376,7 +1383,7 @@ private void ModificationAdded(RegistryTraceData registryTraceData) {
13761383 value = null ;
13771384
13781385 try {
1379- value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath ) ) ;
1386+ value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath , pathNames ) , pathNames ) ;
13801387 } catch ( ArgumentException ) {
13811388 // value doesn't exist
13821389 value = null ;
@@ -1416,7 +1423,7 @@ private void ModificationAdded(RegistryTraceData registryTraceData) {
14161423 value = null ;
14171424
14181425 try {
1419- value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath ) ) ;
1426+ value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath , pathNames ) , pathNames ) ;
14201427 } catch {
14211428 // we have permission to access the key at this point so this must not be important
14221429 }
@@ -1591,7 +1598,7 @@ private void KCBStopped(RegistryTraceData registryTraceData) {
15911598
15921599 // value
15931600 try {
1594- value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath ) ) ;
1601+ value = ReplaceStartupPathEnvironmentVariable ( LengthenValue ( GetValueInRegistryView ( registryStateElement . KeyName , registryStateElement . ValueName , registryView ) , fullPath , pathNames ) , pathNames ) ;
15951602 } catch ( ArgumentException ) {
15961603 // value doesn't exist
15971604 value = null ;
0 commit comments