Microsoft DirectX 8.1 (C++) |
Enumerates all the registered service providers available to the application.
HRESULT EnumServiceProviders( const GUID *const pguidServiceProvider, const GUID *const pguidApplication, const DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, DWORD *const pcbEnumData, DWORD *const pcReturned constDWORD dwFlags, );
Returns S_OK if successful, or one of the following error values.
DPNERR_BUFFERTOOSMALL |
DPNERR_INVALIDPARAM |
Call this method initially by specifying NULL in the pguidServiceProvider parameter to determine the base service providers available to the system. Specific devices for a service provider can then be obtained by passing a pointer to a service provider GUID in the pguidServiceProvider. This is useful, for example, when using the Modem Connection for Microsoft® DirectPlay® service provider. You can choose different modems for dialing out and specific modems for hosting.
If the pcbEnumData buffer is not big enough to hold the requested service provider information, the method returns DPNERR_BUFFERTOOSMALL and the pcbEnumData parameter contains the required buffer size. Typically, the best strategy is to call the method once with a zero-length buffer to determine the required size. Then call it again with the appropriate-sized buffer.
Normally, this method will return only those service providers that can be used by the application. For example, if the IPX networking protocol is not installed, DirectPlay will not return the IPX service provider. To have DirectPlay return all service providers, even those that cannot be used by the application, set the DPNENUMSERVICEPROVIDERS_ALL flag in dwFlags.
Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
Windows 98/Me: Available as a redistributable for Windows 98 and later.
Header: Declared in Dplay8.h.