4.11 Get Channel List Example

In this example, the client tries to obtain a list of registered channels on the server.

This involves the following steps:

  1. The client registers with RPC to obtain an RPC binding handle to the service based on the endpoint information specified in section 2.1. For information on how to get the RPC binding handle, see [MSDN-BNDHNDLS].

  2. The client calls the EvtRpcGetChannelList method (section to receive the results.

     error_status_t EvtRpcGetChannelList(
       [in] RPC_BINDING_HANDLE binding = {handle from step 1},
       [in] DWORD flags = 0,
       [out] DWORD* numChannelPaths,
       [out, size_is(,*numChannelPaths), range(0, MAX_RPC_CHANNEL_COUNT), string] 
          LPWSTR** channelPaths
  3. The server then goes to the channel table and enumerates all the channel names from the table to fill the channelPaths parameter as the result. At the same time, the numPublisherIds parameter is also set to the number of publishers in the server. Assuming that the server has 5 channels, a sample resulting value in channelPaths might looks like the following:


    In this case, the numChannelPaths value is 5.