コード例 #1
0
/*
 * DPlaySend
 * 
 * Wrapper for DirectPlay Send[Ex] API.
 */
HRESULT DPlaySend(DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
{
	HRESULT hr = DPERR_NOINTERFACE;

	if (glpDP)
	{
		if (dwFlags & DPSEND_ASYNC)
			// We don't specify a priority or timeout.  Would have to check
			// GetCaps() first to see if they were supported
			hr = IDirectPlayX_SendEx(glpDP, idFrom, idTo, dwFlags, lpData,
									 dwDataSize, 0, 0, NULL, NULL);
		else
			hr = IDirectPlayX_Send(glpDP, idFrom, idTo, dwFlags, lpData, dwDataSize);
	}

	return hr;
}
コード例 #2
0
ファイル: Netplay.c プロジェクト: RealityFactory/Genesis3D
//=========================================================================================================
//	NetPlaySend
//=========================================================================================================
HRESULT NetPlaySend(DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize)
{
	HRESULT		Hr;

	assert(g_lpDP);

#if 0
	dwFlags |= DPSEND_ASYNC;
    Hr = IDirectPlayX_SendEx(g_lpDP, idFrom, idTo, dwFlags, lpData, dwDataSize, 0, 0, NULL, NULL);
#else
	Hr = IDirectPlayX_Send(g_lpDP, idFrom, idTo, dwFlags, lpData, dwDataSize);
#endif
	
	if (Hr != DP_OK)
	{
		if (Hr == DPERR_PENDING)
			return DP_OK;

		DoDPError(Hr);
	}

	return Hr;
}