What does Windows error code 1071 (ERROR_INVALID_SERVICE_LOCK) mean?

 
Previous Next
ERROR_SERVICE_START_HANG ERROR_SERVICE_MARKED_FOR_DELETE

ERROR_INVALID_SERVICE_LOCK

The Service Control Manager database lock is invalid

LockServiceDatabase returns an SC_LOCK value representing ownership of the SCM database lock. UnlockServiceDatabase requires the lock obtained from the matching lock call and explicitly documents ERROR_INVALID_SERVICE_LOCK for an invalid value. The legacy lock functions have no effect starting with Windows Vista, but older code and compatibility paths can still expose the error contract.

Audit lock lifetime and ownership in legacy service configuration code. Do not store SC_LOCK in a truncated integer, unlock twice, or reuse the value after cleanup. Keep the SCM handle and lock in the same explicit lifetime scope and release only a lock that was successfully acquired. On current Windows, prefer designing configuration code around normal SCM API serialization rather than using obsolete database-lock assumptions as a cross-process mutex.

What to inspect

  • Trace the successful LockServiceDatabase call that produced the SC_LOCK.
  • Check for double unlock, stale values, and integer truncation.
  • Do not use the legacy SCM lock as an application synchronization primitive.

References


Looking for a different code? Search another status or error code.