win-ffi 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +36 -0
- data/lib/win-ffi/enums/color_types.rb +61 -0
- data/lib/win-ffi/enums/comctl32/init_common_controls.rb +32 -0
- data/lib/win-ffi/enums/comctl32/window/style/window_class_style.rb +7 -0
- data/lib/win-ffi/enums/comctl32.rb +5 -0
- data/lib/win-ffi/enums/comdlg32/find_replace.rb +28 -0
- data/lib/win-ffi/enums/comdlg32/font.rb +33 -0
- data/lib/win-ffi/enums/extended_name_format.rb +17 -0
- data/lib/win-ffi/enums/firmware_type.rb +12 -0
- data/lib/win-ffi/enums/gdi32/device_context.rb +29 -0
- data/lib/win-ffi/enums/gdi32/dib.rb +8 -0
- data/lib/win-ffi/enums/gdi32/hatch_styles.rb +15 -0
- data/lib/win-ffi/enums/gdi32/pfd_flags.rb +28 -0
- data/lib/win-ffi/enums/gdi32/pfd_layer_type.rb +7 -0
- data/lib/win-ffi/enums/gdi32/pfd_type.rb +7 -0
- data/lib/win-ffi/enums/gdi32/raster_operations.rb +22 -0
- data/lib/win-ffi/enums/gdi32.rb +90 -0
- data/lib/win-ffi/enums/kernel32/activation_context.rb +17 -0
- data/lib/win-ffi/enums/kernel32/computer_name_format.rb +19 -0
- data/lib/win-ffi/enums/kernel32/format_message_flags.rb +16 -0
- data/lib/win-ffi/enums/kernel32/get_module_handle_ex_flag.rb +7 -0
- data/lib/win-ffi/enums/kernel32/global_alloc_flags.rb +14 -0
- data/lib/win-ffi/enums/kernel32/handle.rb +9 -0
- data/lib/win-ffi/enums/kernel32/heap_flags.rb +14 -0
- data/lib/win-ffi/enums/kernel32/local_flags.rb +20 -0
- data/lib/win-ffi/enums/kernel32/memory.rb +12 -0
- data/lib/win-ffi/enums/kernel32/memory_flags.rb +22 -0
- data/lib/win-ffi/enums/kernel32/memory_protection_constants.rb +20 -0
- data/lib/win-ffi/enums/kernel32/set_error_mode_flags.rb +11 -0
- data/lib/win-ffi/enums/kernel32/sound_flags.rb +24 -0
- data/lib/win-ffi/enums/kernel32/volume.rb +13 -0
- data/lib/win-ffi/enums/kernel32.rb +5 -0
- data/lib/win-ffi/enums/lr.rb +48 -0
- data/lib/win-ffi/enums/netapi21/net_api_status.rb +25 -0
- data/lib/win-ffi/enums/netapi32.rb +5 -0
- data/lib/win-ffi/enums/system_info.rb +54 -0
- data/lib/win-ffi/enums/user32/append_menu_flags.rb +21 -0
- data/lib/win-ffi/enums/user32/border_flags.rb +29 -0
- data/lib/win-ffi/enums/user32/clipboard_formats.rb +31 -0
- data/lib/win-ffi/enums/user32/device_notify_flags.rb +17 -0
- data/lib/win-ffi/enums/user32/draw_caption_flags.rb +16 -0
- data/lib/win-ffi/enums/user32/draw_frame_control_flags.rb +15 -0
- data/lib/win-ffi/enums/user32/draw_frame_control_state_flags.rb +44 -0
- data/lib/win-ffi/enums/user32/edge_flags.rb +20 -0
- data/lib/win-ffi/enums/user32/feedback_type.rb +21 -0
- data/lib/win-ffi/enums/user32/get_ancestor_flags.rb +12 -0
- data/lib/win-ffi/enums/user32/icon.rb +19 -0
- data/lib/win-ffi/enums/user32/image.rb +12 -0
- data/lib/win-ffi/enums/user32/key_event_flags.rb +11 -0
- data/lib/win-ffi/enums/user32/keyboard_layout_flags.rb +57 -0
- data/lib/win-ffi/enums/user32/keyboard_modifiers.rb +16 -0
- data/lib/win-ffi/enums/user32/layered_window_attributes_flags.rb +12 -0
- data/lib/win-ffi/enums/user32/map_virtual_key.rb +22 -0
- data/lib/win-ffi/enums/user32/message_filter.rb +11 -0
- data/lib/win-ffi/enums/user32/mouse_event_flags.rb +25 -0
- data/lib/win-ffi/enums/user32/mouse_keys_flags.rb +16 -0
- data/lib/win-ffi/enums/user32/mwmo.rb +17 -0
- data/lib/win-ffi/enums/user32/ocr.rb +32 -0
- data/lib/win-ffi/enums/user32/oic.rb +26 -0
- data/lib/win-ffi/enums/user32/pen_flags.rb +12 -0
- data/lib/win-ffi/enums/user32/pen_mask.rb +14 -0
- data/lib/win-ffi/enums/user32/pointer_flags.rb +82 -0
- data/lib/win-ffi/enums/user32/pointer_input_type.rb +13 -0
- data/lib/win-ffi/enums/user32/process_dpi_awareness.rb +12 -0
- data/lib/win-ffi/enums/user32/queue_status_flags.rb +36 -0
- data/lib/win-ffi/enums/user32/rim.rb +12 -0
- data/lib/win-ffi/enums/user32/touch_injection_flags.rb +13 -0
- data/lib/win-ffi/enums/user32/touch_mask.rb +13 -0
- data/lib/win-ffi/enums/user32/user_object_information_flags.rb +22 -0
- data/lib/win-ffi/enums/user32/virtual_key_flags.rb +214 -0
- data/lib/win-ffi/enums/user32/window/animate_window_flags.rb +31 -0
- data/lib/win-ffi/enums/user32/window/broadcast_system_flags.rb +20 -0
- data/lib/win-ffi/enums/user32/window/broadcast_system_message_flags.rb +12 -0
- data/lib/win-ffi/enums/user32/window/combo_box_message.rb +53 -0
- data/lib/win-ffi/enums/user32/window/get_class_long_flags.rb +34 -0
- data/lib/win-ffi/enums/user32/window/get_window_flags.rb +38 -0
- data/lib/win-ffi/enums/user32/window/get_window_long_flags.rb +16 -0
- data/lib/win-ffi/enums/user32/window/menu_flags.rb +54 -0
- data/lib/win-ffi/enums/user32/window/message_box_flags.rb +90 -0
- data/lib/win-ffi/enums/user32/window/message_box_return.rb +18 -0
- data/lib/win-ffi/enums/user32/window/notification/button_notification.rb +20 -0
- data/lib/win-ffi/enums/user32/window/notification/edit_notification.rb +19 -0
- data/lib/win-ffi/enums/user32/window/notification/static_notification.rb +13 -0
- data/lib/win-ffi/enums/user32/window/peek_message_flags.rb +13 -0
- data/lib/win-ffi/enums/user32/window/set_window_pos_flags.rb +48 -0
- data/lib/win-ffi/enums/user32/window/show_window_flags.rb +41 -0
- data/lib/win-ffi/enums/user32/window/smto.rb +22 -0
- data/lib/win-ffi/enums/user32/window/style/button_control_style.rb +37 -0
- data/lib/win-ffi/enums/user32/window/style/combo_box_style.rb +22 -0
- data/lib/win-ffi/enums/user32/window/style/edit_style.rb +23 -0
- data/lib/win-ffi/enums/user32/window/style/static_style.rb +45 -0
- data/lib/win-ffi/enums/user32/window/style/window_class_style.rb +50 -0
- data/lib/win-ffi/enums/user32/window/style/window_style.rb +85 -0
- data/lib/win-ffi/enums/user32/window/style/window_style_ex.rb +98 -0
- data/lib/win-ffi/enums/user32/window/system_menu_command.rb +37 -0
- data/lib/win-ffi/enums/user32/window/system_metrics_flags.rb +300 -0
- data/lib/win-ffi/enums/user32/window/system_parameters_info_action.rb +225 -0
- data/lib/win-ffi/enums/user32/window/system_parameters_info_flags.rb +246 -0
- data/lib/win-ffi/enums/user32/window/track_popup_menu_flags.rb +70 -0
- data/lib/win-ffi/enums/user32/window/window_long.rb +22 -0
- data/lib/win-ffi/enums/user32/window/window_messages.rb +222 -0
- data/lib/win-ffi/enums/user32/window_hook.rb +56 -0
- data/lib/win-ffi/enums/user32.rb +5 -0
- data/lib/win-ffi/functions/advapi32/process.rb +33 -0
- data/lib/win-ffi/functions/advapi32/system_info.rb +17 -0
- data/lib/win-ffi/functions/comctl32/control.rb +11 -0
- data/lib/win-ffi/functions/comctl32/listbox.rb +20 -0
- data/lib/win-ffi/functions/comctl32.rb +7 -0
- data/lib/win-ffi/functions/comdlg32/color.rb +9 -0
- data/lib/win-ffi/functions/comdlg32/error.rb +6 -0
- data/lib/win-ffi/functions/comdlg32/find_replace.rb +9 -0
- data/lib/win-ffi/functions/comdlg32/font.rb +9 -0
- data/lib/win-ffi/functions/comdlg32.rb +7 -0
- data/lib/win-ffi/functions/gdi32/bitmap.rb +275 -0
- data/lib/win-ffi/functions/gdi32/brush.rb +54 -0
- data/lib/win-ffi/functions/gdi32/device_context.rb +126 -0
- data/lib/win-ffi/functions/gdi32/filled_shape.rb +68 -0
- data/lib/win-ffi/functions/gdi32/font.rb +9 -0
- data/lib/win-ffi/functions/gdi32/metafile.rb +173 -0
- data/lib/win-ffi/functions/gdi32/opengl.rb +29 -0
- data/lib/win-ffi/functions/gdi32/painting_drawing.rb +50 -0
- data/lib/win-ffi/functions/gdi32/text.rb +376 -0
- data/lib/win-ffi/functions/gdi32.rb +7 -0
- data/lib/win-ffi/functions/kernel32/activation.rb +22 -0
- data/lib/win-ffi/functions/kernel32/dll.rb +92 -0
- data/lib/win-ffi/functions/kernel32/error.rb +28 -0
- data/lib/win-ffi/functions/kernel32/filesystem.rb +22 -0
- data/lib/win-ffi/functions/kernel32/handle.rb +29 -0
- data/lib/win-ffi/functions/kernel32/memory.rb +478 -0
- data/lib/win-ffi/functions/kernel32/process.rb +359 -0
- data/lib/win-ffi/functions/kernel32/resource.rb +141 -0
- data/lib/win-ffi/functions/kernel32/sound.rb +10 -0
- data/lib/win-ffi/functions/kernel32/string.rb +38 -0
- data/lib/win-ffi/functions/kernel32/system_info.rb +183 -0
- data/lib/win-ffi/functions/kernel32/time.rb +220 -0
- data/lib/win-ffi/functions/kernel32/volume.rb +130 -0
- data/lib/win-ffi/functions/kernel32.rb +15 -0
- data/lib/win-ffi/functions/msimg32/bitmap.rb +46 -0
- data/lib/win-ffi/functions/msvcrt/handle.rb +13 -0
- data/lib/win-ffi/functions/netapi32/network_management.rb +13 -0
- data/lib/win-ffi/functions/netapi32.rb +7 -0
- data/lib/win-ffi/functions/ntdll/system_info.rb +14 -0
- data/lib/win-ffi/functions/secur32/system_info.rb +30 -0
- data/lib/win-ffi/functions/shell32/icon.rb +49 -0
- data/lib/win-ffi/functions/shutdown.rb +84 -0
- data/lib/win-ffi/functions/thread.rb +230 -0
- data/lib/win-ffi/functions/user32/accessibility.rb +23 -0
- data/lib/win-ffi/functions/user32/authorization.rb +19 -0
- data/lib/win-ffi/functions/user32/bitmap.rb +11 -0
- data/lib/win-ffi/functions/user32/brush.rb +10 -0
- data/lib/win-ffi/functions/user32/caret.rb +36 -0
- data/lib/win-ffi/functions/user32/clipboard.rb +84 -0
- data/lib/win-ffi/functions/user32/controls/button.rb +23 -0
- data/lib/win-ffi/functions/user32/controls/combobox.rb +29 -0
- data/lib/win-ffi/functions/user32/controls/listbox.rb +25 -0
- data/lib/win-ffi/functions/user32/controls/scrollbar.rb +95 -0
- data/lib/win-ffi/functions/user32/cursor.rb +74 -0
- data/lib/win-ffi/functions/user32/dde.rb +214 -0
- data/lib/win-ffi/functions/user32/desktop.rb +76 -0
- data/lib/win-ffi/functions/user32/device.rb +17 -0
- data/lib/win-ffi/functions/user32/device_context.rb +62 -0
- data/lib/win-ffi/functions/user32/display.rb +37 -0
- data/lib/win-ffi/functions/user32/error.rb +10 -0
- data/lib/win-ffi/functions/user32/filled_shape.rb +23 -0
- data/lib/win-ffi/functions/user32/gesture.rb +38 -0
- data/lib/win-ffi/functions/user32/hook.rb +123 -0
- data/lib/win-ffi/functions/user32/icon.rb +98 -0
- data/lib/win-ffi/functions/user32/input.rb +23 -0
- data/lib/win-ffi/functions/user32/keyboard.rb +177 -0
- data/lib/win-ffi/functions/user32/keyboard_accelerators.rb +37 -0
- data/lib/win-ffi/functions/user32/mouse.rb +60 -0
- data/lib/win-ffi/functions/user32/multiple_display_monitors.rb +43 -0
- data/lib/win-ffi/functions/user32/multiple_document_interface.rb +44 -0
- data/lib/win-ffi/functions/user32/painting_drawing.rb +173 -0
- data/lib/win-ffi/functions/user32/pointer.rb +154 -0
- data/lib/win-ffi/functions/user32/power.rb +28 -0
- data/lib/win-ffi/functions/user32/print.rb +14 -0
- data/lib/win-ffi/functions/user32/process.rb +30 -0
- data/lib/win-ffi/functions/user32/raw_input.rb +55 -0
- data/lib/win-ffi/functions/user32/rect.rb +67 -0
- data/lib/win-ffi/functions/user32/resource.rb +28 -0
- data/lib/win-ffi/functions/user32/shell.rb +29 -0
- data/lib/win-ffi/functions/user32/string.rb +98 -0
- data/lib/win-ffi/functions/user32/text.rb +48 -0
- data/lib/win-ffi/functions/user32/touch.rb +69 -0
- data/lib/win-ffi/functions/user32/transform.rb +22 -0
- data/lib/win-ffi/functions/user32/window/configuration.rb +15 -0
- data/lib/win-ffi/functions/user32/window/dialog.rb +167 -0
- data/lib/win-ffi/functions/user32/window/menu.rb +245 -0
- data/lib/win-ffi/functions/user32/window/message.rb +168 -0
- data/lib/win-ffi/functions/user32/window/properties.rb +50 -0
- data/lib/win-ffi/functions/user32/window/timer.rb +37 -0
- data/lib/win-ffi/functions/user32/window/window.rb +546 -0
- data/lib/win-ffi/functions/user32/window/window_class.rb +109 -0
- data/lib/win-ffi/functions/user32/window/window_proc.rb +29 -0
- data/lib/win-ffi/functions/user32/window_station.rb +39 -0
- data/lib/win-ffi/functions/user32.rb +161 -0
- data/lib/win-ffi/functions/winmm.rb +547 -0
- data/lib/win-ffi/functions/wtsapi32/process.rb +12 -0
- data/lib/win-ffi/lib_base.rb +54 -0
- data/lib/win-ffi/struct.rb +15 -0
- data/lib/win-ffi/structs/comctl32/init_common_controls_ex.rb +10 -0
- data/lib/win-ffi/structs/comdlg32/choose_color.rb +23 -0
- data/lib/win-ffi/structs/comdlg32/choose_font.rb +28 -0
- data/lib/win-ffi/structs/comdlg32/find_replace.rb +24 -0
- data/lib/win-ffi/structs/gdi32/abc.rb +9 -0
- data/lib/win-ffi/structs/gdi32/abcfloat.rb +10 -0
- data/lib/win-ffi/structs/gdi32/bitmap.rb +13 -0
- data/lib/win-ffi/structs/gdi32/bitmap_info.rb +11 -0
- data/lib/win-ffi/structs/gdi32/bitmap_info_header.rb +17 -0
- data/lib/win-ffi/structs/gdi32/blend_function.rb +10 -0
- data/lib/win-ffi/structs/gdi32/display_device.rb +12 -0
- data/lib/win-ffi/structs/gdi32/handle_table.rb +7 -0
- data/lib/win-ffi/structs/gdi32/kerning_pair.rb +9 -0
- data/lib/win-ffi/structs/gdi32/log_brush.rb +10 -0
- data/lib/win-ffi/structs/gdi32/log_font.rb +20 -0
- data/lib/win-ffi/structs/gdi32/meta_file_pict.rb +10 -0
- data/lib/win-ffi/structs/gdi32/palette_entry.rb +10 -0
- data/lib/win-ffi/structs/gdi32/pixel_format_descriptor.rb +57 -0
- data/lib/win-ffi/structs/gdi32/rgb_quad.rb +10 -0
- data/lib/win-ffi/structs/kernel32/actctx.rb +22 -0
- data/lib/win-ffi/structs/netapi32/wksta_info_100.rb +9 -0
- data/lib/win-ffi/structs/os_version_info.rb +10 -0
- data/lib/win-ffi/structs/os_version_info_ex.rb +70 -0
- data/lib/win-ffi/structs/paint_struct.rb +12 -0
- data/lib/win-ffi/structs/point.rb +10 -0
- data/lib/win-ffi/structs/rect.rb +28 -0
- data/lib/win-ffi/structs/size.rb +6 -0
- data/lib/win-ffi/structs/user32/controls/combobox_info.rb +13 -0
- data/lib/win-ffi/structs/user32/controls/scroll_info.rb +13 -0
- data/lib/win-ffi/structs/user32/controls/scrollbar_info.rb +13 -0
- data/lib/win-ffi/structs/user32/cursor_info.rb +10 -0
- data/lib/win-ffi/structs/user32/display_device.rb +12 -0
- data/lib/win-ffi/structs/user32/draw_text_params.rb +11 -0
- data/lib/win-ffi/structs/user32/icon_info.rb +11 -0
- data/lib/win-ffi/structs/user32/icon_info_ex.rb +15 -0
- data/lib/win-ffi/structs/user32/last_input_info.rb +8 -0
- data/lib/win-ffi/structs/user32/mouse_move_point.rb +10 -0
- data/lib/win-ffi/structs/user32/msg.rb +16 -0
- data/lib/win-ffi/structs/user32/pointer_info.rb +25 -0
- data/lib/win-ffi/structs/user32/pointer_pen_info.rb +18 -0
- data/lib/win-ffi/structs/user32/pointer_touch_info.rb +17 -0
- data/lib/win-ffi/structs/user32/raw_input_device_list.rb +10 -0
- data/lib/win-ffi/structs/user32/raw_input_header.rb +10 -0
- data/lib/win-ffi/structs/user32/touch_hit_testing_input.rb +11 -0
- data/lib/win-ffi/structs/user32/touch_hit_testing_proximity_evaluation.rb +8 -0
- data/lib/win-ffi/structs/user32/track_mouse_event.rb +10 -0
- data/lib/win-ffi/structs/user32/window/alt_tab_info.rb +17 -0
- data/lib/win-ffi/structs/user32/window/bs_info.rb +12 -0
- data/lib/win-ffi/structs/user32/window/create_struct.rb +22 -0
- data/lib/win-ffi/structs/user32/window/dlg_template.rb +13 -0
- data/lib/win-ffi/structs/user32/window/flashw_info.rb +11 -0
- data/lib/win-ffi/structs/user32/window/gui_thread_info.rb +17 -0
- data/lib/win-ffi/structs/user32/window/luid.rb +8 -0
- data/lib/win-ffi/structs/user32/window/menu_info.rb +13 -0
- data/lib/win-ffi/structs/user32/window/menu_item_info.rb +18 -0
- data/lib/win-ffi/structs/user32/window/menu_item_template.rb +9 -0
- data/lib/win-ffi/structs/user32/window/menubar_info.rb +12 -0
- data/lib/win-ffi/structs/user32/window/msgbox_params.rb +16 -0
- data/lib/win-ffi/structs/user32/window/non_client_metrics.rb +29 -0
- data/lib/win-ffi/structs/user32/window/title_bar_info.rb +9 -0
- data/lib/win-ffi/structs/user32/window/tpm_params.rb +8 -0
- data/lib/win-ffi/structs/user32/window/update_layered_window_info.rb +22 -0
- data/lib/win-ffi/structs/user32/window/window_placement.rb +32 -0
- data/lib/win-ffi/structs/user32/window/window_pos.rb +46 -0
- data/lib/win-ffi/structs/user32/window/wndclass.rb +19 -0
- data/lib/win-ffi/structs/user32/window/wndclassex.rb +40 -0
- data/lib/win-ffi/version.rb +3 -0
- data/lib/win-ffi.rb +42 -0
- metadata +363 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
require 'win-ffi/functions/kernel32'
|
|
2
|
+
|
|
3
|
+
require 'win-ffi/enums/computer_name_format'
|
|
4
|
+
|
|
5
|
+
module WinFFI
|
|
6
|
+
module Kernel32
|
|
7
|
+
#BOOL WINAPI DnsHostnameToComputerName(
|
|
8
|
+
# _In_ LPCTSTR Hostname,
|
|
9
|
+
# _Out_ LPTSTR ComputerName,
|
|
10
|
+
# _Inout_ LPDWORD nSize )
|
|
11
|
+
attach_function 'DnsHostnameToComputerNameA', [:string, :pointer, :pointer], :bool
|
|
12
|
+
attach_function 'DnsHostnameToComputerNameW', [:string, :pointer, :pointer], :bool
|
|
13
|
+
|
|
14
|
+
#DWORD WINAPI ExpandEnvironmentStrings(
|
|
15
|
+
# _In_ LPCTSTR lpSrc,
|
|
16
|
+
# _Out_opt_ LPTSTR lpDst,
|
|
17
|
+
# _In_ DWORD nSize )
|
|
18
|
+
attach_function 'ExpandEnvironmentStringsA', [:string, :pointer, :dword], :dword
|
|
19
|
+
attach_function 'ExpandEnvironmentStringsW', [:string, :pointer, :dword], :dword
|
|
20
|
+
|
|
21
|
+
#BOOL WINAPI GetComputerName(
|
|
22
|
+
# _Out_ LPTSTR lpBuffer,
|
|
23
|
+
# _Inout_ LPDWORD lpnSize )
|
|
24
|
+
attach_function 'GetComputerNameA', [:pointer, :pointer], :bool
|
|
25
|
+
attach_function 'GetComputerNameW', [:pointer, :pointer], :bool
|
|
26
|
+
|
|
27
|
+
#BOOL WINAPI GetComputerNameEx(
|
|
28
|
+
# _In_ COMPUTER_NAME_FORMAT NameType,
|
|
29
|
+
# _Out_ LPTSTR lpBuffer,
|
|
30
|
+
# _Inout_ LPDWORD lpnSize )
|
|
31
|
+
attach_function 'GetComputerNameExA', [ComputerNameFormat, :pointer, :pointer], :bool
|
|
32
|
+
attach_function 'GetComputerNameExW', [ComputerNameFormat, :pointer, :pointer], :bool
|
|
33
|
+
|
|
34
|
+
#UINT WINAPI GetSystemDirectory(
|
|
35
|
+
# _Out_ LPTSTR lpBuffer,
|
|
36
|
+
# _In_ UINT uSize )
|
|
37
|
+
attach_function 'GetSystemDirectoryA', [:pointer, :uint], :uint
|
|
38
|
+
attach_function 'GetSystemDirectoryW', [:pointer, :uint], :uint
|
|
39
|
+
|
|
40
|
+
#void WINAPI GetSystemInfo( _Out_ LPSYSTEM_INFO lpSystemInfo )
|
|
41
|
+
attach_function 'GetSystemInfo', [:pointer], :void
|
|
42
|
+
|
|
43
|
+
#UINT WINAPI GetSystemWindowsDirectory(
|
|
44
|
+
# _Out_ LPTSTR lpBuffer,
|
|
45
|
+
# _In_ UINT uSize )
|
|
46
|
+
attach_function 'GetSystemWindowsDirectoryA', [:pointer, :uint], :uint
|
|
47
|
+
attach_function 'GetSystemWindowsDirectoryW', [:pointer, :uint], :uint
|
|
48
|
+
|
|
49
|
+
#DWORD WINAPI GetVersion(void)
|
|
50
|
+
attach_function 'GetVersion', [], :dword
|
|
51
|
+
|
|
52
|
+
#UINT WINAPI GetWindowsDirectory(
|
|
53
|
+
# _Out_ LPTSTR lpBuffer,
|
|
54
|
+
# _In_ UINT uSize )
|
|
55
|
+
attach_function 'GetWindowsDirectoryA', [:pointer, :uint], :uint
|
|
56
|
+
attach_function 'GetWindowsDirectoryW', [:pointer, :uint], :uint
|
|
57
|
+
|
|
58
|
+
#BOOL WINAPI IsProcessorFeaturePresent( _In_ DWORD ProcessorFeature )
|
|
59
|
+
attach_function 'IsProcessorFeaturePresent', [:dword], :bool
|
|
60
|
+
|
|
61
|
+
#BOOL WINAPI QueryPerformanceCounter( _Out_ LARGE_INTEGER *lpPerformanceCount )
|
|
62
|
+
attach_function 'QueryPerformanceCounter', [:pointer], :bool
|
|
63
|
+
|
|
64
|
+
#BOOL WINAPI QueryPerformanceFrequency( _Out_ LARGE_INTEGER *lpFrequency )
|
|
65
|
+
attach_function 'QueryPerformanceFrequency', [:pointer], :bool
|
|
66
|
+
|
|
67
|
+
# The standard character set includes letters, numbers, and the following symbols: ! @ # $ % ^ & ' ) ( . - _ { } ~
|
|
68
|
+
#BOOL WINAPI SetComputerName( _In_ LPCTSTR lpComputerName )
|
|
69
|
+
attach_function 'SetComputerNameA', [:string], :bool
|
|
70
|
+
attach_function 'SetComputerNameW', [:string], :bool
|
|
71
|
+
|
|
72
|
+
# The name cannot include control characters, leading or trailing spaces, or any of the following characters: " / \ [ ] : | < > + = ; , ?
|
|
73
|
+
#BOOL WINAPI SetComputerNameEx(
|
|
74
|
+
# _In_ COMPUTER_NAME_FORMAT NameType,
|
|
75
|
+
# _In_ LPCTSTR lpBuffer )
|
|
76
|
+
attach_function 'SetComputerNameExA', [:uint, :string], :bool
|
|
77
|
+
attach_function 'SetComputerNameExW', [:uint, :string], :bool
|
|
78
|
+
|
|
79
|
+
#TODO
|
|
80
|
+
#BOOL WINAPI VerifyVersionInfo(
|
|
81
|
+
# _In_ LPOSVERSIONINFOEX lpVersionInfo,
|
|
82
|
+
# _In_ DWORD dwTypeMask,
|
|
83
|
+
# _In_ DWORDLONG dwlConditionMask )
|
|
84
|
+
attach_function 'VerifyVersionInfoA', [OSVERSIONINFOEX.ptr, :dword, :ulong], :bool
|
|
85
|
+
attach_function 'VerifyVersionInfoW', [OSVERSIONINFOEX.ptr, :dword, :ulong], :bool
|
|
86
|
+
|
|
87
|
+
#TODO
|
|
88
|
+
#ULONGLONG WINAPI VerSetConditionMask(
|
|
89
|
+
# _In_ ULONGLONG dwlConditionMask,
|
|
90
|
+
# _In_ DWORD dwTypeBitMask,
|
|
91
|
+
# _In_ BYTE dwConditionMask )
|
|
92
|
+
attach_function 'VerSetConditionMask', [:ulong, :dword, :byte], :ulong
|
|
93
|
+
|
|
94
|
+
if WindowsVersion >= :xp
|
|
95
|
+
|
|
96
|
+
#UINT WINAPI GetSystemWow64Directory(
|
|
97
|
+
# _Out_ LPTSTR lpBuffer,
|
|
98
|
+
# _In_ UINT uSize )
|
|
99
|
+
attach_function 'GetSystemWow64DirectoryA', [:pointer, :uint], :uint
|
|
100
|
+
attach_function 'GetSystemWow64DirectoryW', [:pointer, :uint], :uint
|
|
101
|
+
|
|
102
|
+
#TODO
|
|
103
|
+
#void WINAPI GetNativeSystemInfo( _Out_ LPSYSTEM_INFO lpSystemInfo )
|
|
104
|
+
attach_function 'GetNativeSystemInfo', [:pointer], :void
|
|
105
|
+
|
|
106
|
+
if WindowsVersion.sp >= 1 || WindowsVersion >= :vista
|
|
107
|
+
#DWORD WINAPI GetFirmwareEnvironmentVariable(
|
|
108
|
+
# _In_ LPCTSTR lpName,
|
|
109
|
+
# _In_ LPCTSTR lpGuid,
|
|
110
|
+
# _Out_ PVOID pBuffer,
|
|
111
|
+
# _In_ DWORD nSize )
|
|
112
|
+
attach_function 'GetFirmwareEnvironmentVariableA', [:string, :string, :pointer, :dword], :dword
|
|
113
|
+
attach_function 'GetFirmwareEnvironmentVariableW', [:string, :string, :pointer, :dword], :dword
|
|
114
|
+
|
|
115
|
+
#BOOL WINAPI GetSystemRegistryQuota(
|
|
116
|
+
# _Out_opt_ PDWORD pdwQuotaAllowed,
|
|
117
|
+
# _Out_opt_ PDWORD pdwQuotaUsed )
|
|
118
|
+
attach_function 'GetSystemRegistryQuota', [:pointer, :pointer], :bool
|
|
119
|
+
|
|
120
|
+
#BOOL WINAPI SetFirmwareEnvironmentVariable(
|
|
121
|
+
# _In_ LPCTSTR lpName,
|
|
122
|
+
# _In_ LPCTSTR lpGuid,
|
|
123
|
+
# _In_ PVOID pBuffer,
|
|
124
|
+
# _In_ DWORD nSize )
|
|
125
|
+
attach_function 'SetFirmwareEnvironmentVariableA', [:string, :string, :pointer, :dword], :bool
|
|
126
|
+
attach_function 'SetFirmwareEnvironmentVariableW', [:string, :string, :pointer, :dword], :bool
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
#x64
|
|
130
|
+
#UINT WINAPI EnumSystemFirmwareTables(
|
|
131
|
+
# _In_ DWORD FirmwareTableProviderSignature,
|
|
132
|
+
# _Out_ PVOID pFirmwareTableBuffer,
|
|
133
|
+
# _In_ DWORD BufferSize )
|
|
134
|
+
attach_function 'EnumSystemFirmwareTables', [:dword, :pointer, :dword], :uint
|
|
135
|
+
|
|
136
|
+
#UINT WINAPI GetSystemFirmwareTable(
|
|
137
|
+
# _In_ DWORD FirmwareTableProviderSignature,
|
|
138
|
+
# _In_ DWORD FirmwareTableID,
|
|
139
|
+
# _Out_ PVOID pFirmwareTableBuffer,
|
|
140
|
+
# _In_ DWORD BufferSize )
|
|
141
|
+
attach_function 'GetSystemFirmwareTable', [:dword, :dword, :pointer, :dword], :uint
|
|
142
|
+
|
|
143
|
+
if WindowsVersion >= :vista
|
|
144
|
+
|
|
145
|
+
#BOOL WINAPI GetProductInfo(
|
|
146
|
+
# _In_ DWORD dwOSMajorVersion,
|
|
147
|
+
# _In_ DWORD dwOSMinorVersion,
|
|
148
|
+
# _In_ DWORD dwSpMajorVersion,
|
|
149
|
+
# _In_ DWORD dwSpMinorVersion,
|
|
150
|
+
# _Out_ PDWORD pdwReturnedProductType )
|
|
151
|
+
attach_function 'GetProductInfo', [:dword, :dword, :dword, :dword, :pointer], :bool
|
|
152
|
+
|
|
153
|
+
if WindowsVersion >= 8
|
|
154
|
+
|
|
155
|
+
#BOOL WINBASEAPI GetFirmwareEnvironmentVariableEx(
|
|
156
|
+
# LPCSTR lpName,
|
|
157
|
+
# LPCSTR lpGuid,
|
|
158
|
+
# PVOID pValue,
|
|
159
|
+
# DWORD nSize,
|
|
160
|
+
# PDWORD pdwAttributes )
|
|
161
|
+
attach_function 'GetFirmwareEnvironmentVariableExA', [:string, :string, :pointer, :dword, :pointer], :bool
|
|
162
|
+
attach_function 'GetFirmwareEnvironmentVariableExW', [:string, :string, :pointer, :dword, :pointer], :bool
|
|
163
|
+
|
|
164
|
+
#BOOL WINAPI GetFirmwareType( _Inout_ PFIRMWARE_TYPE FirmwareType )
|
|
165
|
+
attach_function 'GetFirmwareType', [:pointer], :bool
|
|
166
|
+
|
|
167
|
+
#BOOL WINAPI IsNativeVhdBoot ( _Out_ PBOOL *NativeVhdBoot )
|
|
168
|
+
attach_function 'IsNativeVhdBoot', [:pointer], :bool
|
|
169
|
+
|
|
170
|
+
#BOOL WINBASEAPI SetFirmwareEnvironmentVariableEx(
|
|
171
|
+
# _In_ LPCTSTR lpName,
|
|
172
|
+
# _In_ LPCTSTR lpGuid,
|
|
173
|
+
# _In_ PVOID pValue,
|
|
174
|
+
# _In_ DWORD nSize,
|
|
175
|
+
# _In_ DWORD dwAttributes )
|
|
176
|
+
attach_function 'SetFirmwareEnvironmentVariableExA', [:string, :string, :pointer, :dword, :dword], :bool
|
|
177
|
+
attach_function 'SetFirmwareEnvironmentVariableExW', [:string, :string, :pointer, :dword, :dword], :bool
|
|
178
|
+
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
require 'win-ffi/functions/kernel32'
|
|
2
|
+
|
|
3
|
+
module WinFFI
|
|
4
|
+
module Kernel32
|
|
5
|
+
module Time
|
|
6
|
+
extend LibBase
|
|
7
|
+
ffi_lib 'kernel32'
|
|
8
|
+
|
|
9
|
+
TIME_ZONE_ID_UNKNOWN = 0
|
|
10
|
+
TIME_ZONE_ID_STANDARD = 1
|
|
11
|
+
TIME_ZONE_ID_DAYLIGHT = 2
|
|
12
|
+
|
|
13
|
+
#TODO DYNAMIC_TIME_ZONE_INFORMATION struct
|
|
14
|
+
|
|
15
|
+
#BOOL WINAPI DosDateTimeToFileTime(
|
|
16
|
+
# _In_ WORD wFatDate,
|
|
17
|
+
# _In_ WORD wFatTime,
|
|
18
|
+
# _Out_ LPFILETIME lpFileTime )
|
|
19
|
+
attach_function 'DosDateTimeToFileTime', [:ushort, :ushort], :bool
|
|
20
|
+
|
|
21
|
+
#BOOL WINAPI FileTimeToDosDateTime(
|
|
22
|
+
# _In_ const FILETIME *lpFileTime,
|
|
23
|
+
# _Out_ LPWORD lpFatDate,
|
|
24
|
+
# _Out_ LPWORD lpFatTime )
|
|
25
|
+
attach_function 'FileTimeToDosDateTime', [:pointer, :pointer, :pointer], :bool
|
|
26
|
+
|
|
27
|
+
#void WINAPI GetLocalTime( _Out_ LPSYSTEMTIME lpSystemTime )
|
|
28
|
+
attach_function 'GetLocalTime', [:pointer], :void
|
|
29
|
+
|
|
30
|
+
#void WINAPI GetSystemTime( _Out_ LPSYSTEMTIME lpSystemTime )
|
|
31
|
+
attach_function 'GetSystemTime', [:pointer], :void
|
|
32
|
+
|
|
33
|
+
#BOOL WINAPI GetSystemTimeAdjustment(
|
|
34
|
+
# _Out_ PDWORD lpTimeAdjustment,
|
|
35
|
+
# _Out_ PDWORD lpTimeIncrement,
|
|
36
|
+
# _Out_ PBOOL lpTimeAdjustmentDisabled )
|
|
37
|
+
attach_function 'GetSystemTimeAdjustment', [:pointer, :pointer, :pointer], :bool
|
|
38
|
+
|
|
39
|
+
#void WINAPI GetSystemTimeAsFileTime( _Out_ LPFILETIME lpSystemTimeAsFileTime )
|
|
40
|
+
attach_function 'GetSystemTimeAsFileTime', [:pointer], :void
|
|
41
|
+
|
|
42
|
+
#DWORD WINAPI GetTickCount(void)
|
|
43
|
+
attach_function 'GetTickCount', [], :ulong
|
|
44
|
+
|
|
45
|
+
#int GetTimeFormat(
|
|
46
|
+
# _In_ LCID Locale,
|
|
47
|
+
# _In_ DWORD dwFlags,
|
|
48
|
+
# _In_opt_ const SYSTEMTIME *lpTime,
|
|
49
|
+
# _In_opt_ LPCTSTR lpFormat,
|
|
50
|
+
# _Out_opt_ LPTSTR lpTimeStr,
|
|
51
|
+
# _In_ int cchTime )
|
|
52
|
+
attach_function 'GetTimeFormatA', [:ulong, :ulong, :pointer, :string, :pointer, :int], :int
|
|
53
|
+
attach_function 'GetTimeFormatW', [:ulong, :ulong, :pointer, :string, :pointer, :int], :int
|
|
54
|
+
|
|
55
|
+
# int GetTimeFormatEx(
|
|
56
|
+
# _In_opt_ LPCWSTR lpLocaleName,
|
|
57
|
+
# _In_ DWORD dwFlags,
|
|
58
|
+
# _In_opt_ const SYSTEMTIME *lpTime,
|
|
59
|
+
# _In_opt_ LPCWSTR lpFormat,
|
|
60
|
+
# _Out_opt_ LPWSTR lpTimeStr,
|
|
61
|
+
# _In_ int cchTime )
|
|
62
|
+
attach_function 'GetTimeFormatEx', [:string, :dword, :pointer, :string, :string, :int], :int
|
|
63
|
+
|
|
64
|
+
#DWORD WINAPI GetTimeZoneInformation( _Out_ LPTIME_ZONE_INFORMATION lpTimeZoneInformation )
|
|
65
|
+
attach_function 'GetTimeZoneInformation', [:pointer], :dword
|
|
66
|
+
|
|
67
|
+
#BOOL WINAPI SetLocalTime( _In_ const SYSTEMTIME *lpSystemTime )
|
|
68
|
+
attach_function 'SetLocalTime', [:pointer], :bool
|
|
69
|
+
|
|
70
|
+
#BOOL WINAPI SetSystemTime( _In_ const SYSTEMTIME *lpSystemTime )
|
|
71
|
+
attach_function 'SetSystemTime', [:pointer], :bool
|
|
72
|
+
|
|
73
|
+
#BOOL WINAPI SetTimeZoneInformation( _In_ const TIME_ZONE_INFORMATION *lpTimeZoneInformation )
|
|
74
|
+
attach_function 'SetTimeZoneInformation', [:pointer], :bool
|
|
75
|
+
|
|
76
|
+
#BOOL WINAPI SetSystemTimeAdjustment(
|
|
77
|
+
# _In_ DWORD dwTimeAdjustment,
|
|
78
|
+
# _In_ BOOL bTimeAdjustmentDisabled )
|
|
79
|
+
attach_function 'SetSystemTimeAdjustment', [:ulong, :bool], :bool
|
|
80
|
+
|
|
81
|
+
#BOOL WINAPI SystemTimeToFileTime(
|
|
82
|
+
# _In_ const SYSTEMTIME *lpSystemTime,
|
|
83
|
+
# _Out_ LPFILETIME lpFileTime )
|
|
84
|
+
attach_function 'SystemTimeToFileTime', [:pointer, :pointer], :bool
|
|
85
|
+
|
|
86
|
+
#BOOL WINAPI SystemTimeToTzSpecificLocalTime(
|
|
87
|
+
# _In_opt_ LPTIME_ZONE_INFORMATION lpTimeZone,
|
|
88
|
+
# _In_ LPSYSTEMTIME lpUniversalTime,
|
|
89
|
+
# _Out_ LPSYSTEMTIME lpLocalTime )
|
|
90
|
+
attach_function 'SystemTimeToTzSpecificLocalTime', [:pointer, :pointer, :pointer], :bool
|
|
91
|
+
|
|
92
|
+
if WindowsVersion >= :xp
|
|
93
|
+
|
|
94
|
+
#LONG WINAPI CompareFileTime(
|
|
95
|
+
# _In_ const FILETIME *lpFileTime1,
|
|
96
|
+
# _In_ const FILETIME *lpFileTime2 )
|
|
97
|
+
attach_function 'CompareFileTime', [:pointer, :pointer], :long
|
|
98
|
+
|
|
99
|
+
#BOOL WINAPI FileTimeToLocalFileTime(
|
|
100
|
+
# _In_ const FILETIME *lpFileTime,
|
|
101
|
+
# _Out_ LPFILETIME lpLocalFileTime )
|
|
102
|
+
attach_function 'FileTimeToLocalFileTime', [:pointer, :pointer], :bool
|
|
103
|
+
|
|
104
|
+
#BOOL WINAPI FileTimeToSystemTime(
|
|
105
|
+
# _In_ const FILETIME *lpFileTime,
|
|
106
|
+
# _Out_ LPSYSTEMTIME lpSystemTime )
|
|
107
|
+
attach_function 'FileTimeToSystemTime', [:pointer, :pointer], :bool
|
|
108
|
+
|
|
109
|
+
#BOOL WINAPI GetFileTime(
|
|
110
|
+
# _In_ HANDLE hFile,
|
|
111
|
+
# _Out_opt_ LPFILETIME lpCreationTime,
|
|
112
|
+
# _Out_opt_ LPFILETIME lpLastAccessTime,
|
|
113
|
+
# _Out_opt_ LPFILETIME lpLastWriteTime )
|
|
114
|
+
attach_function 'GetFileTime', [:handle, :pointer, :pointer, :pointer], :bool
|
|
115
|
+
|
|
116
|
+
#BOOL WINAPI LocalFileTimeToFileTime(
|
|
117
|
+
# _In_ const FILETIME *lpLocalFileTime,
|
|
118
|
+
# _Out_ LPFILETIME lpFileTime )
|
|
119
|
+
attach_function 'LocalFileTimeToFileTime', [:pointer, :pointer], :bool
|
|
120
|
+
|
|
121
|
+
#BOOL WINAPI TzSpecificLocalTimeToSystemTime(
|
|
122
|
+
# _In_opt_ LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
|
|
123
|
+
# _In_ LPSYSTEMTIME lpLocalTime,
|
|
124
|
+
# _Out_ LPSYSTEMTIME lpUniversalTime )
|
|
125
|
+
attach_function 'TzSpecificLocalTimeToSystemTime', [:pointer, :pointer, :pointer], :bool
|
|
126
|
+
|
|
127
|
+
#BOOL WINAPI SetFileTime(
|
|
128
|
+
# _In_ HANDLE hFile,
|
|
129
|
+
# _In_opt_ const FILETIME *lpCreationTime,
|
|
130
|
+
# _In_opt_ const FILETIME *lpLastAccessTime,
|
|
131
|
+
# _In_opt_ const FILETIME *lpLastWriteTime )
|
|
132
|
+
attach_function 'SetFileTime', [:ulong, :pointer, :pointer, :pointer], :bool
|
|
133
|
+
|
|
134
|
+
if WindowsVersion.sp >= 1 || WindowsVersion >= :vista
|
|
135
|
+
|
|
136
|
+
#BOOL WINAPI GetSystemTimes(
|
|
137
|
+
# _Out_opt_ LPFILETIME lpIdleTime,
|
|
138
|
+
# _Out_opt_ LPFILETIME lpKernelTime,
|
|
139
|
+
# _Out_opt_ LPFILETIME lpUserTime )
|
|
140
|
+
attach_function 'GetSystemTimes', [:pointer, :pointer, :pointer], :bool
|
|
141
|
+
|
|
142
|
+
#BOOL WINAPI GetTimeZoneInformationForYear(
|
|
143
|
+
# _In_ USHORT wYear,
|
|
144
|
+
# _In_opt_ PDYNAMIC_TIME_ZONE_INFORMATION pdtzi,
|
|
145
|
+
# _Out_ LPTIME_ZONE_INFORMATION ptzi )
|
|
146
|
+
attach_function 'GetTimeZoneInformationForYear', [:ushort, :pointer, :pointer], :bool
|
|
147
|
+
|
|
148
|
+
end
|
|
149
|
+
if WindowsVersion >= :vista
|
|
150
|
+
|
|
151
|
+
#DWORD WINAPI GetDynamicTimeZoneInformation( _Out_ PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation )
|
|
152
|
+
attach_function 'GetDynamicTimeZoneInformation', [:pointer], :dword
|
|
153
|
+
|
|
154
|
+
#ULONGLONG WINAPI GetTickCount64(void)
|
|
155
|
+
attach_function 'GetTickCount64', [], :ulong
|
|
156
|
+
|
|
157
|
+
#BOOL WINAPI SetDynamicTimeZoneInformation( _In_ const DYNAMIC_TIME_ZONE_INFORMATION *lpTimeZoneInformation )
|
|
158
|
+
attach_function 'SetDynamicTimeZoneInformation', [:pointer], :bool
|
|
159
|
+
|
|
160
|
+
if WindowsVersion >= 7
|
|
161
|
+
|
|
162
|
+
#BOOL QueryUnbiasedInterruptTime( _Out_ PULONGLONG UnbiasedTime )
|
|
163
|
+
attach_function 'QueryUnbiasedInterruptTime', [:pointer], :bool
|
|
164
|
+
|
|
165
|
+
#BOOL WINAPI SystemTimeToTzSpecificLocalTimeEx(
|
|
166
|
+
# _In_opt_ const DYNAMIC_TIME_ZONE_INFORMATION *lpTimeZoneInformation,
|
|
167
|
+
# _In_ const SYSTEMTIME *lpUniversalTime,
|
|
168
|
+
# _Out_ LPSYSTEMTIME lpLocalTime )
|
|
169
|
+
attach_function 'SystemTimeToTzSpecificLocalTimeEx', [:pointer, :pointer, :pointer], :bool
|
|
170
|
+
|
|
171
|
+
#BOOL WINAPI TzSpecificLocalTimeToSystemTimeEx(
|
|
172
|
+
# _In_opt_ const DYNAMIC_TIME_ZONE_INFORMATION *lpTimeZoneInformation,
|
|
173
|
+
# _In_ const SYSTEMTIME *lpLocalTime,
|
|
174
|
+
# _Out_ LPSYSTEMTIME lpUniversalTime )
|
|
175
|
+
attach_function 'TzSpecificLocalTimeToSystemTimeEx', [:pointer, :pointer, :pointer], :bool
|
|
176
|
+
|
|
177
|
+
if WindowsVersion >= 8
|
|
178
|
+
|
|
179
|
+
#VOID WINAPI GetSystemTimePreciseAsFileTime( _Out_ LPFILETIME lpSystemTimeAsFileTime )
|
|
180
|
+
attach_function 'GetSystemTimePreciseAsFileTime', [:pointer], :void
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if WindowsVersion >= 8
|
|
187
|
+
|
|
188
|
+
ffi_lib 'Advapi32'
|
|
189
|
+
|
|
190
|
+
#DWORD WINAPI EnumDynamicTimeZoneInformation(
|
|
191
|
+
# _In_ const DWORD dwIndex,
|
|
192
|
+
# _Out_ PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation )
|
|
193
|
+
attach_function 'EnumDynamicTimeZoneInformation', [:dword, :pointer], :dword
|
|
194
|
+
|
|
195
|
+
#DWORD WINAPI GetDynamicTimeZoneInformationEffectiveYears(
|
|
196
|
+
# _In_ const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation,
|
|
197
|
+
# _Out_ LPDWORD FirstYear,
|
|
198
|
+
# _Out_ LPDWORD LastYear )
|
|
199
|
+
attach_function 'GetDynamicTimeZoneInformationEffectiveYears', [:pointer, :pointer, :pointer], :dword
|
|
200
|
+
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
ffi_lib 'ntdll'
|
|
204
|
+
|
|
205
|
+
#NTSTATUS WINAPI NtQuerySystemTime( _Out_ PLARGE_INTEGER SystemTime )
|
|
206
|
+
attach_function 'NtQuerySystemTime', [:pointer], :int
|
|
207
|
+
|
|
208
|
+
#NTSTATUS WINAPI RtlLocalTimeToSystemTime(
|
|
209
|
+
# _In_ PLARGE_INTEGER LocalTime,
|
|
210
|
+
# _Out_ PLARGE_INTEGER SystemTime )
|
|
211
|
+
attach_function 'RtlLocalTimeToSystemTime', [:pointer, :pointer], :int
|
|
212
|
+
|
|
213
|
+
#BOOLEAN WINAPI RtlTimeToSecondsSince1970(
|
|
214
|
+
# _In_ PLARGE_INTEGER Time,
|
|
215
|
+
# _Out_ PULONG ElapsedSeconds )
|
|
216
|
+
attach_function 'RtlTimeToSecondsSince1970', [:pointer, :pointer], :bool
|
|
217
|
+
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
require 'win-ffi/functions/kernel32'
|
|
2
|
+
|
|
3
|
+
module WinFFI
|
|
4
|
+
module Kernel32
|
|
5
|
+
|
|
6
|
+
#xp
|
|
7
|
+
#BOOL WINAPI DefineDosDevice(
|
|
8
|
+
#_In_ DWORD dwFlags,
|
|
9
|
+
#_In_ LPCTSTR lpDeviceName,
|
|
10
|
+
#_In_opt_ LPCTSTR lpTargetPath )
|
|
11
|
+
attach_function 'DefineDosDeviceA', [:dword, :string, :string], :bool
|
|
12
|
+
attach_function 'DefineDosDeviceW', [:dword, :string, :string], :bool
|
|
13
|
+
|
|
14
|
+
#BOOL WINAPI DeleteVolumeMountPoint( _In_ LPCTSTR lpszVolumeMountPoint )
|
|
15
|
+
attach_function 'DeleteVolumeMountPointA', [:string], :bool
|
|
16
|
+
attach_function 'DeleteVolumeMountPointW', [:string], :bool
|
|
17
|
+
|
|
18
|
+
#HANDLE WINAPI FindFirstVolume(
|
|
19
|
+
# _Out_ LPTSTR lpszVolumeName,
|
|
20
|
+
# _In_ DWORD cchBufferLength )
|
|
21
|
+
attach_function 'FindFirstVolumeA', [:pointer, :dword], :handle
|
|
22
|
+
attach_function 'FindFirstVolumeW', [:pointer, :dword], :handle
|
|
23
|
+
|
|
24
|
+
#HANDLE WINAPI FindFirstVolumeMountPoint(
|
|
25
|
+
# _In_ LPTSTR lpszRootPathName,
|
|
26
|
+
# _Out_ LPTSTR lpszVolumeMountPoint,
|
|
27
|
+
# _In_ DWORD cchBufferLength )
|
|
28
|
+
attach_function 'FindFirstVolumeMountPointA', [:string, :pointer, :dword], :handle
|
|
29
|
+
attach_function 'FindFirstVolumeMountPointW', [:string, :pointer, :dword], :handle
|
|
30
|
+
|
|
31
|
+
#BOOL WINAPI FindNextVolume(
|
|
32
|
+
# _In_ HANDLE hFindVolume,
|
|
33
|
+
# _Out_ LPTSTR lpszVolumeName,
|
|
34
|
+
# _In_ DWORD cchBufferLength )
|
|
35
|
+
attach_function 'FindNextVolumeA', [:handle, :pointer, :dword], :bool
|
|
36
|
+
attach_function 'FindNextVolumeW', [:handle, :pointer, :dword], :bool
|
|
37
|
+
|
|
38
|
+
#BOOL WINAPI FindNextVolumeMountPoint(
|
|
39
|
+
# _In_ HANDLE hFindVolumeMountPoint,
|
|
40
|
+
# _Out_ LPTSTR lpszVolumeMountPoint,
|
|
41
|
+
# _In_ DWORD cchBufferLength )
|
|
42
|
+
attach_function 'FindNextVolumeMountPointA', [:handle, :pointer, :dword], :bool
|
|
43
|
+
attach_function 'FindNextVolumeMountPointW', [:handle, :pointer, :dword], :bool
|
|
44
|
+
|
|
45
|
+
#BOOL WINAPI FindVolumeClose( _In_ HANDLE hFindVolume )
|
|
46
|
+
attach_function 'FindVolumeClose', [:handle], :bool
|
|
47
|
+
|
|
48
|
+
#BOOL WINAPI FindVolumeMountPointClose( _In_ HANDLE hFindVolumeMountPoint )
|
|
49
|
+
attach_function 'FindVolumeMountPointClose', [:handle], :bool
|
|
50
|
+
|
|
51
|
+
#UINT WINAPI GetDriveType( _In_opt_ LPCTSTR lpRootPathName )
|
|
52
|
+
attach_function 'GetDriveTypeA', [:string], :uint
|
|
53
|
+
attach_function 'GetDriveTypeW', [:string], :uint
|
|
54
|
+
|
|
55
|
+
#DWORD WINAPI GetLogicalDrives( void )
|
|
56
|
+
attach_function 'GetLogicalDrives', [], :dword
|
|
57
|
+
|
|
58
|
+
#DWORD WINAPI GetLogicalDriveStrings(
|
|
59
|
+
# _In_ DWORD nBufferLength,
|
|
60
|
+
# _Out_ LPTSTR lpBuffer )
|
|
61
|
+
attach_function 'GetLogicalDriveStringsA', [:dword, :pointer], :dword
|
|
62
|
+
attach_function 'GetLogicalDriveStringsW', [:dword, :pointer], :dword
|
|
63
|
+
|
|
64
|
+
#BOOL WINAPI GetVolumeInformation(
|
|
65
|
+
# _In_opt_ LPCTSTR lpRootPathName,
|
|
66
|
+
# _Out_opt_ LPTSTR lpVolumeNameBuffer,
|
|
67
|
+
# _In_ DWORD nVolumeNameSize,
|
|
68
|
+
# _Out_opt_ LPDWORD lpVolumeSerialNumber,
|
|
69
|
+
# _Out_opt_ LPDWORD lpMaximumComponentLength,
|
|
70
|
+
# _Out_opt_ LPDWORD lpFileSystemFlags,
|
|
71
|
+
# _Out_opt_ LPTSTR lpFileSystemNameBuffer,
|
|
72
|
+
# _In_ DWORD nFileSystemNameSize )
|
|
73
|
+
attach_function 'GetVolumeInformationA', [:string, :pointer, :dword, :pointer, :pointer, :pointer, :pointer, :dword], :bool
|
|
74
|
+
attach_function 'GetVolumeInformationW', [:string, :pointer, :dword, :pointer, :pointer, :pointer, :pointer, :dword], :bool
|
|
75
|
+
|
|
76
|
+
#BOOL WINAPI GetVolumeNameForVolumeMountPoint(
|
|
77
|
+
# _In_ LPCTSTR lpszVolumeMountPoint,
|
|
78
|
+
# _Out_ LPTSTR lpszVolumeName,
|
|
79
|
+
# _In_ DWORD cchBufferLength )
|
|
80
|
+
attach_function 'GetVolumeNameForVolumeMountPointA', [:string, :pointer, :dword], :bool
|
|
81
|
+
attach_function 'GetVolumeNameForVolumeMountPointW', [:string, :pointer, :dword], :bool
|
|
82
|
+
|
|
83
|
+
#BOOL WINAPI GetVolumePathName(
|
|
84
|
+
# _In_ LPCTSTR lpszFileName,
|
|
85
|
+
# _Out_ LPTSTR lpszVolumePathName,
|
|
86
|
+
# _In_ DWORD cchBufferLength )
|
|
87
|
+
attach_function 'GetVolumePathNameA', [:string, :pointer, :dword], :bool
|
|
88
|
+
attach_function 'GetVolumePathNameW', [:string, :pointer, :dword], :bool
|
|
89
|
+
|
|
90
|
+
#BOOL WINAPI GetVolumePathNamesForVolumeName(
|
|
91
|
+
# _In_ LPCTSTR lpszVolumeName,
|
|
92
|
+
# _Out_ LPTSTR lpszVolumePathNames,
|
|
93
|
+
# _In_ DWORD cchBufferLength,
|
|
94
|
+
# _Out_ PDWORD lpcchReturnLength )
|
|
95
|
+
attach_function 'GetVolumePathNamesForVolumeNameA', [:string, :pointer, :dword, :pointer], :bool
|
|
96
|
+
attach_function 'GetVolumePathNamesForVolumeNameW', [:string, :pointer, :dword, :pointer], :bool
|
|
97
|
+
|
|
98
|
+
#DWORD WINAPI QueryDosDevice(
|
|
99
|
+
# _In_opt_ LPCTSTR lpDeviceName,
|
|
100
|
+
# _Out_ LPTSTR lpTargetPath,
|
|
101
|
+
# _In_ DWORD ucchMax )
|
|
102
|
+
attach_function 'QueryDosDeviceA', [:string, :pointer, :dword], :dword
|
|
103
|
+
attach_function 'QueryDosDeviceW', [:string, :pointer, :dword], :dword
|
|
104
|
+
|
|
105
|
+
#BOOL WINAPI SetVolumeLabel(
|
|
106
|
+
# _In_opt_ LPCTSTR lpRootPathName,
|
|
107
|
+
# _In_opt_ LPCTSTR lpVolumeName )
|
|
108
|
+
attach_function 'SetVolumeLabelA', [:string, :string], :bool
|
|
109
|
+
attach_function 'SetVolumeLabelW', [:string, :string], :bool
|
|
110
|
+
|
|
111
|
+
#BOOL WINAPI SetVolumeMountPoint(Cl
|
|
112
|
+
# _In_ LPCTSTR lpszVolumeMountPoint,
|
|
113
|
+
# _In_ LPCTSTR lpszVolumeName )
|
|
114
|
+
attach_function 'SetVolumeMountPointA', [:string, :string], :bool
|
|
115
|
+
attach_function 'SetVolumeMountPointW', [:string, :string], :bool
|
|
116
|
+
|
|
117
|
+
if WindowsVersion >= :vista
|
|
118
|
+
#BOOL WINAPI GetVolumeInformationByHandleW(
|
|
119
|
+
# _In_ HANDLE hFile,
|
|
120
|
+
# _Out_opt_ LPWSTR lpVolumeNameBuffer,
|
|
121
|
+
# _In_ DWORD nVolumeNameSize,
|
|
122
|
+
# _Out_opt_ LPDWORD lpVolumeSerialNumber,
|
|
123
|
+
# _Out_opt_ LPDWORD lpMaximumComponentLength,
|
|
124
|
+
# _Out_opt_ LPDWORD lpFileSystemFlags,
|
|
125
|
+
# _Out_opt_ LPWSTR lpFileSystemNameBuffer,
|
|
126
|
+
# _In_ DWORD nFileSystemNameSize )
|
|
127
|
+
attach_function 'GetVolumeInformationByHandleW', [:handle, :pointer, :dword, :pointer, :pointer, :pointer, :pointer, :dword], :bool
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
require 'win-ffi/structs/gdi32/blend_function'
|
|
2
|
+
|
|
3
|
+
module WinFFI
|
|
4
|
+
module Msimg32
|
|
5
|
+
extend LibBase
|
|
6
|
+
|
|
7
|
+
ffi_lib 'msimg32'
|
|
8
|
+
|
|
9
|
+
#BOOL AlphaBlend(
|
|
10
|
+
# _In_ HDC hdcDest,
|
|
11
|
+
# _In_ int xoriginDest,
|
|
12
|
+
# _In_ int yoriginDest,
|
|
13
|
+
# _In_ int wDest,
|
|
14
|
+
# _In_ int hDest,
|
|
15
|
+
# _In_ HDC hdcSrc,
|
|
16
|
+
# _In_ int xoriginSrc,
|
|
17
|
+
# _In_ int yoriginSrc,
|
|
18
|
+
# _In_ int wSrc,
|
|
19
|
+
# _In_ int hSrc,
|
|
20
|
+
# _In_ BLENDFUNCTION ftn )
|
|
21
|
+
attach_function 'AlphaBlend', [:hdc, :int, :int, :int, :int, :hdc, :int, :int, :int, :int, BLENDFUNCTION], :bool
|
|
22
|
+
|
|
23
|
+
#BOOL GradientFill(
|
|
24
|
+
# _In_ HDC hdc,
|
|
25
|
+
# _In_ PTRIVERTEX pVertex,
|
|
26
|
+
# _In_ ULONG nVertex,
|
|
27
|
+
# _In_ PVOID pMesh,
|
|
28
|
+
# _In_ ULONG nMesh,
|
|
29
|
+
# _In_ ULONG ulMode )
|
|
30
|
+
attach_function 'GradientFill', [:hdc, :pointer, :ulong, :pointer, :ulong, :ulong], :bool
|
|
31
|
+
|
|
32
|
+
#BOOL TransparentBlt(
|
|
33
|
+
# _In_ HDC hdcDest,
|
|
34
|
+
# _In_ int xoriginDest,
|
|
35
|
+
# _In_ int yoriginDest,
|
|
36
|
+
# _In_ int wDest,
|
|
37
|
+
# _In_ int hDest,
|
|
38
|
+
# _In_ HDC hdcSrc,
|
|
39
|
+
# _In_ int xoriginSrc,
|
|
40
|
+
# _In_ int yoriginSrc,
|
|
41
|
+
# _In_ int wSrc,
|
|
42
|
+
# _In_ int hSrc,
|
|
43
|
+
# _In_ UINT crTransparent )
|
|
44
|
+
attach_function 'TransparentBlt', [:hdc, :int, :int, :int, :int, :hdc, :int, :int, :int, :int, :uint], :bool
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module WinFFI
|
|
2
|
+
module Msvcrt
|
|
3
|
+
ffi_lib 'msvcrt'
|
|
4
|
+
|
|
5
|
+
#intptr_t _get_osfhandle( int fd )
|
|
6
|
+
attach_function '_get_osfhandle', [:int], :long
|
|
7
|
+
|
|
8
|
+
#int _open_osfhandle (
|
|
9
|
+
# intptr_t osfhandle,
|
|
10
|
+
# int flags )
|
|
11
|
+
attach_function '_open_osfhandle', [:long, :int], :int
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'win-ffi/functions/netapi32'
|
|
2
|
+
|
|
3
|
+
module WinFFI
|
|
4
|
+
module Netapi32
|
|
5
|
+
|
|
6
|
+
# NET_API_STATUS NetWkstaGetInfo(
|
|
7
|
+
# _In_ LPWSTR servername,
|
|
8
|
+
# _In_ DWORD level,
|
|
9
|
+
# _Out_ LPBYTE *bufptr);
|
|
10
|
+
attach_function :NetWkstaGetInfo, [:string, :dword, :pointer], :dword
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module WinFFI
|
|
2
|
+
module Ntdll
|
|
3
|
+
extend LibBase
|
|
4
|
+
|
|
5
|
+
ffi_lib 'Ntdll'
|
|
6
|
+
|
|
7
|
+
#NTSTATUS WINAPI NtQuerySystemInformation(
|
|
8
|
+
# _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
|
9
|
+
# _Inout_ PVOID SystemInformation,
|
|
10
|
+
# _In_ ULONG SystemInformationLength,
|
|
11
|
+
# _Out_opt_ PULONG ReturnLength )
|
|
12
|
+
attach_function 'NtQuerySystemInformation', [:pointer, :pointer, :ulong, :pointer], :int
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module WinFII
|
|
2
|
+
module Secur32
|
|
3
|
+
extend LibBase
|
|
4
|
+
|
|
5
|
+
ffi_lib 'secur32'
|
|
6
|
+
|
|
7
|
+
#BOOLEAN WINAPI GetComputerObjectName(
|
|
8
|
+
# _In_ EXTENDED_NAME_FORMAT NameFormat,
|
|
9
|
+
# _Out_ LPTSTR lpNameBuffer,
|
|
10
|
+
# _Inout_ PULONG lpnSize )
|
|
11
|
+
attach_function 'GetComputerObjectNameA', [ExtendedNameFormat ,:pointer, :pointer], :bool
|
|
12
|
+
attach_function 'GetComputerObjectNameW', [ExtendedNameFormat ,:pointer, :pointer], :bool
|
|
13
|
+
|
|
14
|
+
#BOOLEAN WINAPI GetUserNameEx(
|
|
15
|
+
# _In_ EXTENDED_NAME_FORMAT NameFormat,
|
|
16
|
+
# _Out_ LPTSTR lpNameBuffer,
|
|
17
|
+
# _Inout_ PULONG lpnSize )
|
|
18
|
+
attach_function 'GetUserNameExA', [ExtendedNameFormat, :pointer, :pointer], :bool
|
|
19
|
+
attach_function 'GetUserNameExW', [ExtendedNameFormat, :pointer, :pointer], :bool
|
|
20
|
+
|
|
21
|
+
#BOOLEAN WINAPI TranslateName(
|
|
22
|
+
# _In_ LPCTSTR lpAccountName,
|
|
23
|
+
# _In_ EXTENDED_NAME_FORMAT AccountNameFormat,
|
|
24
|
+
# _In_ EXTENDED_NAME_FORMAT DesiredNameFormat,
|
|
25
|
+
# _Out_ LPTSTR lpTranslatedName,
|
|
26
|
+
# _Inout_ PULONG nSize )
|
|
27
|
+
attach_function 'TranslateNameA', [:string, ExtendedNameFormat, ExtendedNameFormat, :string, :pointer], :bool
|
|
28
|
+
attach_function 'TranslateNameW', [:string, ExtendedNameFormat, ExtendedNameFormat, :string, :pointer], :bool
|
|
29
|
+
end
|
|
30
|
+
end
|