Something strange going on here... Think i just found a VB Bug!

Can someone run this code and put a REMARK on the If bolFunc = True Then line....
Although bolFunc is TRUE it still goes to the ELSE part of the IF statement? ***!

Option Explicit

Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function IsWow64Process Lib "kernel32" (ByVal hProc As Long, bWow64Process As Boolean) As Long

Private Sub Form_Load()
MsgBox Is64bit
End Sub
Public Function Is64bit() As Boolean
On Error GoTo errFound
    Dim handle As Long, bolFunc As Boolean

    ' Assume initially that this is not a Wow64 process
    bolFunc = False

    ' Now check to see if IsWow64Process function exists
    handle = GetProcAddress(GetModuleHandle("kernel32"), "IsWow64Process")

    If handle > 0 Then ' IsWow64Process function exists
        ' Now use the function to determine if
        ' we are running under Wow64
        IsWow64Process GetCurrentProcess(), bolFunc
    End If

    If bolFunc = True Then
                Is64bit = True
                GoTo errFound
    End If
Exit Function

End Function
Name:  vbbb.jpg
Views: 202
Size:  29.7 KB