SetServiceBits

SetServiceBits

The SetServiceBits function registers a service type with the service control manager and the Server service. The Server service can then announce the registered service type as one it currently supports. The NetServerGetInfo and NetServerEnum functions obtain a specified machine's supported service types.

BOOL SetServiceBits(
  SERVICE_STATUS_HANDLE hServiceStatus,
  DWORD dwServiceBits,
  BOOL bSetBitsOn,
  BOOL bUpdateImmediately
);
Parameters
hServiceStatus
[in] Handle to the status information structure for the service. A service obtains the handle by calling the RegisterServiceCtrlHandlerEx function.
dwServiceBits
[in] Set of bit flags that specifies a service type.

Certain bit flags (0xC00F3F7B) are reserved for use by Microsoft. The SetServiceBits function fails with the error ERROR_INVALID_DATA if any of these bit flags are set in dwServiceBits. The following bit flags are reserved for use by Microsoft.

Bit flagValue
SV_TYPE_WORKSTATION0x00000001
SV_TYPE_SERVER0x00000002
SV_TYPE_DOMAIN_CTRL0x00000008
SV_TYPE_DOMAIN_BAKCTRL0x00000010
SV_TYPE_TIME_SOURCE0x00000020
SV_TYPE_AFP0x00000040
SV_TYPE_DOMAIN_MEMBER0x00000100
SV_TYPE_PRINTQ_SERVER0x00000200
SV_TYPE_DIALIN_SERVER0x00000400
SV_TYPE_XENIX_SERVER0x00000800
SV_TYPE_SERVER_UNIX0x00000800
SV_TYPE_NT0x00001000
SV_TYPE_WFW0x00002000
SV_TYPE_POTENTIAL_BROWSER0x00010000
SV_TYPE_BACKUP_BROWSER0x00020000
SV_TYPE_MASTER_BROWSER0x00040000
SV_TYPE_DOMAIN_MASTER0x00080000
SV_TYPE_LOCAL_LIST_ONLY0x40000000
SV_TYPE_DOMAIN_ENUM0x80000000

Certain bit flags (0x00300084) are defined by Microsoft, but are not specifically reserved for systems software. The following are these bit flags.

Bit flagValue
SV_TYPE_SV_TYPE_SQLSERVER0x00000004
SV_TYPE_NOVELL0x00000080
SV_TYPE_DOMAIN_CTRL0x00100000
SV_TYPE_DOMAIN_BAKCTRL0x00200000

Certain bit flags (0x3FC0C000) are not defined by Microsoft, and their use is not coordinated by Microsoft. Developers of applications that use these bits should be aware that other applications can also use them, thus creating a conflict. The following are these bit flags.

0x00004000
0x00008000
0x00400000
0x00800000
0x01000000
0x02000000
0x04000000
0x08000000
0x10000000
0x20000000

bSetBitsOn
[in] If this value is TRUE, the bits in dwServiceBit are to be set. If this value is FALSE, the bits are to be cleared.
bUpdateImmediately
[in] If this value is TRUE, the Server service is to perform an immediate update. If this value is FALSE, the update is not be performed immediately.
Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements
ClientRequires Windows XP, Windows 2000 Professional, or Windows NT Workstation 3.5 and later.
ServerRequires Windows Server 2003, Windows 2000 Server, or Windows NT Server 3.5 and later.
Header

Declared in Lmserver.h.

Library

Link to Advapi32.lib.

DLLRequires Advapi32.dll.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值