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.
Files changed (271) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +36 -0
  3. data/lib/win-ffi/enums/color_types.rb +61 -0
  4. data/lib/win-ffi/enums/comctl32/init_common_controls.rb +32 -0
  5. data/lib/win-ffi/enums/comctl32/window/style/window_class_style.rb +7 -0
  6. data/lib/win-ffi/enums/comctl32.rb +5 -0
  7. data/lib/win-ffi/enums/comdlg32/find_replace.rb +28 -0
  8. data/lib/win-ffi/enums/comdlg32/font.rb +33 -0
  9. data/lib/win-ffi/enums/extended_name_format.rb +17 -0
  10. data/lib/win-ffi/enums/firmware_type.rb +12 -0
  11. data/lib/win-ffi/enums/gdi32/device_context.rb +29 -0
  12. data/lib/win-ffi/enums/gdi32/dib.rb +8 -0
  13. data/lib/win-ffi/enums/gdi32/hatch_styles.rb +15 -0
  14. data/lib/win-ffi/enums/gdi32/pfd_flags.rb +28 -0
  15. data/lib/win-ffi/enums/gdi32/pfd_layer_type.rb +7 -0
  16. data/lib/win-ffi/enums/gdi32/pfd_type.rb +7 -0
  17. data/lib/win-ffi/enums/gdi32/raster_operations.rb +22 -0
  18. data/lib/win-ffi/enums/gdi32.rb +90 -0
  19. data/lib/win-ffi/enums/kernel32/activation_context.rb +17 -0
  20. data/lib/win-ffi/enums/kernel32/computer_name_format.rb +19 -0
  21. data/lib/win-ffi/enums/kernel32/format_message_flags.rb +16 -0
  22. data/lib/win-ffi/enums/kernel32/get_module_handle_ex_flag.rb +7 -0
  23. data/lib/win-ffi/enums/kernel32/global_alloc_flags.rb +14 -0
  24. data/lib/win-ffi/enums/kernel32/handle.rb +9 -0
  25. data/lib/win-ffi/enums/kernel32/heap_flags.rb +14 -0
  26. data/lib/win-ffi/enums/kernel32/local_flags.rb +20 -0
  27. data/lib/win-ffi/enums/kernel32/memory.rb +12 -0
  28. data/lib/win-ffi/enums/kernel32/memory_flags.rb +22 -0
  29. data/lib/win-ffi/enums/kernel32/memory_protection_constants.rb +20 -0
  30. data/lib/win-ffi/enums/kernel32/set_error_mode_flags.rb +11 -0
  31. data/lib/win-ffi/enums/kernel32/sound_flags.rb +24 -0
  32. data/lib/win-ffi/enums/kernel32/volume.rb +13 -0
  33. data/lib/win-ffi/enums/kernel32.rb +5 -0
  34. data/lib/win-ffi/enums/lr.rb +48 -0
  35. data/lib/win-ffi/enums/netapi21/net_api_status.rb +25 -0
  36. data/lib/win-ffi/enums/netapi32.rb +5 -0
  37. data/lib/win-ffi/enums/system_info.rb +54 -0
  38. data/lib/win-ffi/enums/user32/append_menu_flags.rb +21 -0
  39. data/lib/win-ffi/enums/user32/border_flags.rb +29 -0
  40. data/lib/win-ffi/enums/user32/clipboard_formats.rb +31 -0
  41. data/lib/win-ffi/enums/user32/device_notify_flags.rb +17 -0
  42. data/lib/win-ffi/enums/user32/draw_caption_flags.rb +16 -0
  43. data/lib/win-ffi/enums/user32/draw_frame_control_flags.rb +15 -0
  44. data/lib/win-ffi/enums/user32/draw_frame_control_state_flags.rb +44 -0
  45. data/lib/win-ffi/enums/user32/edge_flags.rb +20 -0
  46. data/lib/win-ffi/enums/user32/feedback_type.rb +21 -0
  47. data/lib/win-ffi/enums/user32/get_ancestor_flags.rb +12 -0
  48. data/lib/win-ffi/enums/user32/icon.rb +19 -0
  49. data/lib/win-ffi/enums/user32/image.rb +12 -0
  50. data/lib/win-ffi/enums/user32/key_event_flags.rb +11 -0
  51. data/lib/win-ffi/enums/user32/keyboard_layout_flags.rb +57 -0
  52. data/lib/win-ffi/enums/user32/keyboard_modifiers.rb +16 -0
  53. data/lib/win-ffi/enums/user32/layered_window_attributes_flags.rb +12 -0
  54. data/lib/win-ffi/enums/user32/map_virtual_key.rb +22 -0
  55. data/lib/win-ffi/enums/user32/message_filter.rb +11 -0
  56. data/lib/win-ffi/enums/user32/mouse_event_flags.rb +25 -0
  57. data/lib/win-ffi/enums/user32/mouse_keys_flags.rb +16 -0
  58. data/lib/win-ffi/enums/user32/mwmo.rb +17 -0
  59. data/lib/win-ffi/enums/user32/ocr.rb +32 -0
  60. data/lib/win-ffi/enums/user32/oic.rb +26 -0
  61. data/lib/win-ffi/enums/user32/pen_flags.rb +12 -0
  62. data/lib/win-ffi/enums/user32/pen_mask.rb +14 -0
  63. data/lib/win-ffi/enums/user32/pointer_flags.rb +82 -0
  64. data/lib/win-ffi/enums/user32/pointer_input_type.rb +13 -0
  65. data/lib/win-ffi/enums/user32/process_dpi_awareness.rb +12 -0
  66. data/lib/win-ffi/enums/user32/queue_status_flags.rb +36 -0
  67. data/lib/win-ffi/enums/user32/rim.rb +12 -0
  68. data/lib/win-ffi/enums/user32/touch_injection_flags.rb +13 -0
  69. data/lib/win-ffi/enums/user32/touch_mask.rb +13 -0
  70. data/lib/win-ffi/enums/user32/user_object_information_flags.rb +22 -0
  71. data/lib/win-ffi/enums/user32/virtual_key_flags.rb +214 -0
  72. data/lib/win-ffi/enums/user32/window/animate_window_flags.rb +31 -0
  73. data/lib/win-ffi/enums/user32/window/broadcast_system_flags.rb +20 -0
  74. data/lib/win-ffi/enums/user32/window/broadcast_system_message_flags.rb +12 -0
  75. data/lib/win-ffi/enums/user32/window/combo_box_message.rb +53 -0
  76. data/lib/win-ffi/enums/user32/window/get_class_long_flags.rb +34 -0
  77. data/lib/win-ffi/enums/user32/window/get_window_flags.rb +38 -0
  78. data/lib/win-ffi/enums/user32/window/get_window_long_flags.rb +16 -0
  79. data/lib/win-ffi/enums/user32/window/menu_flags.rb +54 -0
  80. data/lib/win-ffi/enums/user32/window/message_box_flags.rb +90 -0
  81. data/lib/win-ffi/enums/user32/window/message_box_return.rb +18 -0
  82. data/lib/win-ffi/enums/user32/window/notification/button_notification.rb +20 -0
  83. data/lib/win-ffi/enums/user32/window/notification/edit_notification.rb +19 -0
  84. data/lib/win-ffi/enums/user32/window/notification/static_notification.rb +13 -0
  85. data/lib/win-ffi/enums/user32/window/peek_message_flags.rb +13 -0
  86. data/lib/win-ffi/enums/user32/window/set_window_pos_flags.rb +48 -0
  87. data/lib/win-ffi/enums/user32/window/show_window_flags.rb +41 -0
  88. data/lib/win-ffi/enums/user32/window/smto.rb +22 -0
  89. data/lib/win-ffi/enums/user32/window/style/button_control_style.rb +37 -0
  90. data/lib/win-ffi/enums/user32/window/style/combo_box_style.rb +22 -0
  91. data/lib/win-ffi/enums/user32/window/style/edit_style.rb +23 -0
  92. data/lib/win-ffi/enums/user32/window/style/static_style.rb +45 -0
  93. data/lib/win-ffi/enums/user32/window/style/window_class_style.rb +50 -0
  94. data/lib/win-ffi/enums/user32/window/style/window_style.rb +85 -0
  95. data/lib/win-ffi/enums/user32/window/style/window_style_ex.rb +98 -0
  96. data/lib/win-ffi/enums/user32/window/system_menu_command.rb +37 -0
  97. data/lib/win-ffi/enums/user32/window/system_metrics_flags.rb +300 -0
  98. data/lib/win-ffi/enums/user32/window/system_parameters_info_action.rb +225 -0
  99. data/lib/win-ffi/enums/user32/window/system_parameters_info_flags.rb +246 -0
  100. data/lib/win-ffi/enums/user32/window/track_popup_menu_flags.rb +70 -0
  101. data/lib/win-ffi/enums/user32/window/window_long.rb +22 -0
  102. data/lib/win-ffi/enums/user32/window/window_messages.rb +222 -0
  103. data/lib/win-ffi/enums/user32/window_hook.rb +56 -0
  104. data/lib/win-ffi/enums/user32.rb +5 -0
  105. data/lib/win-ffi/functions/advapi32/process.rb +33 -0
  106. data/lib/win-ffi/functions/advapi32/system_info.rb +17 -0
  107. data/lib/win-ffi/functions/comctl32/control.rb +11 -0
  108. data/lib/win-ffi/functions/comctl32/listbox.rb +20 -0
  109. data/lib/win-ffi/functions/comctl32.rb +7 -0
  110. data/lib/win-ffi/functions/comdlg32/color.rb +9 -0
  111. data/lib/win-ffi/functions/comdlg32/error.rb +6 -0
  112. data/lib/win-ffi/functions/comdlg32/find_replace.rb +9 -0
  113. data/lib/win-ffi/functions/comdlg32/font.rb +9 -0
  114. data/lib/win-ffi/functions/comdlg32.rb +7 -0
  115. data/lib/win-ffi/functions/gdi32/bitmap.rb +275 -0
  116. data/lib/win-ffi/functions/gdi32/brush.rb +54 -0
  117. data/lib/win-ffi/functions/gdi32/device_context.rb +126 -0
  118. data/lib/win-ffi/functions/gdi32/filled_shape.rb +68 -0
  119. data/lib/win-ffi/functions/gdi32/font.rb +9 -0
  120. data/lib/win-ffi/functions/gdi32/metafile.rb +173 -0
  121. data/lib/win-ffi/functions/gdi32/opengl.rb +29 -0
  122. data/lib/win-ffi/functions/gdi32/painting_drawing.rb +50 -0
  123. data/lib/win-ffi/functions/gdi32/text.rb +376 -0
  124. data/lib/win-ffi/functions/gdi32.rb +7 -0
  125. data/lib/win-ffi/functions/kernel32/activation.rb +22 -0
  126. data/lib/win-ffi/functions/kernel32/dll.rb +92 -0
  127. data/lib/win-ffi/functions/kernel32/error.rb +28 -0
  128. data/lib/win-ffi/functions/kernel32/filesystem.rb +22 -0
  129. data/lib/win-ffi/functions/kernel32/handle.rb +29 -0
  130. data/lib/win-ffi/functions/kernel32/memory.rb +478 -0
  131. data/lib/win-ffi/functions/kernel32/process.rb +359 -0
  132. data/lib/win-ffi/functions/kernel32/resource.rb +141 -0
  133. data/lib/win-ffi/functions/kernel32/sound.rb +10 -0
  134. data/lib/win-ffi/functions/kernel32/string.rb +38 -0
  135. data/lib/win-ffi/functions/kernel32/system_info.rb +183 -0
  136. data/lib/win-ffi/functions/kernel32/time.rb +220 -0
  137. data/lib/win-ffi/functions/kernel32/volume.rb +130 -0
  138. data/lib/win-ffi/functions/kernel32.rb +15 -0
  139. data/lib/win-ffi/functions/msimg32/bitmap.rb +46 -0
  140. data/lib/win-ffi/functions/msvcrt/handle.rb +13 -0
  141. data/lib/win-ffi/functions/netapi32/network_management.rb +13 -0
  142. data/lib/win-ffi/functions/netapi32.rb +7 -0
  143. data/lib/win-ffi/functions/ntdll/system_info.rb +14 -0
  144. data/lib/win-ffi/functions/secur32/system_info.rb +30 -0
  145. data/lib/win-ffi/functions/shell32/icon.rb +49 -0
  146. data/lib/win-ffi/functions/shutdown.rb +84 -0
  147. data/lib/win-ffi/functions/thread.rb +230 -0
  148. data/lib/win-ffi/functions/user32/accessibility.rb +23 -0
  149. data/lib/win-ffi/functions/user32/authorization.rb +19 -0
  150. data/lib/win-ffi/functions/user32/bitmap.rb +11 -0
  151. data/lib/win-ffi/functions/user32/brush.rb +10 -0
  152. data/lib/win-ffi/functions/user32/caret.rb +36 -0
  153. data/lib/win-ffi/functions/user32/clipboard.rb +84 -0
  154. data/lib/win-ffi/functions/user32/controls/button.rb +23 -0
  155. data/lib/win-ffi/functions/user32/controls/combobox.rb +29 -0
  156. data/lib/win-ffi/functions/user32/controls/listbox.rb +25 -0
  157. data/lib/win-ffi/functions/user32/controls/scrollbar.rb +95 -0
  158. data/lib/win-ffi/functions/user32/cursor.rb +74 -0
  159. data/lib/win-ffi/functions/user32/dde.rb +214 -0
  160. data/lib/win-ffi/functions/user32/desktop.rb +76 -0
  161. data/lib/win-ffi/functions/user32/device.rb +17 -0
  162. data/lib/win-ffi/functions/user32/device_context.rb +62 -0
  163. data/lib/win-ffi/functions/user32/display.rb +37 -0
  164. data/lib/win-ffi/functions/user32/error.rb +10 -0
  165. data/lib/win-ffi/functions/user32/filled_shape.rb +23 -0
  166. data/lib/win-ffi/functions/user32/gesture.rb +38 -0
  167. data/lib/win-ffi/functions/user32/hook.rb +123 -0
  168. data/lib/win-ffi/functions/user32/icon.rb +98 -0
  169. data/lib/win-ffi/functions/user32/input.rb +23 -0
  170. data/lib/win-ffi/functions/user32/keyboard.rb +177 -0
  171. data/lib/win-ffi/functions/user32/keyboard_accelerators.rb +37 -0
  172. data/lib/win-ffi/functions/user32/mouse.rb +60 -0
  173. data/lib/win-ffi/functions/user32/multiple_display_monitors.rb +43 -0
  174. data/lib/win-ffi/functions/user32/multiple_document_interface.rb +44 -0
  175. data/lib/win-ffi/functions/user32/painting_drawing.rb +173 -0
  176. data/lib/win-ffi/functions/user32/pointer.rb +154 -0
  177. data/lib/win-ffi/functions/user32/power.rb +28 -0
  178. data/lib/win-ffi/functions/user32/print.rb +14 -0
  179. data/lib/win-ffi/functions/user32/process.rb +30 -0
  180. data/lib/win-ffi/functions/user32/raw_input.rb +55 -0
  181. data/lib/win-ffi/functions/user32/rect.rb +67 -0
  182. data/lib/win-ffi/functions/user32/resource.rb +28 -0
  183. data/lib/win-ffi/functions/user32/shell.rb +29 -0
  184. data/lib/win-ffi/functions/user32/string.rb +98 -0
  185. data/lib/win-ffi/functions/user32/text.rb +48 -0
  186. data/lib/win-ffi/functions/user32/touch.rb +69 -0
  187. data/lib/win-ffi/functions/user32/transform.rb +22 -0
  188. data/lib/win-ffi/functions/user32/window/configuration.rb +15 -0
  189. data/lib/win-ffi/functions/user32/window/dialog.rb +167 -0
  190. data/lib/win-ffi/functions/user32/window/menu.rb +245 -0
  191. data/lib/win-ffi/functions/user32/window/message.rb +168 -0
  192. data/lib/win-ffi/functions/user32/window/properties.rb +50 -0
  193. data/lib/win-ffi/functions/user32/window/timer.rb +37 -0
  194. data/lib/win-ffi/functions/user32/window/window.rb +546 -0
  195. data/lib/win-ffi/functions/user32/window/window_class.rb +109 -0
  196. data/lib/win-ffi/functions/user32/window/window_proc.rb +29 -0
  197. data/lib/win-ffi/functions/user32/window_station.rb +39 -0
  198. data/lib/win-ffi/functions/user32.rb +161 -0
  199. data/lib/win-ffi/functions/winmm.rb +547 -0
  200. data/lib/win-ffi/functions/wtsapi32/process.rb +12 -0
  201. data/lib/win-ffi/lib_base.rb +54 -0
  202. data/lib/win-ffi/struct.rb +15 -0
  203. data/lib/win-ffi/structs/comctl32/init_common_controls_ex.rb +10 -0
  204. data/lib/win-ffi/structs/comdlg32/choose_color.rb +23 -0
  205. data/lib/win-ffi/structs/comdlg32/choose_font.rb +28 -0
  206. data/lib/win-ffi/structs/comdlg32/find_replace.rb +24 -0
  207. data/lib/win-ffi/structs/gdi32/abc.rb +9 -0
  208. data/lib/win-ffi/structs/gdi32/abcfloat.rb +10 -0
  209. data/lib/win-ffi/structs/gdi32/bitmap.rb +13 -0
  210. data/lib/win-ffi/structs/gdi32/bitmap_info.rb +11 -0
  211. data/lib/win-ffi/structs/gdi32/bitmap_info_header.rb +17 -0
  212. data/lib/win-ffi/structs/gdi32/blend_function.rb +10 -0
  213. data/lib/win-ffi/structs/gdi32/display_device.rb +12 -0
  214. data/lib/win-ffi/structs/gdi32/handle_table.rb +7 -0
  215. data/lib/win-ffi/structs/gdi32/kerning_pair.rb +9 -0
  216. data/lib/win-ffi/structs/gdi32/log_brush.rb +10 -0
  217. data/lib/win-ffi/structs/gdi32/log_font.rb +20 -0
  218. data/lib/win-ffi/structs/gdi32/meta_file_pict.rb +10 -0
  219. data/lib/win-ffi/structs/gdi32/palette_entry.rb +10 -0
  220. data/lib/win-ffi/structs/gdi32/pixel_format_descriptor.rb +57 -0
  221. data/lib/win-ffi/structs/gdi32/rgb_quad.rb +10 -0
  222. data/lib/win-ffi/structs/kernel32/actctx.rb +22 -0
  223. data/lib/win-ffi/structs/netapi32/wksta_info_100.rb +9 -0
  224. data/lib/win-ffi/structs/os_version_info.rb +10 -0
  225. data/lib/win-ffi/structs/os_version_info_ex.rb +70 -0
  226. data/lib/win-ffi/structs/paint_struct.rb +12 -0
  227. data/lib/win-ffi/structs/point.rb +10 -0
  228. data/lib/win-ffi/structs/rect.rb +28 -0
  229. data/lib/win-ffi/structs/size.rb +6 -0
  230. data/lib/win-ffi/structs/user32/controls/combobox_info.rb +13 -0
  231. data/lib/win-ffi/structs/user32/controls/scroll_info.rb +13 -0
  232. data/lib/win-ffi/structs/user32/controls/scrollbar_info.rb +13 -0
  233. data/lib/win-ffi/structs/user32/cursor_info.rb +10 -0
  234. data/lib/win-ffi/structs/user32/display_device.rb +12 -0
  235. data/lib/win-ffi/structs/user32/draw_text_params.rb +11 -0
  236. data/lib/win-ffi/structs/user32/icon_info.rb +11 -0
  237. data/lib/win-ffi/structs/user32/icon_info_ex.rb +15 -0
  238. data/lib/win-ffi/structs/user32/last_input_info.rb +8 -0
  239. data/lib/win-ffi/structs/user32/mouse_move_point.rb +10 -0
  240. data/lib/win-ffi/structs/user32/msg.rb +16 -0
  241. data/lib/win-ffi/structs/user32/pointer_info.rb +25 -0
  242. data/lib/win-ffi/structs/user32/pointer_pen_info.rb +18 -0
  243. data/lib/win-ffi/structs/user32/pointer_touch_info.rb +17 -0
  244. data/lib/win-ffi/structs/user32/raw_input_device_list.rb +10 -0
  245. data/lib/win-ffi/structs/user32/raw_input_header.rb +10 -0
  246. data/lib/win-ffi/structs/user32/touch_hit_testing_input.rb +11 -0
  247. data/lib/win-ffi/structs/user32/touch_hit_testing_proximity_evaluation.rb +8 -0
  248. data/lib/win-ffi/structs/user32/track_mouse_event.rb +10 -0
  249. data/lib/win-ffi/structs/user32/window/alt_tab_info.rb +17 -0
  250. data/lib/win-ffi/structs/user32/window/bs_info.rb +12 -0
  251. data/lib/win-ffi/structs/user32/window/create_struct.rb +22 -0
  252. data/lib/win-ffi/structs/user32/window/dlg_template.rb +13 -0
  253. data/lib/win-ffi/structs/user32/window/flashw_info.rb +11 -0
  254. data/lib/win-ffi/structs/user32/window/gui_thread_info.rb +17 -0
  255. data/lib/win-ffi/structs/user32/window/luid.rb +8 -0
  256. data/lib/win-ffi/structs/user32/window/menu_info.rb +13 -0
  257. data/lib/win-ffi/structs/user32/window/menu_item_info.rb +18 -0
  258. data/lib/win-ffi/structs/user32/window/menu_item_template.rb +9 -0
  259. data/lib/win-ffi/structs/user32/window/menubar_info.rb +12 -0
  260. data/lib/win-ffi/structs/user32/window/msgbox_params.rb +16 -0
  261. data/lib/win-ffi/structs/user32/window/non_client_metrics.rb +29 -0
  262. data/lib/win-ffi/structs/user32/window/title_bar_info.rb +9 -0
  263. data/lib/win-ffi/structs/user32/window/tpm_params.rb +8 -0
  264. data/lib/win-ffi/structs/user32/window/update_layered_window_info.rb +22 -0
  265. data/lib/win-ffi/structs/user32/window/window_placement.rb +32 -0
  266. data/lib/win-ffi/structs/user32/window/window_pos.rb +46 -0
  267. data/lib/win-ffi/structs/user32/window/wndclass.rb +19 -0
  268. data/lib/win-ffi/structs/user32/window/wndclassex.rb +40 -0
  269. data/lib/win-ffi/version.rb +3 -0
  270. data/lib/win-ffi.rb +42 -0
  271. metadata +363 -0
