Module: ReservedNames::Win32::API::Macros
- Defined in:
- lib/chef/win32/api.rb
Instance Method Summary collapse
- #FAILED(status) ⇒ Object
-
#HIBYTE(w) ⇒ Object
Retrieves the high-order byte from the given 16-bit value.
-
#HIWORD(l) ⇒ Object
Retrieves the high-order word from the specified 32-bit value.
- #HRESULT_CODE(hr) ⇒ Object
- #HRESULT_FACILITY(hr) ⇒ Object
- #HRESULT_FROM_NT(x) ⇒ Object
- #HRESULT_FROM_WIN32(x) ⇒ Object
- #HRESULT_SEVERITY(hr) ⇒ Object
-
#IS_ERROR(status) ⇒ Object
winerror.h.
-
#LOBYTE(w) ⇒ Object
Retrieves the low-order byte from the specified value.
-
#LocalDiscard(pointer) ⇒ Object
winbase.h.
-
#LOWORD(l) ⇒ Object
Retrieves the low-order word from the specified value.
- #MAKE_HRESULT(sev, fac, code) ⇒ Object
- #MAKE_SCODE(sev, fac, code) ⇒ Object
-
#MAKELONG(low, high) ⇒ Object
Creates a LONG value by concatenating the specified values.
-
#MAKEWORD(low, high) ⇒ Object
Creates a WORD value by concatenating the specified values.
- #SUCCEEDED(status) ⇒ Object
Instance Method Details
#FAILED(status) ⇒ Object
332 333 334 |
# File 'lib/chef/win32/api.rb', line 332 def FAILED(status) status < 0 end |
#HIBYTE(w) ⇒ Object
Retrieves the high-order byte from the given 16-bit value.
msdn.microsoft.com/en-us/library/windows/desktop/ms632656(v=VS.85).aspx
288 289 290 |
# File 'lib/chef/win32/api.rb', line 288 def HIBYTE(w) w >> 8 end |
#HIWORD(l) ⇒ Object
Retrieves the high-order word from the specified 32-bit value.
msdn.microsoft.com/en-us/library/windows/desktop/ms632657(v=VS.85).aspx
274 275 276 |
# File 'lib/chef/win32/api.rb', line 274 def HIWORD(l) l >> 16 end |
#HRESULT_CODE(hr) ⇒ Object
308 309 310 |
# File 'lib/chef/win32/api.rb', line 308 def HRESULT_CODE(hr) hr & 0xFFFF end |
#HRESULT_FACILITY(hr) ⇒ Object
312 313 314 |
# File 'lib/chef/win32/api.rb', line 312 def HRESULT_FACILITY(hr) (hr >> 16) & 0x1fff end |
#HRESULT_FROM_NT(x) ⇒ Object
316 317 318 |
# File 'lib/chef/win32/api.rb', line 316 def HRESULT_FROM_NT(x) x | 0x10000000 # FACILITY_NT_BIT end |
#HRESULT_FROM_WIN32(x) ⇒ Object
320 321 322 323 324 325 326 |
# File 'lib/chef/win32/api.rb', line 320 def HRESULT_FROM_WIN32(x) if x <= 0 x else (x & 0x0000FFFF) | (7 << 16) | 0x80000000 end end |
#HRESULT_SEVERITY(hr) ⇒ Object
328 329 330 |
# File 'lib/chef/win32/api.rb', line 328 def HRESULT_SEVERITY(hr) (hr >> 31) & 0x1 end |
#IS_ERROR(status) ⇒ Object
winerror.h
296 297 298 |
# File 'lib/chef/win32/api.rb', line 296 def IS_ERROR(status) status >> 31 == 1 end |
#LOBYTE(w) ⇒ Object
Retrieves the low-order byte from the specified value.
msdn.microsoft.com/en-us/library/windows/desktop/ms632658(v=VS.85).aspx
281 282 283 |
# File 'lib/chef/win32/api.rb', line 281 def LOBYTE(w) w & 0xff end |
#LocalDiscard(pointer) ⇒ Object
winbase.h
242 243 244 |
# File 'lib/chef/win32/api.rb', line 242 def LocalDiscard(pointer) LocalReAlloc(pointer, 0, LMEM_MOVEABLE) end |
#LOWORD(l) ⇒ Object
Retrieves the low-order word from the specified value.
msdn.microsoft.com/en-us/library/windows/desktop/ms632659(v=VS.85).aspx
267 268 269 |
# File 'lib/chef/win32/api.rb', line 267 def LOWORD(l) l & 0xffff end |
#MAKE_HRESULT(sev, fac, code) ⇒ Object
300 301 302 |
# File 'lib/chef/win32/api.rb', line 300 def MAKE_HRESULT(sev, fac, code) sev << 31 | fac << 16 | code end |
#MAKE_SCODE(sev, fac, code) ⇒ Object
304 305 306 |
# File 'lib/chef/win32/api.rb', line 304 def MAKE_SCODE(sev, fac, code) sev << 31 | fac << 16 | code end |
#MAKELONG(low, high) ⇒ Object
Creates a LONG value by concatenating the specified values.
msdn.microsoft.com/en-us/library/windows/desktop/ms632660(v=vs.85).aspx
260 261 262 |
# File 'lib/chef/win32/api.rb', line 260 def MAKELONG(low, high) ((low & 0xffff) | (high & 0xffff)) << 16 end |
#MAKEWORD(low, high) ⇒ Object
Creates a WORD value by concatenating the specified values.
msdn.microsoft.com/en-us/library/windows/desktop/ms632663(v=VS.85).aspx
253 254 255 |
# File 'lib/chef/win32/api.rb', line 253 def MAKEWORD(low, high) ((low & 0xff) | (high & 0xff)) << 8 end |
#SUCCEEDED(status) ⇒ Object
336 337 338 |
# File 'lib/chef/win32/api.rb', line 336 def SUCCEEDED(status) status >= 0 end |