Hi everybody,
Has someone the right definition of WSADATA Structure for 64 bits?
Thanks,
GUAN
I found the structure, it is this:
WSADATA STRUCT
wVersion WORD ?
wHighVersion WORD ?
iMaxSockets WORD ?
iMaxUdpDg WORD ?
lpVendorInfo QWORD ?
szDescription BYTE WSADESCRIPTION_LEN + 1 dup (?)
szSystemStatus BYTE WSASYS_STATUS_LEN + 1 dup (?)
WSADATA ENDS
Hi,
The following is the WSADATA definition specified in the MSDN library (and converted to assembly):
WSADATA STRUCT
wVersion WORD ?
wHighVersion WORD ?
szDescription BYTE (WSADESCRIPTION_LEN + 1) DUP (?)
szSystemStatus BYTE (WSASYS_STATUS_LEN + 1) DUP (?)
iMaxSockets WORD ?
iMaxUdpDg WORD ?
lpVendorInfo DWORD ?
ENDS
WSADESCRIPTION_LEN = 256
WSASYS_STATUS_LEN = 128
Regards,
Ramon
Ramon,
GUAN was looking for the x64 definition and it looks to me like he has it right.
Hi GUAN,
You have it right, this is from the next update to the GoAsm headers, they are not yet complete but should be uploaded with in a few weeks
WSADATA STRUCT
wVersion DW
wHighVersion DW
#ifdef WIN64
iMaxSockets DW
iMaxUdpDg DW
lpVendorInfo DQ
szDescription DB (WSADESCRIPTION_LEN+1) DUP (?)
szSystemStatus DB (WSASYS_STATUS_LEN+1) DUP (?)
#else
szDescription DB (WSADESCRIPTION_LEN+1) DUP (?)
szSystemStatus DB (WSADESCRIPTION_LEN+1) DUP (?)
iMaxSockets DW
iMaxUdpDg DW
lpVendorInfo DD
#endif
ENDS
Donkey,
The headers with x64 will be great, I am looking forward to them. I have been using both ml64 and GoAsm for writing x64 programs.
Quote from: Greg on March 08, 2009, 12:36:10 AM
Donkey,
The headers with x64 will be great, I am looking forward to them. I have been using both ml64 and GoAsm for writing x64 programs.
Hi Greg, I am working on them at the rate of about 1 or 2 a day using the new Vista headers as a template, some have very little to update but some (like common controls) have a huge number of new structures and equates.I would like to encompass all versions up to and including Vista in the next release. But understand that it is complicated, I have to know which pointers to change and which to leave at 32 bits etc... some are defined through typedefs in other headers and as a result the work is slow for now. Hopefully a few weeks, I have all headers up to Dxxxx.h done. What I will be doing with the structures is this...
#IFDEF WIN64
#DEFINE PTR DQ
#ELSE
#DEFINE PTR DD
#ENDIF
TESTREDEF STRUCT
pTest1 PTR
pTest2 PTR
dwTest3 DD
ENDS
Which seems to work OK.
Donkey,
Yes, I can imagine it's going to take a while. Regarding the structures, that looks like a good way to do it.
I decided it's time I learned x64 assembly. First, I installed Windows 7 Beta x64. Then I installed the Windows 7 Beta SDK and then I was able to get Visual C++ 2008 Express Edition building for x64. I also have Pelles C installed and building for x64. It's really handy to be able to see what the C compilers generate for assembly listings. Like I said, I have been using ml64 and GoAsm for assembly programming. I really like it. :thumbu
Hi Greg,
If you like you can tackle a couple of the header files, just email me which ones so we don't duplicate our work.
Donkey,
Well, the headers are for GoAsm, right? I'm not that experienced with GoAsm. I would have to study up on how the GoAsm headers are done. If you are sure about this, give me a header file name and I'll have a crack at it. I'll probably be pretty slow at it at first.
Hi Greg,
Actually, thinking about it there are some other things that need changing in the next version that are the result of enhancements to the struct parser in GoAsm since I first started the project, it is now capable of some pretty advanced stuff like named unions and nested structure definitions (this example will be new in the next headers package):
IMAGE_AUX_SYMBOL UNION
Sym STRUCT
TagIndex DD
Misc UNION
LnSz STRUCT
Linenumber DW
Size DW
ENDS
TotalSize DD
ENDUNION
FcnAry UNION
Function STRUCT
PointerToLinenumber DD
PointerToNextFunction DD
ENDS
Array STRUCT
Dimension DW 4 DUP (?)
ENDS
ENDUNION
TvIndex DW
ENDS
File STRUCT
Name DB IMAGE_SIZEOF_SYMBOL DUP (?)
ENDS
Section STRUCT
Length DD
NumberOfRelocations DW
NumberOfLinenumbers DW
CheckSum DD
Number DW
Selection DB
ENDS
ENDS
And I am exploiting that in the next version to make the usage for GoAsm more closely match examples in the PSDK. So I think I will be doomed to doing at least this version of the headers myself. One of the things I like about GoAsm is the scoping, note that the Size member would be illegal in MASM as would the invoke member of IDispatch, in GoAsm because of its superior scoping there is no problem with this at all.
For the port to Win64 I am using this right now:
http://technet.microsoft.com/en-us/library/bb496995.aspx
Edgar
Edgar,
That's probably a good idea, you know how you want to do them and you can do them best. They will be a great asset to GoAsm, and a good reference for x64, when you are done.