PRB: CreateService or ChangeServiceConfig Fails with Error 31Last reviewed: January 11, 1997Article ID: Q154667 |
The information in this article applies to:
SYMPTOMSThe CreateService or ChangeServiceConfig API fails with the error code 31, ERROR_GEN_FAILURE, on Windows NT 3.51.
CAUSEWhen obtaining a handle to the Service Control Manager via the OpenScManager API, a machine name is specified in the first parameter. If the machine name specified refers to the local machine, the ChangeServiceConfig and CreateService APIs will fail with an error code of 31, ERROR_GEN_FAILURE, if the name was specified without appending two backslashes (\) in front of the machine name. For example:
franki RESOLUTIONAppend two backslashes in front of the computer name for the first parameter to OpenScManager(). For example:
\\frankiThe CreateService and ChangeServiceConfig API will now successfully execute.
STATUSThis behavior is by design.
MORE INFORMATIONThe error code 31, ERROR_GEN_FAILURE, will only occur with the CreateService and ChangeServiceConfig API when the following conditions are met:
|
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |