|
-
Aug 24th, 2001, 06:06 AM
#1
Thread Starter
Lively Member
C and VB Gurus...
I want to use a function inside the wnaspi32.dll 'SendASPI32Command" which is defined as
DWORD SendASPI32Command ( LPSRB psrb ) ;
but the struct that is passed through can be variable in size so i dont want to use aliases for the function and then declare them as follows:-
Private Declare Function Send1 Lib "wnaspi32" Alias "SendASPI32Command" (ByRef UDT as UDT1) as Long
Private Declare Function Send2 Lib "wnaspi32" Alias "SendASPI32Command" (ByRef UDT as UDT2) as Long
So what I tried is:-
Private Declare Function Send1 Lib "wnaspi32" (ByRef UDT as Any) as Long
but i get a Bad DLL calling convention, if i put an On Error Resume Next before the DLL Call the function does seem to have executed though because there are values in UDT, but function doesn't return a value.
Does anybody know how i can get around the problem?
-
Aug 24th, 2001, 06:27 AM
#2
Fanatic Member
Code:
Private Declare Function SendASPI32Command Lib "wnaspi32.dll" _(ByRef SRB_Stuff As SRB_Header) As Long
Private Type SRB_Header
SRB_Cmd As Byte 'ASPI command code
SRB_Status As Byte 'ASPI command status byte
SRB_HaId As Byte 'ASPI host adapter number
SRB_Flags As Byte 'ASPI request flags
SRB_Hdr_Rsvd As Long 'Reserved, MUST = 0
End Type
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Aug 24th, 2001, 06:31 AM
#3
Thread Starter
Lively Member
Cant...
That wont work because the SRB is just the header, below that there will be variable lenth UDT, depending on what SCSI command your are sending through the ASPI layer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|