@@ -0,0 +1,29 @@
1
+ require 'win-ffi/functions/gdi32'
2
+
3
+ require 'win-ffi/structs/gdi32/pixel_format_descriptor'
4
+
5
+ module WinFFI
6
+ module Gdi32
7
+
8
+ #int ChoosePixelFormat(
9
+ # HDC hdc,
10
+ # const PIXELFORMATDESCRIPTOR *ppfd)
11
+ attach_function 'ChoosePixelFormat', [:pointer, PIXELFORMATDESCRIPTOR.ptr], :int
12
+
13
+ #int DescribePixelFormat(
14
+ # HDC hdc,
15
+ # int iPixelFormat,
16
+ # UINT nBytes,
17
+ # LPPIXELFORMATDESCRIPTOR ppfd)
18
+ attach_function 'DescribePixelFormat', [:pointer, :int, :uint, :pointer], :int
19
+
20
+ #BOOL SetPixelFormat(
21
+ # HDC hdc,
22
+ # int iPixelFormat,
23
+ # const PIXELFORMATDESCRIPTOR *ppfd)
24
+ attach_function 'SetPixelFormat', [:pointer, :int, :pointer], :bool
25
+
26
+ #BOOL SwapBuffers( HDC hdc)
27
+ attach_function 'SwapBuffers', [:pointer], :bool
28
+ end
29
+ end
@@ -0,0 +1,50 @@
1
+ require 'win-ffi/functions/gdi32'
2
+
3
+ module WinFFI
4
+ module Gdi32
5
+ #BOOL GdiFlush(void)
6
+ attach_function 'GdiFlush', [:void], :bool
7
+
8
+ #DWORD GdiGetBatchLimit(void)
9
+ attach_function 'GdiGetBatchLimit', [:void], :dword
10
+
11
+ #DWORD GdiSetBatchLimit( _In_ DWORD dwLimit )
12
+ attach_function 'GdiSetBatchLimit', [:dword], :dword
13
+
14
+ #COLORREF GetBkColor( _In_ HDC hdc )
15
+ attach_function 'GetBkColor', [:hdc], :colorref
16
+
17
+ #int GetBkMode( _In_ HDC hdc )
18
+ attach_function 'GetBkMode', [:hdc], :int
19
+
20
+ #UINT GetBoundsRect(
21
+ # _In_ HDC hdc,
22
+ # _Out_ LPRECT lprcBounds,
23
+ # _In_ UINT flags )
24
+ attach_function 'GetBoundsRect', [:hdc, RECT.ptr, :uint], :uint
25
+
26
+ #int GetROP2( _In_ HDC hdc )
27
+ attach_function 'GetROP2', [:hdc], :int
28
+
29
+ #COLORREF SetBkColor(
30
+ # _In_ HDC hdc,
31
+ # _In_ COLORREF crColor )
32
+ attach_function 'SetBkColor', [:hdc, :colorref], :colorref
33
+
34
+ #int SetBkMode(
35
+ # _In_ HDC hdc,
36
+ # _In_ int iBkMode )
37
+ attach_function 'SetBkMode', [:hdc, :int], :int
38
+
39
+ #UINT SetBoundsRect(
40
+ # _In_ HDC hdc,
41
+ # _In_ const RECT *lprcBounds,
42
+ # _In_ UINT flags )
43
+ attach_function 'SetBoundsRect', [:hdc, RECT.ptr, :uint], :uint
44
+
45
+ #int SetROP2(
46
+ # _In_ HDC hdc,
47
+ # _In_ int fnDrawMode )
48
+ attach_function 'SetROP2', [:hdc, :int], :int
49
+ end
50
+ end
@@ -0,0 +1,376 @@
1
+ require 'win-ffi/functions/gdi32'
2
+
3
+ require 'win-ffi/structs/gdi32/abc'
4
+ require 'win-ffi/structs/gdi32/abcfloat'
5
+ require 'win-ffi/structs/gdi32/kerning_pair'
6
+
7
+ module WinFFI
8
+ module Gdi32
9
+
10
+ typedef :pointer, :hfont
11
+
12
+ #HANDLE AddFontMemResourceEx(
13
+ # _In_ PVOID pbFont,
14
+ # _In_ DWORD cbFont,
15
+ # _In_ PVOID pdv,
16
+ # _In_ DWORD *pcFonts )
17
+ attach_function 'AddFontMemResourceEx', [:pointer, :dword, :pointer, :pointer], :handle
18
+
19
+ #int AddFontResource( _In_ LPCTSTR lpszFilename )
20
+ attach_function 'AddFontResourceA', [:string], :int
21
+ attach_function 'AddFontResourceW', [:string], :int
22
+
23
+ #int AddFontResourceEx(
24
+ # _In_ LPCTSTR lpszFilename,
25
+ # _In_ DWORD fl,
26
+ # _In_ PVOID pdv )
27
+ attach_function 'AddFontResourceExA', [:string, :dword, :pointer], :int
28
+ attach_function 'AddFontResourceExW', [:string, :dword, :pointer], :int
29
+
30
+ #HFONT CreateFont(
31
+ # __in int nHeight,
32
+ # __in int nWidth,
33
+ # __in int nEscapement,
34
+ # __in int nOrientation,
35
+ # __in int fnWeight,
36
+ # __in DWORD fdwItalic,
37
+ # __in DWORD fdwUnderline,
38
+ # __in DWORD fdwStrikeOut,
39
+ # __in DWORD fdwCharSet,
40
+ # __in DWORD fdwOutputPrecision,
41
+ # __in DWORD fdwClipPrecision,
42
+ # __in DWORD fdwQuality,
43
+ # __in DWORD fdwPitchAndFamily,
44
+ # __in LPCTSTR lpszFace)
45
+ attach_function 'CreateFontA', [:int, :int, :int, :int, :int, :uint, :uint, :uint, :uint, :uint, :uint, :uint, :uint, :string], :pointer
46
+ attach_function 'CreateFontW', [:int, :int, :int, :int, :int, :uint, :uint, :uint, :uint, :uint, :uint, :uint, :uint, :string], :pointer
47
+
48
+ #HFONT CreateFontIndirect( _In_ const LOGFONT *lplf )
49
+ attach_function 'CreateFontIndirectA', [:pointer], :hfont
50
+ attach_function 'CreateFontIndirectW', [:pointer], :hfont
51
+
52
+ #HFONT CreateFontIndirectEx( _In_ const ENUMLOGFONTEXDV *penumlfex )
53
+ attach_function 'CreateFontIndirectExA', [:pointer], :hfont
54
+ attach_function 'CreateFontIndirectExW', [:pointer], :hfont
55
+
56
+ #BOOL CreateScalableFontResource(
57
+ # _In_ DWORD fdwHidden,
58
+ # _In_ LPCTSTR lpszFontRes,
59
+ # _In_ LPCTSTR lpszFontFile,
60
+ # _In_ LPCTSTR lpszCurrentPath )
61
+ attach_function 'CreateScalableFontResourceA', [:dword, :string, :string, :string], :bool
62
+ attach_function 'CreateScalableFontResourceW', [:dword, :string, :string, :string], :bool
63
+
64
+ #BOOL EnableEUDC( _In_ HDC BOOL fEnableEUDC )
65
+ attach_function 'EnableEUDC', [:bool], :bool
66
+
67
+ #TODO
68
+ #int CALLBACK EnumFontFamExProc(
69
+ # const LOGFONT *lpelfe,
70
+ # const TEXTMETRIC *lpntme,
71
+ # DWORD FontType,
72
+ # LPARAM lParam )
73
+
74
+ #int EnumFontFamilies(
75
+ # _In_ HDC hdc,
76
+ # _In_ LPCTSTR lpszFamily,
77
+ # _In_ FONTENUMPROC lpEnumFontFamProc,
78
+ # _In_ LPARAM lParam )
79
+ attach_function 'EnumFontFamiliesA', [:hdc, :string, :pointer, :lparam], :int
80
+ attach_function 'EnumFontFamiliesW', [:hdc, :string, :pointer, :lparam], :int
81
+
82
+ #int EnumFontFamiliesEx(
83
+ # _In_ HDC hdc,
84
+ # _In_ LPLOGFONT lpLogfont,
85
+ # _In_ FONTENUMPROC lpEnumFontFamExProc,
86
+ # _In_ LPARAM lParam,
87
+ # DWORD dwFlags )
88
+ attach_function 'EnumFontFamiliesExA', [:hdc, :pointer, :pointer, :lparam, :dword], :int
89
+ attach_function 'EnumFontFamiliesExW', [:hdc, :pointer, :pointer, :lparam, :dword], :int
90
+
91
+ #TODO
92
+ #int CALLBACK EnumFontFamProc(
93
+ # _In_ ENUMLOGFONT *lpelf,
94
+ # _In_ NEWTEXTMETRIC *lpntm,
95
+ # _In_ DWORD FontType,
96
+ # _In_ LPARAM lParam )
97
+
98
+ #int EnumFonts(
99
+ # _In_ HDC hdc,
100
+ # _In_ LPCTSTR lpFaceName,
101
+ # _In_ FONTENUMPROC lpFontFunc,
102
+ # _In_ LPARAM lParam )
103
+ attach_function 'EnumFontsA', [:hdc, :string, :pointer, :lparam], :int
104
+ attach_function 'EnumFontsW', [:hdc, :string, :pointer, :lparam], :int
105
+
106
+ #TODO
107
+ #int CALLBACK EnumFontsProc(
108
+ # _In_ const LOGFONT *lplf,
109
+ # _In_ const TEXTMETRIC *lptm,
110
+ # _In_ DWORD dwType,
111
+ # _In_ LPARAM lpData )
112
+
113
+ #BOOL ExtTextOut(
114
+ # _In_ HDC hdc,
115
+ # _In_ int X,
116
+ # _In_ int Y,
117
+ # _In_ UINT fuOptions,
118
+ # _In_ const RECT *lprc,
119
+ # _In_ LPCTSTR lpString,
120
+ # _In_ UINT cbCount,
121
+ # _In_ const INT *lpDx )
122
+ attach_function 'ExtTextOutA', [:hdc, :int, :int, :uint, RECT.ptr, :string, :uint, :pointer], :bool
123
+ attach_function 'ExtTextOutW', [:hdc, :int, :int, :uint, RECT.ptr, :string, :uint, :pointer], :bool
124
+
125
+ #BOOL GetAspectRatioFilterEx(
126
+ # _In_ HDC hdc,
127
+ # _Out_ LPSIZE lpAspectRatio )
128
+ attach_function 'GetAspectRatioFilterEx', [:hdc, SIZE.ptr], :bool
129
+
130
+ #BOOL GetCharABCWidths(
131
+ # _In_ HDC hdc,
132
+ # _In_ UINT uFirstChar,
133
+ # _In_ UINT uLastChar,
134
+ # _Out_ LPABC lpabc )
135
+ attach_function 'GetCharABCWidthsA', [:hdc, :uint, :uint, ABC.ptr], :bool
136
+ attach_function 'GetCharABCWidthsW', [:hdc, :uint, :uint, ABC.ptr], :bool
137
+
138
+ #BOOL GetCharABCWidthsFloat(
139
+ # _In_ HDC hdc,
140
+ # _In_ UINT iFirstChar,
141
+ # _In_ UINT iLastChar,
142
+ # _Out_ LPABCFLOAT lpABCF )
143
+ attach_function 'GetCharABCWidthsFloatA', [:hdc, :uint, :uint, ABCFLOAT.ptr], :bool
144
+ attach_function 'GetCharABCWidthsFloatW', [:hdc, :uint, :uint, ABCFLOAT.ptr], :bool
145
+
146
+ #BOOL GetCharABCWidthsI(
147
+ # _In_ HDC hdc,
148
+ # _In_ UINT giFirst,
149
+ # _In_ UINT cgi,
150
+ # _In_ LPWORD pgi,
151
+ # _Out_ LPABC lpabc )
152
+ attach_function 'GetCharABCWidthsI', [:hdc, :uint, :uint, :pointer, ABC.ptr], :bool
153
+
154
+ #DWORD GetCharacterPlacement(
155
+ # _In_ HDC hdc,
156
+ # _In_ LPCTSTR lpString,
157
+ # _In_ int nCount,
158
+ # _In_ int nMaxExtent,
159
+ # _Inout_ LPGCP_RESULTS lpResults,
160
+ # _In_ DWORD dwFlags )
161
+ attach_function 'GetCharacterPlacementA', [:hdc, :string, :int, :int, :pointer, :dword], :dword
162
+ attach_function 'GetCharacterPlacementW', [:hdc, :string, :int, :int, :pointer, :dword], :dword
163
+
164
+ #BOOL GetCharWidth32(
165
+ # _In_ HDC hdc,
166
+ # _In_ UINT iFirstChar,
167
+ # _In_ UINT iLastChar,
168
+ # _Out_ LPINT lpBuffer )
169
+ attach_function 'GetCharWidth32A', [:hdc, :uint, :uint, :pointer], :bool
170
+ attach_function 'GetCharWidth32W', [:hdc, :uint, :uint, :pointer], :bool
171
+
172
+ #BOOL GetCharWidth(
173
+ # _In_ HDC hdc,
174
+ # _In_ UINT iFirstChar,
175
+ # _In_ UINT iLastChar,
176
+ # _Out_ LPINT lpBuffer )
177
+ attach_function 'GetCharWidthA', [:hdc, :uint, :uint, :pointer], :bool
178
+ attach_function 'GetCharWidthW', [:hdc, :uint, :uint, :pointer], :bool
179
+
180
+ #BOOL GetCharWidthFloat(
181
+ # _In_ HDC hdc,
182
+ # _In_ UINT iFirstChar,
183
+ # _In_ UINT iLastChar,
184
+ # _Out_ PFLOAT pxBuffer )
185
+ attach_function 'GetCharWidthFloatA', [:hdc, :uint, :uint, :pointer], :bool
186
+ attach_function 'GetCharWidthFloatW', [:hdc, :uint, :uint, :pointer], :bool
187
+
188
+ #BOOL GetCharWidthI(
189
+ # _In_ HDC hdc,
190
+ # _In_ UINT giFirst,
191
+ # _In_ UINT cgi,
192
+ # _In_ LPWORD pgi,
193
+ # _Out_ LPINT lpBuffer )
194
+ attach_function 'GetCharWidthI', [:hdc, :uint, :uint, :pointer, :pointer], :bool
195
+
196
+ #DWORD GetFontData(
197
+ # _In_ HDC hdc,
198
+ # _In_ DWORD dwTable,
199
+ # _In_ DWORD dwOffset,
200
+ # _Out_ LPVOID lpvBuffer,
201
+ # _In_ DWORD cbData )
202
+ attach_function 'GetFontData', [:hdc, :dword, :dword, :pointer, :pointer], :dword
203
+
204
+ #DWORD GetFontLanguageInfo( _In_ HDC hdc )
205
+ attach_function 'GetFontLanguageInfo', [:hdc], :dword
206
+
207
+ #DWORD GetFontUnicodeRanges(
208
+ # _In_ HDC hdc,
209
+ # _Out_ LPGLYPHSET lpgs )
210
+ attach_function 'GetFontUnicodeRanges', [:hdc, :pointer], :dword
211
+
212
+ #DWORD GetGlyphIndices(
213
+ # _In_ HDC hdc,
214
+ # _In_ LPCTSTR lpstr,
215
+ # _In_ int c,
216
+ # _Out_ LPWORD pgi,
217
+ # _In_ DWORD fl )
218
+ attach_function 'GetGlyphIndicesA', [:hdc, :string, :int, :pointer, :dword], :dword
219
+ attach_function 'GetGlyphIndicesW', [:hdc, :string, :int, :pointer, :dword], :dword
220
+
221
+
222
+ #DWORD GetGlyphOutline(
223
+ # _In_ HDC hdc,
224
+ # _In_ UINT uChar,
225
+ # _In_ UINT uFormat,
226
+ # _Out_ LPGLYPHMETRICS lpgm,
227
+ # _In_ DWORD cbBuffer,
228
+ # _Out_ LPVOID lpvBuffer,
229
+ # _In_ const MAT2 *lpmat2 )
230
+ attach_function 'GetGlyphOutline', [:hdc, :uint, :uint, :pointer, :dword, :pointer, :pointer], :dword
231
+ attach_function 'GetGlyphOutlineA', [:hdc, :uint, :uint, :pointer, :dword, :pointer, :pointer], :dword
232
+ attach_function 'GetGlyphOutlineW', [:hdc, :uint, :uint, :pointer, :dword, :pointer, :pointer], :dword
233
+
234
+ #DWORD GetKerningPairs(
235
+ # _In_ HDC hdc,
236
+ # _In_ DWORD nNumPairs,
237
+ # _Out_ LPKERNINGPAIR lpkrnpair )
238
+ attach_function 'GetKerningPairs', [:hdc, :dword, KERNINGPAIR.ptr], :dword
239
+ attach_function 'GetKerningPairsA', [:hdc, :dword, KERNINGPAIR.ptr], :dword
240
+ attach_function 'GetKerningPairsW', [:hdc, :dword, KERNINGPAIR.ptr], :dword
241
+
242
+ #UINT GetOutlineTextMetrics(
243
+ # _In_ HDC hdc,
244
+ # _In_ UINT cbData,
245
+ # _Out_opt_ LPOUTLINETEXTMETRIC lpOTM )
246
+ attach_function 'GetOutlineTextMetricsA', [:hdc, :uint, :pointer], :uint
247
+ attach_function 'GetOutlineTextMetricsW', [:hdc, :uint, :pointer], :uint
248
+
249
+ #BOOL GetRasterizerCaps(
250
+ # _Out_ LPRASTERIZER_STATUS lprs,
251
+ # _In_ UINT cb )
252
+ attach_function 'GetRasterizerCaps', [:pointer, :uint], :bool
253
+
254
+ #UINT GetTextAlign( _In_ HDC hdc )
255
+ attach_function 'GetTextAlign', [:hdc], :uint
256
+
257
+ #int GetTextCharacterExtra( _In_ HDC hdc )
258
+ attach_function 'GetTextCharacterExtra', [:hdc], :int
259
+
260
+ #COLORREF GetTextColor( _In_ HDC hdc )
261
+ attach_function 'GetTextColor', [:hdc], :colorref
262
+
263
+ #BOOL GetTextExtentExPoint(
264
+ # _In_ HDC hdc,
265
+ # _In_ LPCTSTR lpszStr,
266
+ # _In_ int cchString,
267
+ # _In_ int nMaxExtent,
268
+ # _Out_ LPINT lpnFit,
269
+ # _Out_ LPINT alpDx,
270
+ # _Out_ LPSIZE lpSize )
271
+ attach_function 'GetTextExtentExPointA', [:hdc, :string, :int, :int, :pointer, :pointer, SIZE.ptr], :bool
272
+ attach_function 'GetTextExtentExPointW', [:hdc, :string, :int, :int, :pointer, :pointer, SIZE.ptr], :bool
273
+
274
+ #BOOL GetTextExtentExPointI(
275
+ # _In_ HDC hdc,
276
+ # _In_ LPWORD pgiIn,
277
+ # _In_ int cgi,
278
+ # _In_ int nMaxExtent,
279
+ # _Out_ LPINT lpnFit,
280
+ # _Out_ LPINT alpDx,
281
+ # _Out_ LPSIZE lpSize )
282
+ attach_function 'GetTextExtentExPointI', [:hdc, :pointer, :int, :int, :pointer, :pointer, SIZE.ptr], :bool
283
+
284
+ #BOOL GetTextExtentPoint32(
285
+ # _In_ HDC hdc,
286
+ # _In_ LPCTSTR lpString,
287
+ # _In_ int c,
288
+ # _Out_ LPSIZE lpSize )
289
+ attach_function 'GetTextExtentPoint32A', [:hdc, :string, :int, SIZE.ptr], :bool
290
+ attach_function 'GetTextExtentPoint32W', [:hdc, :string, :int, SIZE.ptr], :bool
291
+
292
+ #BOOL GetTextExtentPoint(
293
+ # _In_ HDC hdc,
294
+ # _In_ LPCTSTR lpString,
295
+ # _In_ int cbString,
296
+ # _Out_ LPSIZE lpSize )
297
+ attach_function 'GetTextExtentPointA', [:hdc, :string, :int, SIZE.ptr], :bool
298
+ attach_function 'GetTextExtentPointW', [:hdc, :string, :int, SIZE.ptr], :bool
299
+
300
+ #BOOL GetTextExtentPointI(
301
+ # _In_ HDC hdc,
302
+ # _In_ LPWORD pgiIn,
303
+ # _In_ int cgi,
304
+ # _Out_ LPSIZE lpSize )
305
+ attach_function 'GetTextExtentPointI', [:hdc, :pointer, :int, SIZE.ptr], :bool
306
+
307
+ #int GetTextFace(
308
+ # _In_ HDC hdc,
309
+ # _In_ int nCount,
310
+ # _Out_ LPTSTR lpFaceName )
311
+ attach_function 'GetTextFaceA', [:hdc, :int, :string], :int
312
+ attach_function 'GetTextFaceW', [:hdc, :int, :string], :int
313
+
314
+ #BOOL GetTextMetrics(
315
+ # _In_ HDC hdc,
316
+ # _Out_ LPTEXTMETRIC lptm )
317
+ attach_function 'GetTextMetricsA', [:hdc, :pointer], :bool
318
+ attach_function 'GetTextMetricsW', [:hdc, :pointer], :bool
319
+
320
+ #BOOL PolyTextOut(
321
+ # _In_ HDC hdc,
322
+ # _In_ const POLYTEXT *pptxt,
323
+ # _In_ int cStrings )
324
+ attach_function 'PolyTextOutA', [:hdc, :pointer, :int], :bool
325
+ attach_function 'PolyTextOutW', [:hdc, :pointer, :int], :bool
326
+
327
+ #BOOL RemoveFontMemResourceEx( _In_ HANDLE fh )
328
+ attach_function 'RemoveFontMemResourceEx', [:handle], :bool
329
+
330
+ #BOOL RemoveFontResource( _In_ LPCTSTR lpFileName )
331
+ attach_function 'RemoveFontResourceA', [:string], :bool
332
+ attach_function 'RemoveFontResourceW', [:string], :bool
333
+
334
+ #BOOL RemoveFontResourceEx(
335
+ # _In_ LPCTSTR lpFileName,
336
+ # _In_ DWORD fl,
337
+ # _In_ PVOID pdv )
338
+ attach_function 'RemoveFontResourceExA', [:string, :dword, :pointer], :bool
339
+ attach_function 'RemoveFontResourceExW', [:string, :dword, :pointer], :bool
340
+
341
+ #DWORD SetMapperFlags(
342
+ # _In_ HDC hdc,
343
+ # _In_ DWORD dwFlag )
344
+ attach_function 'SetMapperFlags', [:hdc, :dword], :dword
345
+
346
+ #UINT SetTextAlign(
347
+ # _In_ HDC hdc,
348
+ # _In_ UINT fMode )
349
+ attach_function 'SetTextAlign', [:hdc, :uint], :uint
350
+
351
+ #int SetTextCharacterExtra(
352
+ # _In_ HDC hdc,
353
+ # _In_ int nCharExtra )
354
+ attach_function 'SetTextCharacterExtra', [:hdc, :int], :int
355
+
356
+ #COLORREF SetTextColor(
357
+ # _In_ HDC hdc,
358
+ # _In_ COLORREF crColor )
359
+ attach_function 'SetTextColor', [:hdc, :colorref], :colorref
360
+
361
+ #BOOL SetTextJustification(
362
+ # _In_ HDC hdc,
363
+ # _In_ int nBreakExtra,
364
+ # _In_ int nBreakCount )
365
+ attach_function 'SetTextJustification', [:hdc, :int, :int], :bool
366
+
367
+ #BOOL TextOut(
368
+ # _In_ HDC hdc,
369
+ # _In_ int nXStart,
370
+ # _In_ int nYStart,
371
+ # _In_ LPCTSTR lpString,
372
+ # _In_ int cchString )
373
+ attach_function 'TextOutA', [:hdc, :int, :int, :string, :int], :bool
374
+ attach_function 'TextOutW', [:hdc, :int, :int, :string, :int], :bool
375
+ end
376
+ end
@@ -0,0 +1,7 @@
1
+ module WinFFI
2
+ module Gdi32
3
+ extend LibBase
4
+
5
+ ffi_lib 'gdi32'
6
+ end
7
+ end
@@ -0,0 +1,22 @@
1
+ require 'win-ffi/functions/kernel32'
2
+ require 'win-ffi/structs/kernel32/actctx'
3
+
4
+ module WinFFI
5
+ module Kernel32
6
+ extend LibBase
7
+ if WindowsVersion >= :xp
8
+ # BOOL ActivateActCtx(_In_ HANDLE hActCtx, _Out_ ULONG_PTR *lpCookie)
9
+ attach_function 'ActivateActCtx', [:hwnd, :pointer], :bool
10
+
11
+ # BOOL DeactivateActCtx(_In_ DWORD dwFlags, _In_ ULONG_PTR ulCookie)
12
+ attach_function 'DeactivateActCtx', [:dword, :pointer], :bool
13
+
14
+ # void AddRefActCtx(_In_ HANDLE hActCtx)
15
+ attach_function 'AddRefActCtx', [ACTCTX.by_ref], :void
16
+
17
+ # HANDLE CreateActCtx(_Inout_ PACTCTX pActCtx)
18
+ attach_function 'CreateActCtxA', [ACTCTX.by_ref], :handle
19
+ attach_function 'CreateActCtxW', [ACTCTX.by_ref], :handle
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,92 @@
1
+ require 'win-ffi/functions/kernel32'
2
+ require 'win-ffi/enums/kernel32/get_module_handle_ex_flag'
3
+
4
+ module WinFFI
5
+ module Kernel32
6
+ #BOOL WINAPI DisableThreadLibraryCalls( _In_ HMODULE hModule )
7
+ attach_function 'DisableThreadLibraryCalls', [:hmodule], :bool
8
+
9
+ #BOOL WINAPI DllMain(
10
+ # _In_ HINSTANCE hinstDLL,
11
+ # _In_ DWORD fdwReason,
12
+ # _In_ LPVOID lpvReserved )
13
+ #attach_function 'DllMain', [:hinstance, :dword, :pointer], :bool
14
+
15
+ #BOOL WINAPI FreeLibrary( _In_ HMODULE hModule )
16
+ attach_function 'FreeLibrary', [:hmodule], :bool
17
+
18
+ #VOID WINAPI FreeLibraryAndExitThread(
19
+ # _In_ HMODULE hModule,
20
+ # _In_ DWORD dwExitCode )
21
+ attach_function 'FreeLibraryAndExitThread', [:hmodule, :dword], :void
22
+
23
+ #DWORD WINAPI GetModuleFileName(
24
+ # _In_opt_ HMODULE hModule,
25
+ # _Out_ LPTSTR lpFilename,
26
+ # _In_ DWORD nSize )
27
+ attach_function 'GetModuleFileNameA', [:hmodule, :string, :dword], :dword
28
+ attach_function 'GetModuleFileNameW', [:hmodule, :string, :dword], :dword
29
+
30
+ #HMODULE WINAPI GetModuleHandle( _In_opt_ LPCTSTR lpModuleName )
31
+ attach_function 'GetModuleHandleA', [:string], :hmodule
32
+ attach_function 'GetModuleHandleW', [:string], :hmodule
33
+
34
+ #BOOL GetModuleHandleEx(
35
+ # __in DWORD dwFlags,
36
+ # __in_opt LPCTSTR lpModuleName,
37
+ # __out HMODULE *phModule)
38
+ attach_function 'GetModuleHandleExA', [GetModuleHandleExFlag, :string, :pointer], :bool
39
+ attach_function 'GetModuleHandleExW', [GetModuleHandleExFlag, :string, :pointer], :bool
40
+
41
+ #FARPROC WINAPI GetProcAddress(
42
+ # _In_ HMODULE hModule,
43
+ # _In_ LPCSTR lpProcName )
44
+ attach_function 'GetProcAddress', [:hmodule, :string], :pointer
45
+
46
+ #HMODULE WINAPI LoadLibrary( _In_ LPCTSTR lpFileName )
47
+ attach_function 'LoadLibraryA', [:string], :hmodule
48
+ attach_function 'LoadLibraryW', [:string], :hmodule
49
+
50
+ #HMODULE WINAPI LoadLibraryEx(
51
+ # _In_ LPCTSTR lpFileName,
52
+ # _Reserved_ HANDLE hFile,
53
+ # _In_ DWORD dwFlags )
54
+ attach_function 'LoadLibraryExA', [:string, :handle, :dword], :hmodule
55
+ attach_function 'LoadLibraryExW', [:string, :handle, :dword], :hmodule
56
+
57
+ #DWORD WINAPI LoadModule(
58
+ # _In_ LPCSTR lpModuleName,
59
+ # _In_ LPVOID lpParameterBlock )
60
+ attach_function 'LoadModule', [:string, :pointer], :dword
61
+
62
+ if WindowsVersion.sp >= 1 || WindowsVersion >= :vista
63
+
64
+ #DWORD WINAPI GetDllDirectory(
65
+ # _In_ DWORD nBufferLength,
66
+ # _Out_ LPTSTR lpBuffer )
67
+ attach_function 'GetDllDirectoryA', [:dword, :pointer], :dword
68
+ attach_function 'GetDllDirectoryW', [:dword, :pointer], :dword
69
+
70
+ #BOOL WINAPI SetDllDirectory( _In_opt_ LPCTSTR lpPathName )
71
+ attach_function 'SetDllDirectoryA', [:string], :bool
72
+ attach_function 'SetDllDirectoryW', [:string], :bool
73
+
74
+ if WindowsVersion >= 8
75
+
76
+ #DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory( _In_ PCWSTR NewDirectory )
77
+ attach_function 'AddDllDirectory', [:pointer], :pointer
78
+
79
+ #HMODULE WINAPI LoadPackagedLibrary(
80
+ # _In_ LPCWSTR lpwLibFileName,
81
+ # _Reserved_ DWORD Reserved )
82
+ attach_function 'LoadPackagedLibrary', [:string, :dword], :hmodule
83
+
84
+ #BOOL WINAPI RemoveDllDirectory( _In_ DLL_DIRECTORY_COOKIE Cookie )
85
+ attach_function 'RemoveDllDirectory', [:pointer], :bool
86
+
87
+ #BOOL WINAPI SetDefaultDllDirectories( _In_ DWORD DirectoryFlags )
88
+ attach_function 'SetDefaultDllDirectories', [:dword], :bool
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,28 @@
1
+ require 'win-ffi/functions/kernel32'
2
+ require 'win-ffi/enums/kernel32/format_message_flags'
3
+ require 'win-ffi/enums/kernel32/set_error_mode_flags'
4
+
5
+ module WinFFI
6
+ module Kernel32
7
+ #xp
8
+ #DWORD WINAPI GetLastError(void)
9
+ attach_function 'GetLastError', [], :dword
10
+
11
+ #void WINAPI SetLastError( _In_ DWORD dwErrCode )
12
+ attach_function 'SetLastError', [:dword], :void
13
+
14
+ #UINT WINAPI SetErrorMode( _In_ UINT uMode )
15
+ attach_function 'SetErrorMode', [SetErrorModeFlags], :int
16
+
17
+ #DWORD WINAPI FormatMessage(
18
+ # _In_ DWORD dwFlags,
19
+ # _In_opt_ LPCVOID lpSource,
20
+ # _In_ DWORD dwMessageId,
21
+ # _In_ DWORD dwLanguageId,
22
+ # _Out_ LPTSTR lpBuffer,
23
+ # _In_ DWORD nSize,
24
+ # _In_opt_ va_list *Arguments )
25
+ attach_function 'FormatMessageA', [FormatMessageFlags, :pointer, :dword, :dword, :pointer, :dword, :pointer], :dword
26
+ attach_function 'FormatMessageW', [FormatMessageFlags, :pointer, :dword, :dword, :pointer, :dword, :pointer], :dword
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ require 'win-ffi/functions/kernel32'
2
+
3
+ module WinFFI
4
+ module Kernel32
5
+ #BOOL WINAPI GetDiskFreeSpace(
6
+ # _In_ LPCTSTR lpRootPathName,
7
+ # _Out_ LPDWORD lpSectorsPerCluster,
8
+ # _Out_ LPDWORD lpBytesPerSector,
9
+ # _Out_ LPDWORD lpNumberOfFreeClusters,
10
+ # _Out_ LPDWORD lpTotalNumberOfClusters )
11
+ attach_function 'GetDiskFreeSpaceA', [:string, :pointer, :pointer, :pointer, :pointer], :bool
12
+ attach_function 'GetDiskFreeSpaceW', [:string, :pointer, :pointer, :pointer, :pointer], :bool
13
+
14
+ #BOOL WINAPI GetDiskFreeSpaceEx(
15
+ # _In_opt_ LPCTSTR lpDirectoryName,
16
+ # _Out_opt_ PULARGE_INTEGER lpFreeBytesAvailable,
17
+ # _Out_opt_ PULARGE_INTEGER lpTotalNumberOfBytes,
18
+ # _Out_opt_ PULARGE_INTEGER lpTotalNumberOfFreeBytes )
19
+ attach_function 'GetDiskFreeSpaceExA', [:string, :pointer, :pointer, :pointer], :bool
20
+ attach_function 'GetDiskFreeSpaceExW', [:string, :pointer, :pointer, :pointer], :bool
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ require 'win-ffi/functions/kernel32'
2
+
3
+ module WinFFI
4
+ module Kernel32
5
+ #BOOL WINAPI CloseHandle( _In_ HANDLE hObject )
6
+ attach_function 'CloseHandle', [:handle], :bool
7
+
8
+ #BOOL WINAPI DuplicateHandle(
9
+ # _In_ HANDLE hSourceProcessHandle,
10
+ # _In_ HANDLE hSourceHandle,
11
+ # _In_ HANDLE hTargetProcessHandle,
12
+ # _Out_ LPHANDLE lpTargetHandle,
13
+ # _In_ DWORD dwDesiredAccess,
14
+ # _In_ BOOL bInheritHandle,
15
+ # _In_ DWORD dwOptions )
16
+ attach_function 'DuplicateHandle', [:handle, :handle, :handle, :pointer, :dword, :bool, :dword], :bool
17
+
18
+ #BOOL WINAPI GetHandleInformation(
19
+ # _In_ HANDLE hObject,
20
+ # _Out_ LPDWORD lpdwFlags )
21
+ attach_function 'GetHandleInformation', [:handle, :pointer], :bool
22
+
23
+ #BOOL WINAPI SetHandleInformation(
24
+ # _In_ HANDLE hObject,
25
+ # _In_ DWORD dwMask,
26
+ # _In_ DWORD dwFlags )
27
+ attach_function 'SetHandleInformation', [:handle, :dword, :dword], :bool
28
+ end
29
+ end