HRESULT GetPlayerName(DPID pidID,
LPSTR lpPlayerFriendlyName,
LPDWORD lpdwFriendlyNameLength,
LPSTR lpPlayerFormalName,
LPDWORD lpdwFormalNameLength);
Obtains the player's friendly and formal names from the name server.
·Returns DP_OK if successful, or one of the following error values otherwise:
DPERR_BUFFERTOOSMALL | DPERR_INVALIDOBJECT |
DPERR_INVALIDPARAMS | DPERR_INVALIDPLAYER |
pidID
Player ID for which the player names are being requested.
lpPlayerFriendlyName
Address for the buffer to be filled with the player's friendly name. Set to NULL if you are only looking for the size of the friendly name or are only looking for the formal name.
lpdwFriendlyNameLength
Address for a doubleword that either contains the length of the buffer pointed to by the lpPlayerFriendlyName field or will be filled with the length needed for the buffer. Set to NULL if you are only interested in the formal name.
lpPlayerFormalName
Address for the buffer to be filled with the player's formal name. Set to NULL if you are only looking for the size of the formal name or are only looking for the friendly name.
lpdwFormalNameLength
Address for a doubleword that either contains the length of the buffer pointed to by the lpPlayerFormalName parameter or will be filled with the length needed for the buffer. Set to NULL if you are only interested in the friendly name.
If just one of the names is required, you can set the pair of pointers to the other name to NULL. If the length of the names needs to be determined, the pointers to the lengths must be valid; however, they can point to zeros or you can set the pointers to the friendly and formal names to NULL.
If the supplied buffer is not long enough to hold one of the names, an error code will be returned and the corresponding buffer length will be adjusted to be the size of the buffer needed.