int cbBufSize = pcbBytesNeeded.getValue();
if (cbBufSize > 8192)
cbBufSize = 8192;
Memory buffer = new Memory(cbBufSize);
buffer.clear();
if (advapi32.QueryServiceConfig(service, buffer, cbBufSize, pcbBytesNeeded))
{
QUERY_SERVICE_CONFIG lpServiceConfig = new QUERY_SERVICE_CONFIG();
lpServiceConfig.init(buffer);
if (lpServiceConfig.dwStartType == Advapi32.SERVICE_DISABLED)
result |= Service.STATE_DISABLED;