Hello!
Is this C++ structure converted correctly to MASM required structure?
typedef struct _WSAQuerySetA
{
DWORD dwSize;
LPSTR lpszServiceInstanceName;
LPGUID lpServiceClassId;
LPWSAVERSION lpVersion;
LPSTR lpszComment;
DWORD dwNameSpace;
LPGUID lpNSProviderId;
LPSTR lpszContext;
DWORD dwNumberOfProtocols;
LPAFPROTOCOLS lpafpProtocols;
LPSTR lpszQueryString;
DWORD dwNumberOfCsAddrs;
LPCSADDR_INFO lpcsaBuffer;
DWORD dwOutputFlags;
LPBLOB lpBlob;
} WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
WSAQUERYSET struct
dwSize DWORD ?
lpszServiceInstanceName dd ?
lpServiceClassId GUID <?>
lpVersion dd ?
lpszComment dd ?
dwNameSpace DWORD ?
lpNSProviderId dd ?
lpszContext dd ?
dwNumberOfProtocols DWORD ?
lpafpProtocols dd ?
lpszQueryString dd ?
dwNumberOfCsAddrs DWORD ?
lpcsaBuffer dd ?
dwOutputFlags DWORD ?
lpBlob dd ?
WSAQUERYSET EndS
Hello :)
Note that those members that are not DWORDs, are LP + something. In Microsoft's convention for naming the SDK data types, LP means it's a pointer - so they're really all DWORDs.
WSAQUERYSET struct
dwSize DWORD ?
lpszServiceInstanceName DWORD ?
lpServiceClassId DWORD ?
lpVersion DWORD ?
lpszComment DWORD ?
dwNameSpace DWORD ?
lpNSProviderId DWORD ?
lpszContext DWORD ?
dwNumberOfProtocols DWORD ?
lpafpProtocols DWORD ?
lpszQueryString DWORD ?
dwNumberOfCsAddrs DWORD ?
lpcsaBuffer DWORD ?
dwOutputFlags DWORD ?
lpBlob DWORD ?
WSAQUERYSET ends
Hope that helps! :U
Except for ....
lpServiceClassId GUID <?>
which should remain as written as it is a pointer to another structure.
Paul
Does the same then not apply to the following?
lpNSProviderId also points to a GUID
lpafpProtocols points to the following structure:
typedef struct _AFPROTOCOLS {
INT iAddressFamily;
INT iProtocol;
} AFPROTOCOLS,
lpVersion points to the following structure:
typedef struct _WSAVersion {
DWORD dwVersion;
WSAECOMPARATOR ecHow;
} WSAVERSION
lpcsaBuffer points to the following structure:
typedef struct _CSADDR_INFO {
SOCKET_ADDRESS LocalAddr ;
SOCKET_ADDRESS RemoteAddr ;
INT iSocketType ;
INT iProtocol ;
} CSADDR_INFO, *PCSADDR_INFO, FAR * LPCSADDR_INFO ;
Quote from: PBrennick on February 16, 2006, 05:32:28 PM
Except for ....
lpServiceClassId GUID <?>
which should remain as written as it is a pointer to another structure.
Paul
You should define this as a DWORD, it is simply a pointer...
Quote from: MSDNThe LPGUID structure represents a long pointer to a GUID.
typedef struct _GUID {
ULONG Data1;
USHORT Data2;
USHORT Data3;
UCHAR Data4[8];
} GUID
typedef GUID *LPGUID;