windows-pr 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +444 -438
- data/MANIFEST +68 -65
- data/README +154 -153
- data/Rakefile +42 -37
- data/doc/conversion_guide.txt +37 -37
- data/lib/windows/clipboard.rb +61 -61
- data/lib/windows/com.rb +192 -192
- data/lib/windows/com/accessibility.rb +16 -16
- data/lib/windows/com/automation.rb +149 -149
- data/lib/windows/com/variant.rb +24 -24
- data/lib/windows/console.rb +114 -114
- data/lib/windows/debug.rb +35 -35
- data/lib/windows/device_io.rb +248 -248
- data/lib/windows/directory.rb +27 -27
- data/lib/windows/error.rb +504 -498
- data/lib/windows/eventlog.rb +80 -80
- data/lib/windows/file.rb +264 -264
- data/lib/windows/file_mapping.rb +25 -25
- data/lib/windows/filesystem.rb +15 -15
- data/lib/windows/gdi/bitmap.rb +65 -65
- data/lib/windows/gdi/device_context.rb +46 -46
- data/lib/windows/gdi/metafile.rb +40 -40
- data/lib/windows/gdi/painting_drawing.rb +115 -115
- data/lib/windows/handle.rb +23 -23
- data/lib/windows/library.rb +44 -44
- data/lib/windows/limits.rb +34 -34
- data/lib/windows/mailslot.rb +24 -24
- data/lib/windows/memory.rb +128 -128
- data/lib/windows/msvcrt/buffer.rb +75 -75
- data/lib/windows/msvcrt/directory.rb +31 -31
- data/lib/windows/msvcrt/file.rb +47 -47
- data/lib/windows/msvcrt/io.rb +73 -73
- data/lib/windows/msvcrt/string.rb +182 -182
- data/lib/windows/msvcrt/time.rb +169 -169
- data/lib/windows/national.rb +580 -580
- data/lib/windows/network/management.rb +525 -525
- data/lib/windows/network/snmp.rb +92 -92
- data/lib/windows/network/winsock.rb +128 -128
- data/lib/windows/nio.rb +50 -50
- data/lib/windows/ntfs/winternl.rb +117 -117
- data/lib/windows/path.rb +143 -143
- data/lib/windows/pipe.rb +42 -42
- data/lib/windows/process.rb +176 -176
- data/lib/windows/registry.rb +171 -171
- data/lib/windows/security.rb +479 -479
- data/lib/windows/security/authentication.rb +32 -32
- data/lib/windows/security/sspi.rb +153 -0
- data/lib/windows/service.rb +142 -142
- data/lib/windows/shell.rb +171 -171
- data/lib/windows/socket.rb +86 -86
- data/lib/windows/sound.rb +39 -39
- data/lib/windows/synchronize.rb +133 -133
- data/lib/windows/system_info.rb +229 -229
- data/lib/windows/thread.rb +64 -64
- data/lib/windows/time.rb +48 -48
- data/lib/windows/tool_helper.rb +36 -36
- data/lib/windows/unicode.rb +155 -155
- data/lib/windows/volume.rb +61 -61
- data/lib/windows/window.rb +81 -81
- data/lib/windows/window/classes.rb +59 -59
- data/lib/windows/window/dialog.rb +91 -91
- data/lib/windows/window/menu.rb +102 -102
- data/lib/windows/window/message.rb +297 -297
- data/lib/windows/window/properties.rb +20 -20
- data/lib/windows/window/timer.rb +19 -19
- data/lib/windows/wsa.rb +102 -102
- data/test/tc_clipboard.rb +41 -41
- data/test/tc_com.rb +32 -32
- data/test/tc_com_automation.rb +15 -15
- data/test/tc_console.rb +108 -108
- data/test/tc_debug.rb +48 -48
- data/test/tc_device_io.rb +29 -29
- data/test/tc_directory.rb +25 -25
- data/test/tc_error.rb +38 -38
- data/test/tc_eventlog.rb +58 -58
- data/test/tc_file.rb +67 -67
- data/test/tc_file_mapping.rb +38 -38
- data/test/tc_filesystem.rb +27 -27
- data/test/tc_gdi_bitmap.rb +25 -25
- data/test/tc_gdi_metafile.rb +23 -23
- data/test/tc_handle.rb +36 -36
- data/test/tc_library.rb +37 -37
- data/test/tc_limits.rb +34 -34
- data/test/tc_mailslot.rb +22 -22
- data/test/tc_memory.rb +44 -44
- data/test/tc_msvcrt_buffer.rb +63 -63
- data/test/tc_msvcrt_directory.rb +96 -96
- data/test/tc_msvcrt_file.rb +80 -80
- data/test/tc_msvcrt_io.rb +48 -48
- data/test/tc_msvcrt_string.rb +94 -94
- data/test/tc_msvcrt_time.rb +19 -19
- data/test/tc_national.rb +38 -38
- data/test/tc_network_management.rb +32 -32
- data/test/tc_network_snmp.rb +31 -31
- data/test/tc_network_winsock.rb +34 -34
- data/test/tc_nio.rb +32 -32
- data/test/tc_ntfs_winternl.rb +48 -48
- data/test/tc_path.rb +90 -90
- data/test/tc_pipe.rb +53 -53
- data/test/tc_process.rb +24 -24
- data/test/tc_registry.rb +29 -29
- data/test/tc_security.rb +104 -104
- data/test/tc_security_authentication.rb +34 -34
- data/test/tc_security_sspi.rb +23 -0
- data/test/tc_service.rb +57 -57
- data/test/tc_shell.rb +34 -34
- data/test/tc_socket.rb +20 -20
- data/test/tc_sound.rb +37 -37
- data/test/tc_synchronize.rb +75 -75
- data/test/tc_system_info.rb +33 -33
- data/test/tc_thread.rb +29 -29
- data/test/tc_time.rb +32 -32
- data/test/tc_tool_helper.rb +29 -29
- data/test/tc_unicode.rb +83 -83
- data/test/tc_volume.rb +47 -47
- data/test/tc_window.rb +45 -45
- data/test/tc_window_classes.rb +33 -33
- data/test/tc_window_dialog.rb +33 -33
- data/test/tc_window_menu.rb +29 -29
- data/test/tc_window_message.rb +33 -33
- data/test/tc_window_properties.rb +29 -29
- data/test/tc_window_timer.rb +29 -29
- data/test/tc_wsa.rb +19 -19
- data/windows-pr.gemspec +33 -34
- metadata +31 -32
data/doc/conversion_guide.txt
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
== Parameters
|
2
|
-
Long: 'L'
|
3
|
-
Integer: 'I'
|
4
|
-
Pointer: 'P'
|
5
|
-
Void: 'V'
|
6
|
-
String: 'S'
|
7
|
-
Callback: 'K' # win32-api only
|
8
|
-
|
9
|
-
== Windows Data Types
|
10
|
-
BOOL => 'I' (or 'B', win32-api only)
|
11
|
-
DWORD => 'L'
|
12
|
-
HANDLE => 'L'
|
13
|
-
LPDWORD => 'P' (or 'L')
|
14
|
-
LPTSTR => 'P'
|
15
|
-
LPCTSTR => 'S'
|
16
|
-
UINT => 'L'
|
17
|
-
VOID => 'V'
|
18
|
-
WORD => 'I'
|
19
|
-
LPVOID => 'L' (or 'P')
|
20
|
-
CALLBACK => 'K'
|
21
|
-
|
22
|
-
== C Data Types
|
23
|
-
void => 'V'
|
24
|
-
void* => 'P'
|
25
|
-
char* => 'P'
|
26
|
-
const char* => 'L'
|
27
|
-
int => 'I'
|
28
|
-
long => 'L'
|
29
|
-
struct => 'P'
|
30
|
-
struct* => 'P'
|
31
|
-
|
32
|
-
== Notes
|
33
|
-
In practice most LPVOID types should be designated as 'L' because this
|
34
|
-
usually means the function is looking for an address. Check the documentation
|
35
|
-
for details.
|
36
|
-
|
37
|
-
If using the windows-api library, you can use 'B' instead of 'I' for the return
|
1
|
+
== Parameters
|
2
|
+
Long: 'L'
|
3
|
+
Integer: 'I'
|
4
|
+
Pointer: 'P'
|
5
|
+
Void: 'V'
|
6
|
+
String: 'S'
|
7
|
+
Callback: 'K' # win32-api only
|
8
|
+
|
9
|
+
== Windows Data Types
|
10
|
+
BOOL => 'I' (or 'B', win32-api only)
|
11
|
+
DWORD => 'L'
|
12
|
+
HANDLE => 'L'
|
13
|
+
LPDWORD => 'P' (or 'L')
|
14
|
+
LPTSTR => 'P'
|
15
|
+
LPCTSTR => 'S'
|
16
|
+
UINT => 'L'
|
17
|
+
VOID => 'V'
|
18
|
+
WORD => 'I'
|
19
|
+
LPVOID => 'L' (or 'P')
|
20
|
+
CALLBACK => 'K'
|
21
|
+
|
22
|
+
== C Data Types
|
23
|
+
void => 'V'
|
24
|
+
void* => 'P'
|
25
|
+
char* => 'P'
|
26
|
+
const char* => 'L'
|
27
|
+
int => 'I'
|
28
|
+
long => 'L'
|
29
|
+
struct => 'P'
|
30
|
+
struct* => 'P'
|
31
|
+
|
32
|
+
== Notes
|
33
|
+
In practice most LPVOID types should be designated as 'L' because this
|
34
|
+
usually means the function is looking for an address. Check the documentation
|
35
|
+
for details.
|
36
|
+
|
37
|
+
If using the windows-api library, you can use 'B' instead of 'I' for the return
|
38
38
|
type for functions that return a BOOL.
|
data/lib/windows/clipboard.rb
CHANGED
@@ -1,61 +1,61 @@
|
|
1
|
-
require 'windows/api'
|
2
|
-
|
3
|
-
module Windows
|
4
|
-
module Clipboard
|
5
|
-
API.auto_namespace = 'Windows::Clipboard'
|
6
|
-
API.auto_constant = true
|
7
|
-
API.auto_method = true
|
8
|
-
API.auto_unicode = true
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
CF_TEXT = 1
|
13
|
-
CF_BITMAP = 2
|
14
|
-
CF_METAFILEPICT = 3
|
15
|
-
CF_SYLK = 4
|
16
|
-
CF_DIF = 5
|
17
|
-
CF_TIFF = 6
|
18
|
-
CF_OEMTEXT = 7
|
19
|
-
CF_DIB = 8
|
20
|
-
CF_PALETTE = 9
|
21
|
-
CF_PENDATA = 10
|
22
|
-
CF_RIFF = 11
|
23
|
-
CF_WAVE = 12
|
24
|
-
CF_UNICODETEXT = 13
|
25
|
-
CF_ENHMETAFILE = 14
|
26
|
-
CF_HDROP = 15
|
27
|
-
CF_LOCALE = 16
|
28
|
-
CF_MAX = 18 # Assume Windows 2000 or later
|
29
|
-
CF_OWNERDISPLAY = 0x0080
|
30
|
-
CF_DSPTEXT = 0x0081
|
31
|
-
CF_DSPBITMAP = 0x0082
|
32
|
-
CF_DSPMETAFILEPICT = 0x0083
|
33
|
-
CF_DSPENHMETAFILE = 0x008E
|
34
|
-
|
35
|
-
API.new('ChangeClipboardChain', 'LL', 'B', 'user32')
|
36
|
-
API.new('CloseClipboard', 'V', 'B', 'user32')
|
37
|
-
API.new('CountClipboardFormats', 'V', 'I', 'user32')
|
38
|
-
API.new('EmptyClipboard', 'V', 'B', 'user32')
|
39
|
-
API.new('EnumClipboardFormats', 'I', 'I', 'user32')
|
40
|
-
API.new('GetClipboardData', 'I', 'L', 'user32')
|
41
|
-
API.new('GetClipboardFormatName', 'IPI', 'I', 'user32')
|
42
|
-
API.new('GetClipboardOwner', 'V', 'L', 'user32')
|
43
|
-
API.new('GetClipboardSequenceNumber', 'V', 'L', 'user32')
|
44
|
-
API.new('GetClipboardViewer', 'V', 'L', 'user32')
|
45
|
-
API.new('GetOpenClipboardWindow', 'V', 'L', 'user32')
|
46
|
-
API.new('GetPriorityClipboardFormat', 'PI', 'I', 'user32')
|
47
|
-
API.new('IsClipboardFormatAvailable', 'I', 'B', 'user32')
|
48
|
-
API.new('OpenClipboard', 'L', 'B', 'user32')
|
49
|
-
API.new('RegisterClipboardFormat', 'S', 'I', 'user32')
|
50
|
-
API.new('SetClipboardData', 'IL', 'L', 'user32')
|
51
|
-
API.new('SetClipboardViewer', 'L', 'L', 'user32')
|
52
|
-
|
53
|
-
begin
|
54
|
-
API.new('AddClipboardFormatListener', 'L', 'B', 'user32')
|
55
|
-
API.new('GetUpdatedClipboardFormats', 'PIP', 'I', 'user32')
|
56
|
-
API.new('RemoveClipboardFormatListener', 'L', 'B', 'user32')
|
57
|
-
rescue Win32::API::LoadLibraryError
|
58
|
-
# Windows Vista or later
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
1
|
+
require 'windows/api'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module Clipboard
|
5
|
+
API.auto_namespace = 'Windows::Clipboard'
|
6
|
+
API.auto_constant = true
|
7
|
+
API.auto_method = true
|
8
|
+
API.auto_unicode = true
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
CF_TEXT = 1
|
13
|
+
CF_BITMAP = 2
|
14
|
+
CF_METAFILEPICT = 3
|
15
|
+
CF_SYLK = 4
|
16
|
+
CF_DIF = 5
|
17
|
+
CF_TIFF = 6
|
18
|
+
CF_OEMTEXT = 7
|
19
|
+
CF_DIB = 8
|
20
|
+
CF_PALETTE = 9
|
21
|
+
CF_PENDATA = 10
|
22
|
+
CF_RIFF = 11
|
23
|
+
CF_WAVE = 12
|
24
|
+
CF_UNICODETEXT = 13
|
25
|
+
CF_ENHMETAFILE = 14
|
26
|
+
CF_HDROP = 15
|
27
|
+
CF_LOCALE = 16
|
28
|
+
CF_MAX = 18 # Assume Windows 2000 or later
|
29
|
+
CF_OWNERDISPLAY = 0x0080
|
30
|
+
CF_DSPTEXT = 0x0081
|
31
|
+
CF_DSPBITMAP = 0x0082
|
32
|
+
CF_DSPMETAFILEPICT = 0x0083
|
33
|
+
CF_DSPENHMETAFILE = 0x008E
|
34
|
+
|
35
|
+
API.new('ChangeClipboardChain', 'LL', 'B', 'user32')
|
36
|
+
API.new('CloseClipboard', 'V', 'B', 'user32')
|
37
|
+
API.new('CountClipboardFormats', 'V', 'I', 'user32')
|
38
|
+
API.new('EmptyClipboard', 'V', 'B', 'user32')
|
39
|
+
API.new('EnumClipboardFormats', 'I', 'I', 'user32')
|
40
|
+
API.new('GetClipboardData', 'I', 'L', 'user32')
|
41
|
+
API.new('GetClipboardFormatName', 'IPI', 'I', 'user32')
|
42
|
+
API.new('GetClipboardOwner', 'V', 'L', 'user32')
|
43
|
+
API.new('GetClipboardSequenceNumber', 'V', 'L', 'user32')
|
44
|
+
API.new('GetClipboardViewer', 'V', 'L', 'user32')
|
45
|
+
API.new('GetOpenClipboardWindow', 'V', 'L', 'user32')
|
46
|
+
API.new('GetPriorityClipboardFormat', 'PI', 'I', 'user32')
|
47
|
+
API.new('IsClipboardFormatAvailable', 'I', 'B', 'user32')
|
48
|
+
API.new('OpenClipboard', 'L', 'B', 'user32')
|
49
|
+
API.new('RegisterClipboardFormat', 'S', 'I', 'user32')
|
50
|
+
API.new('SetClipboardData', 'IL', 'L', 'user32')
|
51
|
+
API.new('SetClipboardViewer', 'L', 'L', 'user32')
|
52
|
+
|
53
|
+
begin
|
54
|
+
API.new('AddClipboardFormatListener', 'L', 'B', 'user32')
|
55
|
+
API.new('GetUpdatedClipboardFormats', 'PIP', 'I', 'user32')
|
56
|
+
API.new('RemoveClipboardFormatListener', 'L', 'B', 'user32')
|
57
|
+
rescue Win32::API::LoadLibraryError
|
58
|
+
# Windows Vista or later
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/lib/windows/com.rb
CHANGED
@@ -1,192 +1,192 @@
|
|
1
|
-
require 'windows/api'
|
2
|
-
|
3
|
-
module Windows
|
4
|
-
module COM
|
5
|
-
API.auto_namespace = 'Windows::COM'
|
6
|
-
API.auto_constant = true
|
7
|
-
API.auto_method = true
|
8
|
-
API.auto_unicode = false
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
# These constants are from wtypes.h but are only used in a COM context
|
13
|
-
# as far as I know.
|
14
|
-
|
15
|
-
VT_EMPTY = 0
|
16
|
-
VT_NULL = 1
|
17
|
-
VT_I2 = 2
|
18
|
-
VT_I4 = 3
|
19
|
-
VT_R4 = 4
|
20
|
-
VT_R8 = 5
|
21
|
-
VT_CY = 6
|
22
|
-
VT_DATE = 7
|
23
|
-
VT_BSTR = 8
|
24
|
-
VT_DISPATCH = 9
|
25
|
-
VT_ERROR = 10
|
26
|
-
VT_BOOL = 11
|
27
|
-
VT_VARIANT = 12
|
28
|
-
VT_UNKNOWN = 13
|
29
|
-
VT_DECIMAL = 14
|
30
|
-
VT_I1 = 16
|
31
|
-
VT_UI1 = 17
|
32
|
-
VT_UI2 = 18
|
33
|
-
VT_UI4 = 19
|
34
|
-
VT_I8 = 20
|
35
|
-
VT_UI8 = 21
|
36
|
-
VT_INT = 22
|
37
|
-
VT_UINT = 23
|
38
|
-
VT_VOID = 24
|
39
|
-
VT_HRESULT = 25
|
40
|
-
VT_PTR = 26
|
41
|
-
|
42
|
-
VT_SAFEARRAY = 27
|
43
|
-
VT_CARRAY = 28
|
44
|
-
VT_USERDEFINED = 29
|
45
|
-
VT_LPSTR = 30
|
46
|
-
VT_LPWSTR = 31
|
47
|
-
VT_RECORD = 36
|
48
|
-
VT_INT_PTR = 37
|
49
|
-
VT_UINT_PTR = 38
|
50
|
-
VT_FILETIME = 64
|
51
|
-
VT_BLOB = 65
|
52
|
-
VT_STREAM = 66
|
53
|
-
VT_STORAGE = 67
|
54
|
-
VT_STREAMED_OBJECT = 68
|
55
|
-
VT_STORED_OBJECT = 69
|
56
|
-
VT_BLOB_OBJECT = 70
|
57
|
-
VT_CF = 71
|
58
|
-
VT_CLSID = 72
|
59
|
-
VT_VERSIONED_STREAM = 73
|
60
|
-
VT_BSTR_BLOB = 0xfff
|
61
|
-
VT_VECTOR = 0x1000
|
62
|
-
VT_ARRAY = 0x2000
|
63
|
-
VT_BYREF = 0x4000
|
64
|
-
VT_RESERVED = 0x8000
|
65
|
-
VT_ILLEGAL = 0xffff
|
66
|
-
VT_ILLEGALMASKED = 0xfff
|
67
|
-
VT_TYPEMASK = 0xfff
|
68
|
-
|
69
|
-
# These constants are from OAldl.h
|
70
|
-
|
71
|
-
INVOKE_FUNC = 1
|
72
|
-
INVOKE_PROPERTYGET = 2
|
73
|
-
INVOKE_PROPERTYPUT = 4
|
74
|
-
INVOKE_PROPERTYPUTREF = 8
|
75
|
-
|
76
|
-
# CLSCTX enum constants
|
77
|
-
|
78
|
-
CLSCTX_INPROC_SERVER = 0x1
|
79
|
-
CLSCTX_INPROC_HANDLER = 0x2
|
80
|
-
CLSCTX_LOCAL_SERVER = 0x4
|
81
|
-
CLSCTX_INPROC_SERVER16 = 0x8
|
82
|
-
CLSCTX_REMOTE_SERVER = 0x10
|
83
|
-
CLSCTX_INPROC_HANDLER16 = 0x20
|
84
|
-
CLSCTX_RESERVED1 = 0x40
|
85
|
-
CLSCTX_RESERVED2 = 0x80
|
86
|
-
CLSCTX_RESERVED3 = 0x100
|
87
|
-
CLSCTX_RESERVED4 = 0x200
|
88
|
-
CLSCTX_NO_CODE_DOWNLOAD = 0x400
|
89
|
-
CLSCTX_RESERVED5 = 0x800
|
90
|
-
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000
|
91
|
-
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000
|
92
|
-
CLSCTX_NO_FAILURE_LOG = 0x4000
|
93
|
-
CLSCTX_DISABLE_AAA = 0x8000
|
94
|
-
CLSCTX_ENABLE_AAA = 0x10000
|
95
|
-
CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
|
96
|
-
CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
|
97
|
-
CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
|
98
|
-
|
99
|
-
# IDispatch
|
100
|
-
|
101
|
-
DISPID_UNKNOWN = -1
|
102
|
-
DISPID_VALUE = 0
|
103
|
-
DISPID_PROPERTYPUT = -3
|
104
|
-
DISPID_NEWENUM = -4
|
105
|
-
DISPID_EVALUATE = -5
|
106
|
-
DISPID_CONSTRUCTOR = -6
|
107
|
-
DISPID_DESTRUCTOR = -7
|
108
|
-
DISPID_COLLECT = -8
|
109
|
-
|
110
|
-
# Flags for IDispatch::Invoke
|
111
|
-
|
112
|
-
DISPATCH_METHOD = 0x1
|
113
|
-
DISPATCH_PROPERTYGET = 0x2
|
114
|
-
DISPATCH_PROPERTYPUT = 0x4
|
115
|
-
DISPATCH_PROPERTYPUTREF = 0x8
|
116
|
-
|
117
|
-
API.new('BindMoniker', 'PLPP', 'L', 'ole32')
|
118
|
-
API.new('CLSIDFromProgID', 'PP', 'L', 'ole32')
|
119
|
-
API.new('CLSIDFromProgIDEx', 'PP', 'L', 'ole32')
|
120
|
-
API.new('CLSIDFromString', 'PP', 'L', 'ole32')
|
121
|
-
API.new('CoAddRefServerProcess', 'V', 'L', 'ole32')
|
122
|
-
API.new('CoAllowSetForegroundWindow', 'PP', 'L', 'ole32')
|
123
|
-
API.new('CoCancelCall', 'LL', 'L', 'ole32')
|
124
|
-
API.new('CoCopyProxy', 'PP', 'L', 'ole32')
|
125
|
-
API.new('CoCreateFreeThreadedMarshaler', 'PP', 'L', 'ole32')
|
126
|
-
API.new('CoCreateGuid', 'P', 'L', 'ole32')
|
127
|
-
API.new('CoCreateInstance', 'PPLPP', 'L', 'ole32')
|
128
|
-
API.new('CoCreateInstanceEx', 'PPLPLP', 'L', 'ole32')
|
129
|
-
API.new('CoDisableCallCancellation', 'L', 'L', 'ole32')
|
130
|
-
API.new('CoDisconnectObject', 'PL', 'L', 'ole32')
|
131
|
-
#API.new('CoDosDateTimeToFileTime', 'LLP', 'L')
|
132
|
-
API.new('CoEnableCallCancellation', 'L', 'L', 'ole32')
|
133
|
-
API.new('CoFileTimeNow', 'P', 'L', 'ole32')
|
134
|
-
API.new('CoFileTimeToDosDateTime', 'LLL', 'B', 'ole32')
|
135
|
-
API.new('CoFreeAllLibraries', 'V', 'V', 'ole32')
|
136
|
-
API.new('CoFreeLibrary', 'L', 'V', 'ole32')
|
137
|
-
API.new('CoFreeUnusedLibraries', 'V', 'V', 'ole32')
|
138
|
-
API.new('CoFreeUnusedLibrariesEx', 'V', 'V', 'ole32')
|
139
|
-
API.new('CoGetCallContext', 'PP', 'L', 'ole32')
|
140
|
-
API.new('CoGetCallerTID', 'P', 'L', 'ole32')
|
141
|
-
API.new('CoGetCancelObject', 'LPP', 'L', 'ole32')
|
142
|
-
API.new('CoGetClassObject', 'PLPPP', 'L', 'ole32')
|
143
|
-
API.new('CoGetContextToken', 'P', 'L', 'ole32')
|
144
|
-
API.new('CoGetCurrentLogicalThreadId', 'P', 'L', 'ole32')
|
145
|
-
API.new('CoGetCurrentProcess', 'V', 'L', 'ole32')
|
146
|
-
API.new('CoGetInstanceFromFile', 'PPPLLPLP', 'L', 'ole32')
|
147
|
-
API.new('CoGetInstanceFromIStorage', 'PPPLPLP', 'L', 'ole32')
|
148
|
-
API.new('CoInitialize', 'P', 'L', 'ole32')
|
149
|
-
API.new('CoTaskMemFree', 'P', 'V', 'ole32')
|
150
|
-
API.new('CoUninitialize', 'V', 'V', 'ole32')
|
151
|
-
API.new('CoUnmarshalHresult', 'PP', 'L', 'ole32')
|
152
|
-
API.new('CoUnmarshalInterface', 'PPP', 'L', 'ole32')
|
153
|
-
API.new('CoWaitForMultipleHandles', 'LLLPP', 'L', 'ole32')
|
154
|
-
API.new('CreateAntiMoniker', 'P', 'L', 'ole32')
|
155
|
-
API.new('CreateAsyncBindCtx', 'LKKP', 'L', 'urlmon')
|
156
|
-
API.new('CreateBindCtx', 'LP', 'L', 'ole32')
|
157
|
-
API.new('CreateClassMoniker', 'PP', 'L', 'ole32')
|
158
|
-
API.new('CreateFileMoniker', 'PP', 'L', 'ole32')
|
159
|
-
API.new('CreateGenericComposite', 'PPP', 'L', 'ole32')
|
160
|
-
API.new('CreateItemMoniker', 'PPP', 'L', 'ole32')
|
161
|
-
API.new('CreateObjrefMoniker', 'PP', 'L', 'ole32')
|
162
|
-
API.new('CreatePointerMoniker', 'PP', 'L', 'ole32')
|
163
|
-
API.new('GetClassFile', 'PP', 'L', 'ole32')
|
164
|
-
API.new('GetRunningObjectTable', 'LP', 'L', 'ole32')
|
165
|
-
API.new('IIDFromString', 'PP', 'L', 'ole32')
|
166
|
-
API.new('IsAccelerator', 'LIPP', 'B', 'ole32')
|
167
|
-
API.new('IsEqualGUID', 'PP', 'B', 'ole32')
|
168
|
-
API.new('MkParseDisplayName', 'PPPP', 'L', 'ole32')
|
169
|
-
API.new('MonikerCommonPrefixWith', 'PPP', 'L', 'ole32')
|
170
|
-
API.new('MonikerRelativePathTo', 'PPPI', 'L', 'ole32')
|
171
|
-
API.new('OleDoAutoConvert', 'PP', 'L', 'ole32')
|
172
|
-
API.new('OleGetAutoConvert', 'PP', 'L', 'ole32')
|
173
|
-
API.new('OleGetIconOfClass', 'PPI', 'L', 'ole32')
|
174
|
-
API.new('OleGetIconOfFile', 'PI', 'L', 'ole32')
|
175
|
-
API.new('OleIconToCursor', 'PL', 'L', '
|
176
|
-
API.new('OleInitialize', 'V', 'L', 'ole32')
|
177
|
-
API.new('OleRegGetMiscStatus', 'PLP', 'L', 'ole32')
|
178
|
-
API.new('OleRegGetUserType', 'PLP', 'L', 'ole32')
|
179
|
-
API.new('OleSetAutoConvert', 'PP', 'L', 'ole32')
|
180
|
-
API.new('OleUninitialize', 'V', 'V', 'ole32')
|
181
|
-
API.new('ProgIDFromCLSID', 'PP', 'L', 'ole32')
|
182
|
-
API.new('StringFromCLSID', 'PP', 'L', 'ole32')
|
183
|
-
API.new('StringFromGUID2', 'PPI', 'I', 'ole32')
|
184
|
-
API.new('StringFromIID', 'PP', 'L', 'ole32')
|
185
|
-
|
186
|
-
begin
|
187
|
-
API.new('CoDisconnectContext', 'L', 'L', 'ole32')
|
188
|
-
rescue Win32::API::LoadLibraryError
|
189
|
-
# Windows Vista
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|
1
|
+
require 'windows/api'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module COM
|
5
|
+
API.auto_namespace = 'Windows::COM'
|
6
|
+
API.auto_constant = true
|
7
|
+
API.auto_method = true
|
8
|
+
API.auto_unicode = false
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# These constants are from wtypes.h but are only used in a COM context
|
13
|
+
# as far as I know.
|
14
|
+
|
15
|
+
VT_EMPTY = 0
|
16
|
+
VT_NULL = 1
|
17
|
+
VT_I2 = 2
|
18
|
+
VT_I4 = 3
|
19
|
+
VT_R4 = 4
|
20
|
+
VT_R8 = 5
|
21
|
+
VT_CY = 6
|
22
|
+
VT_DATE = 7
|
23
|
+
VT_BSTR = 8
|
24
|
+
VT_DISPATCH = 9
|
25
|
+
VT_ERROR = 10
|
26
|
+
VT_BOOL = 11
|
27
|
+
VT_VARIANT = 12
|
28
|
+
VT_UNKNOWN = 13
|
29
|
+
VT_DECIMAL = 14
|
30
|
+
VT_I1 = 16
|
31
|
+
VT_UI1 = 17
|
32
|
+
VT_UI2 = 18
|
33
|
+
VT_UI4 = 19
|
34
|
+
VT_I8 = 20
|
35
|
+
VT_UI8 = 21
|
36
|
+
VT_INT = 22
|
37
|
+
VT_UINT = 23
|
38
|
+
VT_VOID = 24
|
39
|
+
VT_HRESULT = 25
|
40
|
+
VT_PTR = 26
|
41
|
+
|
42
|
+
VT_SAFEARRAY = 27
|
43
|
+
VT_CARRAY = 28
|
44
|
+
VT_USERDEFINED = 29
|
45
|
+
VT_LPSTR = 30
|
46
|
+
VT_LPWSTR = 31
|
47
|
+
VT_RECORD = 36
|
48
|
+
VT_INT_PTR = 37
|
49
|
+
VT_UINT_PTR = 38
|
50
|
+
VT_FILETIME = 64
|
51
|
+
VT_BLOB = 65
|
52
|
+
VT_STREAM = 66
|
53
|
+
VT_STORAGE = 67
|
54
|
+
VT_STREAMED_OBJECT = 68
|
55
|
+
VT_STORED_OBJECT = 69
|
56
|
+
VT_BLOB_OBJECT = 70
|
57
|
+
VT_CF = 71
|
58
|
+
VT_CLSID = 72
|
59
|
+
VT_VERSIONED_STREAM = 73
|
60
|
+
VT_BSTR_BLOB = 0xfff
|
61
|
+
VT_VECTOR = 0x1000
|
62
|
+
VT_ARRAY = 0x2000
|
63
|
+
VT_BYREF = 0x4000
|
64
|
+
VT_RESERVED = 0x8000
|
65
|
+
VT_ILLEGAL = 0xffff
|
66
|
+
VT_ILLEGALMASKED = 0xfff
|
67
|
+
VT_TYPEMASK = 0xfff
|
68
|
+
|
69
|
+
# These constants are from OAldl.h
|
70
|
+
|
71
|
+
INVOKE_FUNC = 1
|
72
|
+
INVOKE_PROPERTYGET = 2
|
73
|
+
INVOKE_PROPERTYPUT = 4
|
74
|
+
INVOKE_PROPERTYPUTREF = 8
|
75
|
+
|
76
|
+
# CLSCTX enum constants
|
77
|
+
|
78
|
+
CLSCTX_INPROC_SERVER = 0x1
|
79
|
+
CLSCTX_INPROC_HANDLER = 0x2
|
80
|
+
CLSCTX_LOCAL_SERVER = 0x4
|
81
|
+
CLSCTX_INPROC_SERVER16 = 0x8
|
82
|
+
CLSCTX_REMOTE_SERVER = 0x10
|
83
|
+
CLSCTX_INPROC_HANDLER16 = 0x20
|
84
|
+
CLSCTX_RESERVED1 = 0x40
|
85
|
+
CLSCTX_RESERVED2 = 0x80
|
86
|
+
CLSCTX_RESERVED3 = 0x100
|
87
|
+
CLSCTX_RESERVED4 = 0x200
|
88
|
+
CLSCTX_NO_CODE_DOWNLOAD = 0x400
|
89
|
+
CLSCTX_RESERVED5 = 0x800
|
90
|
+
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000
|
91
|
+
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000
|
92
|
+
CLSCTX_NO_FAILURE_LOG = 0x4000
|
93
|
+
CLSCTX_DISABLE_AAA = 0x8000
|
94
|
+
CLSCTX_ENABLE_AAA = 0x10000
|
95
|
+
CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
|
96
|
+
CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
|
97
|
+
CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
|
98
|
+
|
99
|
+
# IDispatch
|
100
|
+
|
101
|
+
DISPID_UNKNOWN = -1
|
102
|
+
DISPID_VALUE = 0
|
103
|
+
DISPID_PROPERTYPUT = -3
|
104
|
+
DISPID_NEWENUM = -4
|
105
|
+
DISPID_EVALUATE = -5
|
106
|
+
DISPID_CONSTRUCTOR = -6
|
107
|
+
DISPID_DESTRUCTOR = -7
|
108
|
+
DISPID_COLLECT = -8
|
109
|
+
|
110
|
+
# Flags for IDispatch::Invoke
|
111
|
+
|
112
|
+
DISPATCH_METHOD = 0x1
|
113
|
+
DISPATCH_PROPERTYGET = 0x2
|
114
|
+
DISPATCH_PROPERTYPUT = 0x4
|
115
|
+
DISPATCH_PROPERTYPUTREF = 0x8
|
116
|
+
|
117
|
+
API.new('BindMoniker', 'PLPP', 'L', 'ole32')
|
118
|
+
API.new('CLSIDFromProgID', 'PP', 'L', 'ole32')
|
119
|
+
API.new('CLSIDFromProgIDEx', 'PP', 'L', 'ole32')
|
120
|
+
API.new('CLSIDFromString', 'PP', 'L', 'ole32')
|
121
|
+
API.new('CoAddRefServerProcess', 'V', 'L', 'ole32')
|
122
|
+
API.new('CoAllowSetForegroundWindow', 'PP', 'L', 'ole32')
|
123
|
+
API.new('CoCancelCall', 'LL', 'L', 'ole32')
|
124
|
+
API.new('CoCopyProxy', 'PP', 'L', 'ole32')
|
125
|
+
API.new('CoCreateFreeThreadedMarshaler', 'PP', 'L', 'ole32')
|
126
|
+
API.new('CoCreateGuid', 'P', 'L', 'ole32')
|
127
|
+
API.new('CoCreateInstance', 'PPLPP', 'L', 'ole32')
|
128
|
+
API.new('CoCreateInstanceEx', 'PPLPLP', 'L', 'ole32')
|
129
|
+
API.new('CoDisableCallCancellation', 'L', 'L', 'ole32')
|
130
|
+
API.new('CoDisconnectObject', 'PL', 'L', 'ole32')
|
131
|
+
#API.new('CoDosDateTimeToFileTime', 'LLP', 'L')
|
132
|
+
API.new('CoEnableCallCancellation', 'L', 'L', 'ole32')
|
133
|
+
API.new('CoFileTimeNow', 'P', 'L', 'ole32')
|
134
|
+
API.new('CoFileTimeToDosDateTime', 'LLL', 'B', 'ole32')
|
135
|
+
API.new('CoFreeAllLibraries', 'V', 'V', 'ole32')
|
136
|
+
API.new('CoFreeLibrary', 'L', 'V', 'ole32')
|
137
|
+
API.new('CoFreeUnusedLibraries', 'V', 'V', 'ole32')
|
138
|
+
API.new('CoFreeUnusedLibrariesEx', 'V', 'V', 'ole32')
|
139
|
+
API.new('CoGetCallContext', 'PP', 'L', 'ole32')
|
140
|
+
API.new('CoGetCallerTID', 'P', 'L', 'ole32')
|
141
|
+
API.new('CoGetCancelObject', 'LPP', 'L', 'ole32')
|
142
|
+
API.new('CoGetClassObject', 'PLPPP', 'L', 'ole32')
|
143
|
+
API.new('CoGetContextToken', 'P', 'L', 'ole32')
|
144
|
+
API.new('CoGetCurrentLogicalThreadId', 'P', 'L', 'ole32')
|
145
|
+
API.new('CoGetCurrentProcess', 'V', 'L', 'ole32')
|
146
|
+
API.new('CoGetInstanceFromFile', 'PPPLLPLP', 'L', 'ole32')
|
147
|
+
API.new('CoGetInstanceFromIStorage', 'PPPLPLP', 'L', 'ole32')
|
148
|
+
API.new('CoInitialize', 'P', 'L', 'ole32')
|
149
|
+
API.new('CoTaskMemFree', 'P', 'V', 'ole32')
|
150
|
+
API.new('CoUninitialize', 'V', 'V', 'ole32')
|
151
|
+
API.new('CoUnmarshalHresult', 'PP', 'L', 'ole32')
|
152
|
+
API.new('CoUnmarshalInterface', 'PPP', 'L', 'ole32')
|
153
|
+
API.new('CoWaitForMultipleHandles', 'LLLPP', 'L', 'ole32')
|
154
|
+
API.new('CreateAntiMoniker', 'P', 'L', 'ole32')
|
155
|
+
API.new('CreateAsyncBindCtx', 'LKKP', 'L', 'urlmon')
|
156
|
+
API.new('CreateBindCtx', 'LP', 'L', 'ole32')
|
157
|
+
API.new('CreateClassMoniker', 'PP', 'L', 'ole32')
|
158
|
+
API.new('CreateFileMoniker', 'PP', 'L', 'ole32')
|
159
|
+
API.new('CreateGenericComposite', 'PPP', 'L', 'ole32')
|
160
|
+
API.new('CreateItemMoniker', 'PPP', 'L', 'ole32')
|
161
|
+
API.new('CreateObjrefMoniker', 'PP', 'L', 'ole32')
|
162
|
+
API.new('CreatePointerMoniker', 'PP', 'L', 'ole32')
|
163
|
+
API.new('GetClassFile', 'PP', 'L', 'ole32')
|
164
|
+
API.new('GetRunningObjectTable', 'LP', 'L', 'ole32')
|
165
|
+
API.new('IIDFromString', 'PP', 'L', 'ole32')
|
166
|
+
API.new('IsAccelerator', 'LIPP', 'B', 'ole32')
|
167
|
+
API.new('IsEqualGUID', 'PP', 'B', 'ole32')
|
168
|
+
API.new('MkParseDisplayName', 'PPPP', 'L', 'ole32')
|
169
|
+
API.new('MonikerCommonPrefixWith', 'PPP', 'L', 'ole32')
|
170
|
+
API.new('MonikerRelativePathTo', 'PPPI', 'L', 'ole32')
|
171
|
+
API.new('OleDoAutoConvert', 'PP', 'L', 'ole32')
|
172
|
+
API.new('OleGetAutoConvert', 'PP', 'L', 'ole32')
|
173
|
+
API.new('OleGetIconOfClass', 'PPI', 'L', 'ole32')
|
174
|
+
API.new('OleGetIconOfFile', 'PI', 'L', 'ole32')
|
175
|
+
API.new('OleIconToCursor', 'PL', 'L', 'oleaut32')
|
176
|
+
API.new('OleInitialize', 'V', 'L', 'ole32')
|
177
|
+
API.new('OleRegGetMiscStatus', 'PLP', 'L', 'ole32')
|
178
|
+
API.new('OleRegGetUserType', 'PLP', 'L', 'ole32')
|
179
|
+
API.new('OleSetAutoConvert', 'PP', 'L', 'ole32')
|
180
|
+
API.new('OleUninitialize', 'V', 'V', 'ole32')
|
181
|
+
API.new('ProgIDFromCLSID', 'PP', 'L', 'ole32')
|
182
|
+
API.new('StringFromCLSID', 'PP', 'L', 'ole32')
|
183
|
+
API.new('StringFromGUID2', 'PPI', 'I', 'ole32')
|
184
|
+
API.new('StringFromIID', 'PP', 'L', 'ole32')
|
185
|
+
|
186
|
+
begin
|
187
|
+
API.new('CoDisconnectContext', 'L', 'L', 'ole32')
|
188
|
+
rescue Win32::API::LoadLibraryError
|
189
|
+
# Windows Vista
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|