services: Assign the service manager db to the lock in LockServiceDatabase.

This commit is contained in:
James Hawkins 2008-07-17 12:24:58 -05:00 committed by Alexandre Julliard
parent 4df06c4cfe
commit d725626a2b
1 changed files with 6 additions and 2 deletions

View File

@ -897,6 +897,7 @@ DWORD svcctl_LockServiceDatabase(
SC_RPC_LOCK *phLock)
{
struct sc_manager_handle *manager;
struct sc_lock *lock;
DWORD err;
WINE_TRACE("(%p, %p)\n", hSCManager, phLock);
@ -908,13 +909,16 @@ DWORD svcctl_LockServiceDatabase(
if (err != ERROR_SUCCESS)
return err;
*phLock = HeapAlloc(GetProcessHeap(), 0, sizeof(struct sc_lock));
if (!*phLock)
lock = HeapAlloc(GetProcessHeap(), 0, sizeof(struct sc_lock));
if (!lock)
{
scmdatabase_unlock_startup(manager->db);
return ERROR_NOT_ENOUGH_SERVER_MEMORY;
}
lock->db = manager->db;
*phLock = lock;
return ERROR_SUCCESS;
}