Package org.rzo.yajsw.os.ms.win.w32

Examples of org.rzo.yajsw.os.ms.win.w32.Pdh$HddCounter


  {
    if (_instance != null)
      return _instance;
    _osName = System.getProperty("os.name");
    if (_osName.toLowerCase().startsWith("windows"))
      _instance = new OperatingSystemWindowsXP();
    else if (_osName.toLowerCase().startsWith("mac os x"))
      _instance = new OperatingSystemMacOsX();
    else if (_osName.contains("BSD"))
      _instance = new OperatingSystemBSD();
    else if (_osName.toLowerCase().startsWith("linux"))
View Full Code Here


    return result;
  }

  private boolean setPrivilege(Pointer hToken, String lpszPrivilege, boolean bEnablePrivilege)
  {
    TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES();
    MyAdvapi.LUID luid = new MyAdvapi.LUID();
    luid.size();

    if (!MyAdvapi.INSTANCE.LookupPrivilegeValueA(null, lpszPrivilege, luid))
      return false;

    tp.Privileges[0].Luid = luid;
    tp.write();

    if (bEnablePrivilege)
      tp.Privileges[0].Attributes = MyAdvapi.SE_PRIVILEGE_ENABLED;
    else
      tp.Privileges[0].Attributes = 0;

    int size = tp.size();
    boolean result = MyAdvapi.INSTANCE.AdjustTokenPrivileges(hToken, false, tp, 0, null, null);
    // return GetLastError() == ERROR_SUCCESS;
    if (!result)
    {
      int errNr = MyKernel32.INSTANCE.GetLastError();
View Full Code Here

                  _title = stringBuffer.getString(0, true);
              }
              if (userParams.Environment != null)
              {
                // get size of environment strings
                MEMORY_BASIC_INFORMATION memInfo = new MEMORY_BASIC_INFORMATION();
                int memInfoSize = memInfo.size(); //x64 = 48, x32 = 28
                int bytesRead = MyKernel32.INSTANCE.VirtualQueryEx(hProcess.getPointer(), userParams.Environment, memInfo.getPointer(),
                    memInfoSize);
                memInfo.read();
                if (bytesRead == 0)
                {
                  _logger.warning("error getting environment in VirtualQueryEx " + Native.getLastError());
                }
                else if (MyKernel32.PAGE_NOACCESS == memInfo.Protect || MyKernel32.PAGE_EXECUTE == memInfo.Protect)
View Full Code Here

    {
      System.out.println("note: task list is empty ");
      return result;
    }

    PROCESSENTRY32 me = new PROCESSENTRY32();
    me.szExeFile = new char[MyKernel32.MAX_PATH];
    int size = me.size();
    // System.out.println("size: " + size);
    me.dwSize = size;
    if (MyKernel32.INSTANCE.Process32First(processes, me))
    {
      System.out.println("ProcessList:");
View Full Code Here

      hProcess = MyKernel32.INSTANCE.OpenProcess(MyKernel32.PROCESS_QUERY_INFORMATION, false, pid);
    if (hProcess == null)
      return null;

    result._pid = pid;
    result._processInformation = new PROCESS_INFORMATION();
    result._processInformation.dwProcessId = pid;
    result._processInformation.hProcess = hProcess;
    result._cmd = result.getCommandLineInternal();
    // this does not always work (why ??), if so try again, then this
    // normally does
View Full Code Here

    try
    {
      destroyed = false;
      _startupInfo = new STARTUPINFO();
      _startupInfo.clear();
      _processInformation = new PROCESS_INFORMATION();
      _processInformation.clear();
      if (_pipeStreams)
      {
        if (sa == null)
        {
View Full Code Here

      _processInformation.clear();
      if (_pipeStreams)
      {
        if (sa == null)
        {
          sa = new SECURITY_ATTRIBUTES();
          sa.clear();
          sa.nLength = sa.size();
          sa.lpSecurityDescriptor = null;
          sa.bInheritHandle = true;// 1; // true otherwise streams are
          // not piped
View Full Code Here

      return false;
    }
    try
    {
      destroyed = false;
      _startupInfo = new STARTUPINFO();
      _startupInfo.clear();
      _processInformation = new PROCESS_INFORMATION();
      _processInformation.clear();
      if (_pipeStreams)
      {
View Full Code Here

    if (ret == 0)
    {
      pbi.read();
      if (pbi.PebBaseAddress != null)
      {
        PEB peb = new PEB();
        // System.out.println(""+1);
        if (readVirtualMemoryToStructure(pbi.PebBaseAddress, peb))
          if (peb.ProcessParameters != null)
          {
            RTL_USER_PROCESS_PARAMETERS userParams = new RTL_USER_PROCESS_PARAMETERS();
View Full Code Here

    if (ret == 0)
    {
      pbi.read();
      if (pbi.PebBaseAddress != null)
      {
        PEB64 peb = new PEB64();
        // System.out.println("64 " + 1);
        if (readVirtualMemoryToStructure(pbi.PebBaseAddress, peb))
          if (peb.ProcessParameters != null)
          {
            RTL_USER_PROCESS_PARAMETERS userParams = new RTL_USER_PROCESS_PARAMETERS();
View Full Code Here

TOP

Related Classes of org.rzo.yajsw.os.ms.win.w32.Pdh$HddCounter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.