The TWUOpenSession function opens a Tarma WebUpdate session and connects to the remote (or local) server that will be used to obtain the update packages. The session must eventually be closed by a call to TWUCloseSession.
Tip: TWUOpenUpdateURL combines the functionality of TWUOpenSession and TWUGetPIF. You might find it more convenient to use that function.
URESULT TWUOpenSession(
eTWUProtocol eProtocol,
int nPortNumber,
const TCHAR *pszServerName,
const TCHAR *pszUserName,
const TCHAR *pszPassword,
fTWUCallback pfCallback,
LPARAM lCookie,
TWUHANDLE *phSession
);
Delphi version:
function TWUOpenSession(
eProtocol: eTWUProtocol;
nPortNumber: Integer;
pszServerName: PTCHAR;
pszUserName: PTCHAR;
pszPassword: PTCHAR;
pfCallback: fTWUCallback;
lCookie: LPARAM;
var phSession: TWUHANDLE
): URESULT;
If the function succeeds, it returns ERROR_SUCCESS (0). If it fails, it returns a nonzero Win32 API error code. You can use TWUGetErrorMessage to retrieve the error message that corresponds to the error code.
To specify the desired communication protocol, use one of the following protocol identifiers.
| Identifier | Description |
|---|---|
| kTWUProtocolNone | Not a valid protocol identifier |
| kTWUProtocolFile | Use local or remote file system (including UNC paths) |
| kTWUProtocolFTP | Use FTP protocol |
| kTWUProtocolHTTP | Use HTTP protocol |
| kTWUProtocolHTTPS | Use HTTPS protocol |