Skip to content

Commit

Permalink
Alpha 3:
Browse files Browse the repository at this point in the history
Fixed Some Figures not being Recognized and Writing Wrong.
Added Trap Editor (Not complete)
Added Vehicle Editor (Not Complete)
  • Loading branch information
hegyak committed May 12, 2020
1 parent 7b54756 commit e7ecfbf
Show file tree
Hide file tree
Showing 19 changed files with 9,234 additions and 115 deletions.
Binary file modified .vs/SkyReader-GUI/v16/.suo
Binary file not shown.
46 changes: 23 additions & 23 deletions SkyReader-GUI/DeviceManagement.vb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Partial Friend NotInheritable Class DeviceManagement
''' </returns>

Friend Function FindDeviceFromGuid _
(ByVal myGuid As System.Guid, _
(ByVal myGuid As Guid,
ByRef devicePathName() As String) _
As Boolean

Expand All @@ -114,7 +114,7 @@ Partial Friend NotInheritable Class DeviceManagement
Dim lastDevice As Boolean
Dim memberIndex As Int32
Dim myDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA
Dim pdevicePathName As IntPtr
Dim pdevicePathName As IntPtr
Dim success As Boolean

Try
Expand All @@ -134,13 +134,13 @@ Partial Friend NotInheritable Class DeviceManagement

' Returns
' Handle to a device information set for the devices.
'*
'*

deviceInfoSet = SetupDiGetClassDevs _
(myGuid, _
IntPtr.Zero, _
IntPtr.Zero, _
DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE)
deviceInfoSet = SetupDiGetClassDevs _
(myGuid,
IntPtr.Zero,
IntPtr.Zero,
DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE)

deviceFound = False
memberIndex = 0
Expand Down Expand Up @@ -177,10 +177,10 @@ Partial Friend NotInheritable Class DeviceManagement
'***

success = SetupDiEnumDeviceInterfaces _
(deviceInfoSet, _
IntPtr.Zero, _
myGuid, _
memberIndex, _
(deviceInfoSet,
IntPtr.Zero,
myGuid,
memberIndex,
myDeviceInterfaceData)

'Find out if a device information set was retrieved.
Expand Down Expand Up @@ -216,11 +216,11 @@ Partial Friend NotInheritable Class DeviceManagement
'***

SetupDiGetDeviceInterfaceDetail _
(deviceInfoSet, _
myDeviceInterfaceData, _
IntPtr.Zero, _
0, _
bufferSize, _
(deviceInfoSet,
myDeviceInterfaceData,
IntPtr.Zero,
0,
bufferSize,
IntPtr.Zero)

'Allocate memory for the SP_DEVICE_INTERFACE_DETAIL_DATA structure using the returned buffer size.
Expand All @@ -236,11 +236,11 @@ Partial Friend NotInheritable Class DeviceManagement
'and the returned required buffer size.

success = SetupDiGetDeviceInterfaceDetail _
(deviceInfoSet, _
myDeviceInterfaceData, _
detailDataBuffer, _
bufferSize, _
bufferSize, _
(deviceInfoSet,
myDeviceInterfaceData,
detailDataBuffer,
bufferSize,
bufferSize,
IntPtr.Zero)

'Skip over cbsize (4 bytes) to get the address of the devicePathName.
Expand All @@ -250,7 +250,7 @@ Partial Friend NotInheritable Class DeviceManagement
'Get the String containing the devicePathName.

devicePathName(memberIndex) = Marshal.PtrToStringAuto(pdevicePathName)

deviceFound = True

End If
Expand Down
24 changes: 12 additions & 12 deletions SkyReader-GUI/DeviceManagementDeclarations.vb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Partial Friend NotInheritable Class DeviceManagement

Friend Structure SP_DEVICE_INTERFACE_DATA
Friend cbSize As Int32
Friend InterfaceClassGuid As System.Guid
Friend InterfaceClassGuid As Guid
Friend Flags As Int32
Friend Reserved As IntPtr
End Structure
Expand All @@ -70,20 +70,20 @@ Partial Friend NotInheritable Class DeviceManagement

Friend Structure SP_DEVINFO_DATA
Friend cbSize As Int32
Friend ClassGuid As System.Guid
Friend ClassGuid As Guid
Friend DevInst As Int32
Friend Reserved As Int32
End Structure

<DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> Shared Function RegisterDeviceNotification _
(ByVal hRecipient As IntPtr, _
ByVal NotificationFilter As IntPtr, _
(ByVal hRecipient As IntPtr,
ByVal NotificationFilter As IntPtr,
ByVal Flags As Int32) _
As IntPtr
End Function

<DllImport("setupapi.dll", SetLastError:=True)> Shared Function SetupDiCreateDeviceInfoList _
(ByRef ClassGuid As System.Guid, _
(ByRef ClassGuid As Guid,
ByVal hwndParent As Int32) _
As Int32
End Function
Expand All @@ -94,18 +94,18 @@ Partial Friend NotInheritable Class DeviceManagement
End Function

<DllImport("setupapi.dll", SetLastError:=True)> Shared Function SetupDiEnumDeviceInterfaces _
(ByVal DeviceInfoSet As IntPtr, _
ByVal DeviceInfoData As IntPtr, _
ByRef InterfaceClassGuid As System.Guid, _
ByVal MemberIndex As Int32, _
(ByVal DeviceInfoSet As IntPtr,
ByVal DeviceInfoData As IntPtr,
ByRef InterfaceClassGuid As Guid,
ByVal MemberIndex As Int32,
ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA) _
As Boolean
End Function

<DllImport("setupapi.dll", CharSet:=CharSet.Auto, SetLastError:=True)> Shared Function SetupDiGetClassDevs _
(ByRef ClassGuid As System.Guid, _
ByVal Enumerator As IntPtr, _
ByVal hwndParent As IntPtr, _
(ByRef ClassGuid As Guid,
ByVal Enumerator As IntPtr,
ByVal hwndParent As IntPtr,
ByVal Flags As Int32) _
As IntPtr
End Function
Expand Down
Loading

0 comments on commit e7ecfbf

Please sign in to comment.