RcValidateProxy Function
Topic Last Modified: 2006-06-13
The RcValidateProxy function validates that the Unicode string represents a valid address for the remote system. This function is called by Microsoft® Exchange to validate proxy addresses that have been created manually.
Applies To
Proxy Generation DLL Entry Points
Syntax
RC RcValidateProxy
(
HANDLE hProxySession,
LPWSTR pszProxyAddr,
BOOL* pIsValid
);
Parameters
- hProxySession
Input parameter. Handle to the proxy address generation session as returned by the RcInitProxies Function.
- pszProxyAddr
Input parameter. Unicode string containing the proxy address to validate. The string should be in the form TYPE:VALUE, where TYPE is the proxy address type.
- pIsValid
Output parameter. When true, this Boolean indicates that the specified proxy address is valid, or that the address was not valid, but has been corrected. If the function returns RC_IMPLEMENTATION, this parameter should be set true. If the function returns RC_ERROR or RC_MEMORY, the returned value of this parameter has no meaning.
Return Value
Return Code, as defined in retcode.h. Only the following return codes are recognized by Exchange.
RC_SUCCESS |
Return this code to indicate that the address is valid, or has been corrected. |
RC_IMPLEMENTATION |
Return this code to indicate that the proxy generation dynamic-link library (DLL) does not perform address validation. Instead, the system will use the recipient proxy address as specified, relying on the remote system to inform Exchange if the address is not valid. When returning this code, also set pIsValid true. |
RC_MEMORY |
Return this code to indicate that an error occurred while allocating memory. |
RC_ERROR |
Return this code to indicate that some other error occurred. |
Remarks
The RcValidateProxy function should check that the proxy address supplied in pszProxyAddr is valid. If the DLL does not have the ability to determine the validity of the address, this function should return RC_IMPLEMENTATION. If the function determines the recipient proxy address is valid, it should return RC_SUCCESS. If the function determines the recipient proxy address in not valid, then the function may choose to attempt to fix the address, or indicate that the address is not valid by returning RC_ERROR. If the function is able to correct the invalid address, the new recipient proxy address should be placed into the memory space pointed to by the pszProxyAddr parameter, and the function should return RC_SUCCESS. If the function is unable to correct the invalid address, the function should return RC_ERROR.
Note
If the function chooses to repair an invalid recipient proxy address, it should be careful to not exceed the space provided in the buffer pointed to by pszProxyAddr.
When this function returns RC_SUCCESS, Exchange retrieves the recipient proxy address located in pszProxyAddr, and uses that address as the valid one. If the proxy address has previously been stored, that value will be updated by whatever value this function returns.
The RcValidateProxy function should not display any user interface, because proxy generation should be performed silently.
Test programs and other applications that use the proxy generation DLL can use the proxyinf.h, retcode.h, and proxygen.h header files that define proxy generation DLL interfaces, structures, and return codes.