3.2.5.1 CreateService

When initialization and startup are complete, the server waits for the client to call CreateService to instantiate the service. When the CreateService message is received, the server calls the service creator function to create the service, and adds the newly created service to the list of instantiated local services. The provided service handle is then mapped to the stub function that was mapped to the service GUID at initialization and startup. This new mapping is then used to call local service functions in response to remote requests.

If the CreateService event occurs while the server is in the Start state, the server moves into the Accepting Messages state, and the server returns S_OK (0x00000000). Otherwise, the server returns an appropriate error code from the set of DSLR error codes defined in section 2.2.2.5.

The flow for CreateService is diagrammed in the following figure:

CreateService flow diagram

Figure 7: CreateService flow diagram