Commit d725626a authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

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

parent 4df06c4c
...@@ -897,6 +897,7 @@ DWORD svcctl_LockServiceDatabase( ...@@ -897,6 +897,7 @@ DWORD svcctl_LockServiceDatabase(
SC_RPC_LOCK *phLock) SC_RPC_LOCK *phLock)
{ {
struct sc_manager_handle *manager; struct sc_manager_handle *manager;
struct sc_lock *lock;
DWORD err; DWORD err;
WINE_TRACE("(%p, %p)\n", hSCManager, phLock); WINE_TRACE("(%p, %p)\n", hSCManager, phLock);
...@@ -908,13 +909,16 @@ DWORD svcctl_LockServiceDatabase( ...@@ -908,13 +909,16 @@ DWORD svcctl_LockServiceDatabase(
if (err != ERROR_SUCCESS) if (err != ERROR_SUCCESS)
return err; return err;
*phLock = HeapAlloc(GetProcessHeap(), 0, sizeof(struct sc_lock)); lock = HeapAlloc(GetProcessHeap(), 0, sizeof(struct sc_lock));
if (!*phLock) if (!lock)
{ {
scmdatabase_unlock_startup(manager->db); scmdatabase_unlock_startup(manager->db);
return ERROR_NOT_ENOUGH_SERVER_MEMORY; return ERROR_NOT_ENOUGH_SERVER_MEMORY;
} }
lock->db = manager->db;
*phLock = lock;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment