# module Chef::ReservedNames::Win32::API::Macros

### Public Instance Methods

FAILED(status) click to toggle source

    # File lib/chef/win32/api.rb, line 331
    def FAILED(status)
      status < 0
    end

HIBYTE(w) click to toggle source

Retrieves the high-order byte from the given 16-bit value.

msdn.microsoft.com/en-us/library/windows/desktop/ms632656(v=VS.85).aspx

    # File lib/chef/win32/api.rb, line 287
    def HIBYTE(w)
      w >> 8
    end

HIWORD(l) click to toggle source

Retrieves the high-order word from the specified 32-bit value.

msdn.microsoft.com/en-us/library/windows/desktop/ms632657(v=VS.85).aspx

    # File lib/chef/win32/api.rb, line 273
    def HIWORD(l)
      l >> 16
    end

HRESULT_CODE(hr) click to toggle source

    # File lib/chef/win32/api.rb, line 307
    def HRESULT_CODE(hr)
      hr & 0xFFFF
    end

HRESULT_FACILITY(hr) click to toggle source

    # File lib/chef/win32/api.rb, line 311
    def HRESULT_FACILITY(hr)
      (hr >> 16) & 0x1fff
    end

HRESULT_FROM_NT(x) click to toggle source

    # File lib/chef/win32/api.rb, line 315
    def HRESULT_FROM_NT(x)
      x | 0x10000000 # FACILITY_NT_BIT
    end

HRESULT_FROM_WIN32(x) click to toggle source

    # File lib/chef/win32/api.rb, line 319
    def HRESULT_FROM_WIN32(x)
      if x <= 0
        x
      else
        (x & 0x0000FFFF) | (7 << 16) | 0x80000000
      end
    end

HRESULT_SEVERITY(hr) click to toggle source

    # File lib/chef/win32/api.rb, line 327
    def HRESULT_SEVERITY(hr)
      (hr >> 31) & 0x1
    end

IS_ERROR(status) click to toggle source

winerror.h

    # File lib/chef/win32/api.rb, line 295
    def IS_ERROR(status)
      status >> 31 == 1
    end

LOBYTE(w) click to toggle source

Retrieves the low-order byte from the specified value.

msdn.microsoft.com/en-us/library/windows/desktop/ms632658(v=VS.85).aspx

    # File lib/chef/win32/api.rb, line 280
    def LOBYTE(w)
      w & 0xff
    end

LOWORD(l) click to toggle source

Retrieves the low-order word from the specified value.

msdn.microsoft.com/en-us/library/windows/desktop/ms632659(v=VS.85).aspx

    # File lib/chef/win32/api.rb, line 266
    def LOWORD(l)
      l & 0xffff
    end

LocalDiscard(pointer) click to toggle source

winbase.h

    # File lib/chef/win32/api.rb, line 241
    def LocalDiscard(pointer)
      LocalReAlloc(pointer, 0, LMEM_MOVEABLE)
    end

MAKELONG(low, high) click to toggle source

Creates a LONG value by concatenating the specified values.

msdn.microsoft.com/en-us/library/windows/desktop/ms632660(v=vs.85).aspx

    # File lib/chef/win32/api.rb, line 259
    def MAKELONG(low, high)
      ((low & 0xffff) | (high & 0xffff)) << 16
    end

MAKEWORD(low, high) click to toggle source

Creates a WORD value by concatenating the specified values.

msdn.microsoft.com/en-us/library/windows/desktop/ms632663(v=VS.85).aspx

    # File lib/chef/win32/api.rb, line 252
    def MAKEWORD(low, high)
      ((low & 0xff) | (high & 0xff)) << 8
    end

MAKE_HRESULT(sev, fac, code) click to toggle source

    # File lib/chef/win32/api.rb, line 299
    def MAKE_HRESULT(sev, fac, code)
      sev << 31 | fac << 16 | code
    end

MAKE_SCODE(sev, fac, code) click to toggle source

    # File lib/chef/win32/api.rb, line 303
    def MAKE_SCODE(sev, fac, code)
      sev << 31 | fac << 16 | code
    end

SUCCEEDED(status) click to toggle source

    # File lib/chef/win32/api.rb, line 335
    def SUCCEEDED(status)
      status >= 0
    end