-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathWin64FSToken.cls
More file actions
54 lines (43 loc) · 1.25 KB
/
Win64FSToken.cls
File metadata and controls
54 lines (43 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Win64FSToken"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'--------------------------------------------------------------------------------
' Component : Win64FSToken
' Project : ViDock
'
' Description: A token that enables and disables 64bit automatic path
' redirection when 32bit apps run in 64bit windows
'
'--------------------------------------------------------------------------------
Option Explicit
Private m_hOldValue As Long
Private m_disabled As Boolean
Public Property Get Disabled()
Disabled = m_disabled
End Property
Public Function EnableFS()
If m_disabled Then
m_disabled = False
Wow64RevertWow64FsRedirection m_hOldValue
End If
End Function
Private Sub Class_Initialize()
m_disabled = False
m_hOldValue = 0
If Wow64DisableWow64FsRedirection(m_hOldValue) <> 0 Then
m_disabled = True
End If
End Sub
Private Sub Class_Terminate()
EnableFS
End Sub