{
result |= Service.STATE_UNKNOWN;
int error = Native.getLastError();
System.out.println("Error in QueryServiceConfig: " + error + " " + Kernel32Util.formatMessageFromLastErrorCode(error));
}
if (!advapi32.QueryServiceStatusEx(service, (byte) advapi32.SC_STATUS_PROCESS_INFO, null, 0, pcbBytesNeeded))
{
// now get the data
int cbBufSize = pcbBytesNeeded.getValue();
Memory buffer = new Memory(cbBufSize);
buffer.clear();