services: Add a ref count to the service entry in svcctl_CreateServiceW.
commit8f07e6932b23acf5a3233dc55bbe7a426f35fc28
authorRob Shearman <robertshearman@gmail.com>
Tue, 24 Mar 2009 11:25:35 +0000 (24 11:25 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 24 Mar 2009 12:10:57 +0000 (24 13:10 +0100)
treea5660918846d5dcb52230a79358015c712a08c16
parent6789fa85448c2cf904cde0360f443e52cf23bd1a
services: Add a ref count to the service entry in svcctl_CreateServiceW.

The ref count will be released by SC_RPC_HANDLE_destroy when the
returned handle is destroyed.

Change svcctl_OpenServiceW to use InterlockedIncrement to increment
the ref count since the service is in the database and therefore could
be shared and SC_RPC_HANDLE_destroy doesn't take the scmdatabase lock
when decrementing the ref count.
programs/services/rpc.c