I need to call a 64-bit dll with the following parms:
c++ call:
SOCKET WINAPI InetConnect(
LPCTSTR lpszHostName,
UINT nPort,
UINT nProtocol,
UINT nTimeout,
DWORD dwOptions,
LPSECURITYCREDENTIALS lpCredentials
);
The LPSECURITYCREDENTIALS data type is a user defined c++ structure:
typedef struct _SECURITYCREDENTIALS
{
DWORD dwSize;
DWORD dwProtocol;
DWORD dwOptions;
DWORD dwReserved;
LPCTSTR lpszHostName;
LPCTSTR lpszUserName;
LPCTSTR lpszPassword;
LPCTSTR lpszCertStore;
LPCTSTR lpszCertName;
LPCTSTR lpszKeyFile;
} SECURITYCREDENTIALS, *LPSECURITYCREDENTIALS;
**************************************************************************************************
Harbour / Fivewin equivalent:
DLL32 FUNCTION InetConnect( lpszHostName AS LPSTR, ;
nPort AS _INT, ;
nProtocol AS _INT, ;
nTimeout AS _INT, ;
dwOptions AS DWORD, ;
lpCredentials AS LPSECURITYCREDENTIALS ) ;
AS LONG ;
PASCAL FROM "InetConnectA" ;
LIB M->HDLL
My question is, how would I create a LPSECURITYCREDENTIALS data variable for passing to the DLL32 FUNCTION?
Then, I need to populate:
LPSECURITYCREDENTIALS.lpszCertStore
LPSECURITYCREDENTIALS.lpszCertName
Thanks in advance.
don
***************************************************************************************************
c++ STRUCTURE data types
- don lowenstein
- Posts: 196
- Joined: Mon Oct 17, 2005 9:09 pm
- Contact:
c++ STRUCTURE data types
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: c++ STRUCTURE data types
Don,
@lpCredentials AS PTR
STRUCT oCredentials
MEMBER dwSize AS DWORD
MEMBER dwProtocol AS DWORD
MEMBER dwOptions AS DWORD
MEMBER dwReserved AS DWORD
MEMBER lpszHostName AS LPSTR
MEMBER lpszUserName AS LPSTR
MEMBER lpszPassword AS LPSTR
MEMBER lpszCertStore AS LPSTR
MEMBER lpszCertName AS LPSTR
MEMBER lpszKeyFile AS LPSTR
ENDSTRUCT
@oCredentials:cBuffer
@lpCredentials AS PTR
STRUCT oCredentials
MEMBER dwSize AS DWORD
MEMBER dwProtocol AS DWORD
MEMBER dwOptions AS DWORD
MEMBER dwReserved AS DWORD
MEMBER lpszHostName AS LPSTR
MEMBER lpszUserName AS LPSTR
MEMBER lpszPassword AS LPSTR
MEMBER lpszCertStore AS LPSTR
MEMBER lpszCertName AS LPSTR
MEMBER lpszKeyFile AS LPSTR
ENDSTRUCT
@oCredentials:cBuffer
- don lowenstein
- Posts: 196
- Joined: Mon Oct 17, 2005 9:09 pm
- Contact:
Re: c++ STRUCTURE data types
where in the code does this go?
do you have a small code snippet?
do you have a small code snippet?
Don Lowenstein
www.laapc.com
www.laapc.com
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: c++ STRUCTURE data types
STRUCT oCredentials
MEMBER dwSize AS DWORD
MEMBER dwProtocol AS DWORD
MEMBER dwOptions AS DWORD
MEMBER dwReserved AS DWORD
MEMBER lpszHostName AS LPSTR
MEMBER lpszUserName AS LPSTR
MEMBER lpszPassword AS LPSTR
MEMBER lpszCertStore AS LPSTR
MEMBER lpszCertName AS LPSTR
MEMBER lpszKeyFile AS LPSTR
ENDSTRUCT
oCredentials:dwSize = oCredentials:SizeOf()
oCredentials:lpszCertStore = cCertStore
oCredentials:lpszCertName = cCertName
INetConnect( ..., ..., ..., ..., ..., @oCredentials:cBuffer )
...
DLL32 FUNCTION InetConnect( lpszHostName AS LPSTR, ;
nPort AS _INT, ;
nProtocol AS _INT, ;
nTimeout AS _INT, ;
dwOptions AS DWORD, ;
@lpCredentials AS PTR ) ;
AS LONG ;
PASCAL FROM "InetConnectA" ;
LIB M->HDLL
MEMBER dwSize AS DWORD
MEMBER dwProtocol AS DWORD
MEMBER dwOptions AS DWORD
MEMBER dwReserved AS DWORD
MEMBER lpszHostName AS LPSTR
MEMBER lpszUserName AS LPSTR
MEMBER lpszPassword AS LPSTR
MEMBER lpszCertStore AS LPSTR
MEMBER lpszCertName AS LPSTR
MEMBER lpszKeyFile AS LPSTR
ENDSTRUCT
oCredentials:dwSize = oCredentials:SizeOf()
oCredentials:lpszCertStore = cCertStore
oCredentials:lpszCertName = cCertName
INetConnect( ..., ..., ..., ..., ..., @oCredentials:cBuffer )
...
DLL32 FUNCTION InetConnect( lpszHostName AS LPSTR, ;
nPort AS _INT, ;
nProtocol AS _INT, ;
nTimeout AS _INT, ;
dwOptions AS DWORD, ;
@lpCredentials AS PTR ) ;
AS LONG ;
PASCAL FROM "InetConnectA" ;
LIB M->HDLL