ID: Q154667
3.51 WINDOWS NT kbprg kbprb
The information in this article applies to:
- Microsoft Windows NT version 3.51
The CreateService or ChangeServiceConfig API fails with the error code 31, ERROR_GEN_FAILURE, on Windows NT 3.51.
When 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
Append two backslashes in front of the computer name for the first parameter to OpenScManager(). For example:
\\franki
The CreateService and ChangeServiceConfig API will now successfully
execute.
This behavior is by design.
The error code 31, ERROR_GEN_FAILURE, will only occur with the CreateService and ChangeServiceConfig API when the following conditions are met:
Keywords : kbKernBase kbService kbGrpKernBase
Version : 3.51
Platform : NT WINDOWS
Last Reviewed: January 13, 1997