windows-pr 0.6.6 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ require 'windows/api'
2
+ include Windows
3
+
4
+ module Windows
5
+ module NIO
6
+ API.auto_namespace = 'Windows::NIO'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = false
10
+
11
+ API.new('CancelIo', 'L', 'B')
12
+ API.new('CreateIoCompletionPort', 'LLPL', 'L')
13
+ API.new('FlushFileBuffers', 'L', 'B')
14
+ API.new('GetQueuedCompletionStatus', 'LPPPL', 'B')
15
+ API.new('PostQueuedCompletionStatus', 'LLPP', 'B')
16
+ API.new('ReadFile', 'LPLPP', 'B')
17
+ API.new('ReadFileEx', 'LPLPP', 'B')
18
+ API.new('ReadFileScatter', 'LPLPP', 'B')
19
+ API.new('SetEndOfFile', 'L', 'B')
20
+ API.new('SetFilePointer', 'LLPL', 'L')
21
+ API.new('SetFilePointerEx', 'LLPL', 'L')
22
+ API.new('WriteFile', 'LPLPP', 'B')
23
+ API.new('WriteFileEx', 'LPLPP', 'B')
24
+ API.new('WriteFileGather', 'LPLPP', 'B')
25
+ end
26
+ end
data/lib/windows/path.rb CHANGED
@@ -1,355 +1,74 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module Path
5
- # These constants are for use by the PathGetCharType() function.
6
- GCT_INVALID = 0x0000 # The character is not valid in a path.
7
- GCT_LFNCHAR = 0x0001 # The character is valid in a long file name.
8
- GCT_SHORTCHAR = 0x0002 # The character is valid in a short (8.3) file name.
9
- GCT_WILD = 0x0004 # The character is a wildcard character.
10
- GCT_SEPARATOR = 0x0008 # The character is a path separator.
11
-
12
- PathAddBackslash = Win32API.new('shlwapi', 'PathAddBackslash', 'P', 'P')
13
- PathAddBackslashA = Win32API.new('shlwapi', 'PathAddBackslashA', 'P', 'P')
14
- PathAddBackslashW = Win32API.new('shlwapi', 'PathAddBackslashW', 'P', 'P')
15
-
16
- PathAddExtension = Win32API.new('shlwapi', 'PathAddExtension', 'PP', 'I')
17
- PathAddExtensionA = Win32API.new('shlwapi', 'PathAddExtensionA', 'PP', 'I')
18
- PathAddExtensionW = Win32API.new('shlwapi', 'PathAddExtensionW', 'PP', 'I')
19
-
20
- PathAppend = Win32API.new('shlwapi', 'PathAppend', 'PP', 'I')
21
- PathAppendA = Win32API.new('shlwapi', 'PathAppendA', 'PP', 'I')
22
- PathAppendW = Win32API.new('shlwapi', 'PathAppendW', 'PP', 'I')
23
-
24
- PathBuildRoot = Win32API.new('shlwapi', 'PathBuildRoot', 'PI', 'P')
25
- PathBuildRootA = Win32API.new('shlwapi', 'PathBuildRootA', 'PI', 'P')
26
- PathBuildRootW = Win32API.new('shlwapi', 'PathBuildRootW', 'PI', 'P')
27
-
28
- PathCanonicalize = Win32API.new('shlwapi', 'PathCanonicalize', 'PP', 'I')
29
- PathCanonicalizeA = Win32API.new('shlwapi', 'PathCanonicalizeA', 'PP', 'I')
30
- PathCanonicalizeW = Win32API.new('shlwapi', 'PathCanonicalizeW', 'PP', 'I')
31
-
32
- PathCombine = Win32API.new('shlwapi', 'PathCombine', 'PPP', 'P')
33
- PathCombineA = Win32API.new('shlwapi', 'PathCombineA', 'PPP', 'P')
34
- PathCombineW = Win32API.new('shlwapi', 'PathCombineW', 'PPP', 'P')
35
-
36
- PathCommonPrefix = Win32API.new('shlwapi', 'PathCommonPrefix', 'PPP', 'I')
37
- PathCommonPrefixA = Win32API.new('shlwapi', 'PathCommonPrefixA', 'PPP', 'I')
38
- PathCommonPrefixW = Win32API.new('shlwapi', 'PathCommonPrefixW', 'PPP', 'I')
39
-
40
- PathCompactPath = Win32API.new('shlwapi', 'PathCompactPath', 'PPI', 'I')
41
- PathCompactPathA = Win32API.new('shlwapi', 'PathCompactPathA', 'PPI', 'I')
42
- PathCompactPathW = Win32API.new('shlwapi', 'PathCompactPathW', 'PPI', 'I')
43
-
44
- PathCompactPathEx = Win32API.new('shlwapi', 'PathCompactPathEx', 'PPIL', 'I')
45
- PathCompactPathExA = Win32API.new('shlwapi', 'PathCompactPathExA', 'PPIL', 'I')
46
- PathCompactPathExW = Win32API.new('shlwapi', 'PathCompactPathExW', 'PPIL', 'I')
47
-
48
- PathCreateFromUrl = Win32API.new('shlwapi', 'PathCreateFromUrl', 'PPPL', 'L')
49
- PathCreateFromUrlA = Win32API.new('shlwapi', 'PathCreateFromUrlA', 'PPPL', 'L')
50
- PathCreateFromUrlW = Win32API.new('shlwapi', 'PathCreateFromUrlW', 'PPPL', 'L')
51
-
52
- PathFileExists = Win32API.new('shlwapi', 'PathFileExists', 'P', 'I')
53
- PathFileExistsA = Win32API.new('shlwapi', 'PathFileExistsA', 'P', 'I')
54
- PathFileExistsW = Win32API.new('shlwapi', 'PathFileExistsW', 'P', 'I')
55
-
56
- PathFindExtension = Win32API.new('shlwapi', 'PathFindExtension', 'P', 'P')
57
- PathFindExtensionA = Win32API.new('shlwapi', 'PathFindExtensionA', 'P', 'P')
58
- PathFindExtensionW = Win32API.new('shlwapi', 'PathFindExtensionW', 'P', 'P')
59
-
60
- PathFindFileName = Win32API.new('shlwapi', 'PathFindFileName', 'P', 'P')
61
- PathFindFileNameA = Win32API.new('shlwapi', 'PathFindFileNameA', 'P', 'P')
62
- PathFindFileNameW = Win32API.new('shlwapi', 'PathFindFileNameW', 'P', 'P')
63
-
64
- PathFindNextComponent = Win32API.new('shlwapi', 'PathFindNextComponent', 'P', 'P')
65
- PathFindNextComponentA = Win32API.new('shlwapi', 'PathFindNextComponentA', 'P', 'P')
66
- PathFindNextComponentW = Win32API.new('shlwapi', 'PathFindNextComponentW', 'P', 'P')
67
-
68
- PathFindOnPath = Win32API.new('shlwapi', 'PathFindOnPath', 'PP', 'I')
69
- PathFindOnPathA = Win32API.new('shlwapi', 'PathFindOnPathA', 'PP', 'I')
70
- PathFindOnPathW = Win32API.new('shlwapi', 'PathFindOnPathW', 'PP', 'I')
71
-
72
- PathFindSuffixArray = Win32API.new('shlwapi', 'PathFindSuffixArray', 'PPI', 'P')
73
- PathFindSuffixArrayA = Win32API.new('shlwapi', 'PathFindSuffixArrayA', 'PPI', 'P')
74
- PathFindSuffixArrayW = Win32API.new('shlwapi', 'PathFindSuffixArrayW', 'PPI', 'P')
75
-
76
- PathGetArgs = Win32API.new('shlwapi', 'PathGetArgs', 'P', 'P')
77
- PathGetArgsA = Win32API.new('shlwapi', 'PathGetArgsA', 'P', 'P')
78
- PathGetArgsW = Win32API.new('shlwapi', 'PathGetArgsW', 'P', 'P')
79
-
80
- PathGetCharType = Win32API.new('shlwapi', 'PathGetCharType', 'P', 'I')
81
- PathGetCharTypeA = Win32API.new('shlwapi', 'PathGetCharTypeA', 'P', 'I')
82
- PathGetCharTypeW = Win32API.new('shlwapi', 'PathGetCharTypeW', 'P', 'I')
83
-
84
- PathGetDriveNumber = Win32API.new('shlwapi', 'PathGetDriveNumber', 'P', 'I')
85
- PathGetDriveNumberA = Win32API.new('shlwapi', 'PathGetDriveNumberA', 'P', 'I')
86
- PathGetDriveNumberW = Win32API.new('shlwapi', 'PathGetDriveNumberW', 'P', 'I')
87
-
88
- PathIsContentType = Win32API.new('shlwapi', 'PathIsContentType', 'PP', 'I')
89
- PathIsContentTypeA = Win32API.new('shlwapi', 'PathIsContentTypeA', 'PP', 'I')
90
- PathIsContentTypeW = Win32API.new('shlwapi', 'PathIsContentTypeW', 'PP', 'I')
91
-
92
- PathIsDirectory = Win32API.new('shlwapi', 'PathIsDirectory', 'P', 'I')
93
- PathIsDirectoryEmpty = Win32API.new('shlwapi', 'PathIsDirectoryEmpty', 'P', 'I')
94
- PathIsFileSpec = Win32API.new('shlwapi', 'PathIsFileSpec', 'P', 'I')
95
- #PathIsHTMLFile = Win32API.new('shlwapi', 'PathIsHTMLFile', 'P', 'I')
96
- PathIsLFNFileSpec = Win32API.new('shlwapi', 'PathIsLFNFileSpec', 'P', 'I')
97
- PathIsNetworkPath = Win32API.new('shlwapi', 'PathIsNetworkPath', 'P', 'I')
98
- PathIsPrefix = Win32API.new('shlwapi', 'PathIsPrefix', 'PP', 'I')
99
- PathIsRelative = Win32API.new('shlwapi', 'PathIsRelative', 'P', 'I')
100
- PathIsRoot = Win32API.new('shlwapi', 'PathIsRoot', 'P', 'I')
101
- PathIsSameRoot = Win32API.new('shlwapi', 'PathIsSameRoot', 'PP', 'I')
102
- PathIsSystemFolder = Win32API.new('shlwapi', 'PathIsSystemFolder', 'PL', 'I')
103
- PathIsUNC = Win32API.new('shlwapi', 'PathIsUNC', 'P', 'I')
104
- PathIsUNCServer = Win32API.new('shlwapi', 'PathIsUNCServer', 'P', 'I')
105
- PathIsUNCServerShare = Win32API.new('shlwapi', 'PathIsUNCServerShare','P','I')
106
- PathIsURL = Win32API.new('shlwapi', 'PathIsURL', 'P', 'I')
107
- PathMakePretty = Win32API.new('shlwapi', 'PathMakePretty', 'P', 'I')
108
- PathMakeSystemFolder = Win32API.new('shlwapi', 'PathMakeSystemFolder', 'P', 'I')
109
- PathMatchSpec = Win32API.new('shlwapi', 'PathMatchSpec', 'PP', 'I')
110
- PathParseIconLocation = Win32API.new('shlwapi', 'PathParseIconLocation', 'P', 'I')
111
- PathQuoteSpaces = Win32API.new('shlwapi', 'PathQuoteSpaces', 'P', 'V')
112
- PathRelativePathTo = Win32API.new('shlwapi', 'PathRelativePathTo', 'PPLPL', 'I')
113
- PathRemoveArgs = Win32API.new('shlwapi', 'PathRemoveArgs', 'P', 'V')
114
- PathRemoveBackslash = Win32API.new('shlwapi', 'PathRemoveBackslash', 'P', 'P')
115
- PathRemoveBlanks = Win32API.new('shlwapi', 'PathRemoveBlanks', 'P', 'V')
116
- PathRemoveExtension = Win32API.new('shlwapi', 'PathRemoveExtension', 'P','V')
117
- PathRemoveFileSpec = Win32API.new('shlwapi', 'PathRemoveFileSpec', 'P', 'L')
118
- PathRenameExtension = Win32API.new('shlwapi', 'PathRenameExtension', 'PP','I')
119
- PathSearchAndQualify = Win32API.new('shlwapi', 'PathSearchAndQualify', 'PPI', 'I')
120
- PathSetDlgItemPath = Win32API.new('shlwapi', 'PathSetDlgItemPath', 'LIP', 'V')
121
- PathSkipRoot = Win32API.new('shlwapi', 'PathSkipRoot', 'P', 'P')
122
- PathStripPath = Win32API.new('shlwapi', 'PathStripPath', 'P', 'V')
123
- PathStripToRoot = Win32API.new('shlwapi', 'PathStripToRoot', 'P', 'I')
124
- PathUndecorate = Win32API.new('shlwapi', 'PathUndecorate', 'P', 'V')
125
- PathUnExpandEnvStrings = Win32API.new('shlwapi', 'PathUnExpandEnvStrings', 'PPI', 'I')
126
- PathUnmakeSystemFolder = Win32API.new('shlwapi', 'PathUnmakeSystemFolder', 'P', 'I')
127
- PathUnquoteSpaces = Win32API.new('shlwapi', 'PathUnquoteSpaces', 'P', 'V')
128
-
129
- def PathAddBackslash(path)
130
- PathAddBackslash.call(path)
131
- end
132
-
133
- def PathAddExtension(path, ext)
134
- PathAddExtension.call(path, ext) > 0
135
- end
136
-
137
- def PathAppend(path, more)
138
- PathAppend.call(path, more) > 0
139
- end
140
-
141
- def PathBuildRoot(root, drive)
142
- PathBuildRoot.call(root, drive)
143
- end
144
-
145
- def PathCanonicalize(dst, src)
146
- PathCanonicalize.call(dst, src) > 0
147
- end
148
-
149
- def PathCombine(dest, dir, file)
150
- PathCombine.call(dest, dir, file)
151
- end
152
-
153
- def PathCommonPrefix(path1, path2, buf)
154
- PathCommonPrefix.call(path1, path2, buf)
155
- end
156
-
157
- def PathCompactPath(handle, path, px_width)
158
- PathCompactPath.call(handle, path, px_width) > 0
159
- end
160
-
161
- def PathCompactPathEx(out, src, max, flags = nil)
162
- PathCompactPathEx.call(out, src, max, flags) > 0
163
- end
164
-
165
- def PathCreateFromUrl(url, path, path_size, reserved = nil)
166
- PathCreateFromUrl.call(url, path, path_size, reserved) >= 0
167
- end
168
-
169
- def PathFileExists(path)
170
- PathFileExists.call(path) > 0
171
- end
172
-
173
- def PathFindExtension(path)
174
- PathFindExtension.call(path)
175
- end
176
-
177
- def PathFindFileName(path)
178
- PathFindFileName.call(path)
179
- end
6
+ API.auto_namespace = 'Windows::Path'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = true
180
10
 
181
- def PathFindNextComponent(path)
182
- PathFindNextComponent.call(path)
183
- end
184
-
185
- def PathFindOnPath(file, dirs)
186
- PathFindOnPath.call(file, dirs)
187
- end
188
-
189
- def PathFindSuffixArray(path, suffix_array, suffix_size)
190
- PathFindSuffixArray.call(path, suffix_array, suffix_size)
191
- end
192
-
193
- def PathGetArgs(path)
194
- PathGetArgs.call(path)
195
- end
196
-
197
- def PathGetCharType(char)
198
- PathGetCharType.call(char)
199
- end
200
-
201
- def PathGetDriveNumber(path)
202
- PathGetDriveNumber.call(path)
203
- end
204
-
205
- def PathIsContentType(path, content_type)
206
- PathIsContentType.call(path, content_type) > 0
207
- end
208
-
209
- def PathIsDirectory(path)
210
- PathIsDirectory.call(path) > 0
211
- end
212
-
213
- def PathIsDirectoryEmpty(path)
214
- PathIsDirectoryEmpty.call(path) > 0
215
- end
216
-
217
- def PathIsFileSpec(path)
218
- PathIsFileSpec.call(path) > 0
219
- end
220
-
221
- # This appears to be broken with the current MSVC distro. Use
222
- # PathIsContentType instead.
223
- #def PathIsHTMLFile(path)
224
- # PathIsHTMLFile.call(path)
225
- #end
226
-
227
- def PathIsLFNFileSpec(path)
228
- PathIsLFNFileSpec.call(path) > 0
229
- end
230
-
231
- def PathIsNetworkPath(path)
232
- PathIsNetworkPath.call(path) > 0
233
- end
234
-
235
- def PathIsPrefix(prefix, path)
236
- PathIsPrefix.call(prefix, path) > 0
237
- end
238
-
239
- def PathIsRelative(path)
240
- PathIsRelative.call(path) > 0
241
- end
242
-
243
- def PathIsRoot(path)
244
- PathIsRoot.call(path) > 0
245
- end
246
-
247
- def PathIsSameRoot(path1, path2)
248
- PathIsSameRoot.call(path1, path2) > 0
249
- end
250
-
251
- def PathIsSystemFolder(path)
252
- PathIsSystemFolder.call(path) > 0
253
- end
254
-
255
- def PathIsUNC(path)
256
- PathIsUNC.call(path) > 0
257
- end
258
-
259
- def PathIsUNCServer(path)
260
- PathIsUNCServer.call(path) > 0
261
- end
262
-
263
- def PathIsUNCServerShare(path)
264
- PathIsUNCServerShare.call(path) > 0
265
- end
266
-
267
- def PathIsURL(path)
268
- PathIsURL.call(path) > 0
269
- end
270
-
271
- def PathMakePretty(path)
272
- PathMakePretty.call(path) > 0
273
- end
274
-
275
- def PathMakeSystemFolder(path)
276
- PathMakeSystemFolder.call(path) > 0
277
- end
278
-
279
- def PathMatchSpec(path, spec)
280
- PathMatchSpec.call(path, spec) > 0
281
- end
282
-
283
- def PathParseIconLocation(path)
284
- PathParseIconLocation.call(path)
285
- end
286
-
287
- def PathQuoteSpaces(path)
288
- PathQuoteSpaces.call(path)
289
- end
290
-
291
- def PathRelativePathTo(path, from, from_attr, to, to_attr)
292
- PathRelativePathTo.call(path, from, from_attr, to, to_attr) > 0
293
- end
294
-
295
- def PathRemoveArgs(path)
296
- PathRemoveArgs.call(path)
297
- end
298
-
299
- def PathRemoveBackslash(path)
300
- PathRemoveBackslash.call(path)
301
- end
302
-
303
- def PathRemoveBlanks(path)
304
- PathRemoveBlanks.call(path)
305
- end
306
-
307
- def PathRemoveExtension(path)
308
- PathRemoveExtension.call(path)
309
- end
310
-
311
- def PathRemoveFileSpec(path)
312
- PathRemoveFileSpec.call(path) > 0
313
- end
314
-
315
- def PathRenameExtension(path, ext)
316
- PathRenameExtension.call(path, ext) > 0
317
- end
318
-
319
- def PathSearchAndQualify(path, full_path, full_path_size)
320
- PathSearchAndQualify.call(path, full_path, full_path_size) > 0
321
- end
322
-
323
- def PathSetDlgItemPath(handle, id, path)
324
- PathSetDlgItemPath.call(handle, id, path)
325
- end
326
-
327
- def PathSkipRoot(path)
328
- PathSkipRoot.call(path)
329
- end
330
-
331
- def PathStripPath(path)
332
- PathStripPath.call(path)
333
- end
334
-
335
- def PathStripToRoot(path)
336
- PathStripToRoot.call(path) > 0
337
- end
338
-
339
- def PathUndecorate(path)
340
- PathUndecorate.call(path)
341
- end
342
-
343
- def PathUnExpandEnvStrings(path, buf, buf_size)
344
- PathUnExpandEnvStrings.call(path, buf, buf_size) > 0
345
- end
346
-
347
- def PathUnmakeSystemFolder(path)
348
- PathUnmakeSystemFolder.call(path) > 0
349
- end
350
-
351
- def PathUnquoteSpaces(path)
352
- PathUnquoteSpaces.call(path)
353
- end
11
+ # These constants are for use by the PathGetCharType() function.
12
+ GCT_INVALID = 0x0000 # Character is not valid in a path.
13
+ GCT_LFNCHAR = 0x0001 # Character is valid in a long file name.
14
+ GCT_SHORTCHAR = 0x0002 # Character is valid in a short (8.3) file name.
15
+ GCT_WILD = 0x0004 # Character is a wildcard character.
16
+ GCT_SEPARATOR = 0x0008 # Character is a path separator.
17
+
18
+ API.new('PathAddBackslash', 'P', 'P', 'shlwapi')
19
+ API.new('PathAddExtension', 'PP', 'B', 'shlwapi')
20
+ API.new('PathAppend', 'PP', 'B', 'shlwapi')
21
+ API.new('PathBuildRoot', 'PI', 'P', 'shlwapi')
22
+ API.new('PathCanonicalize', 'PP', 'B', 'shlwapi')
23
+ API.new('PathCombine', 'PPP', 'P', 'shlwapi')
24
+ API.new('PathCommonPrefix', 'PPP', 'I', 'shlwapi')
25
+ API.new('PathCompactPath', 'PPI', 'B', 'shlwapi')
26
+ API.new('PathCompactPathEx', 'PPIL', 'B', 'shlwapi')
27
+ API.new('PathCreateFromUrl', 'PPPL', 'B', 'shlwapi')
28
+ API.new('PathFileExists', 'P', 'B', 'shlwapi')
29
+ API.new('PathFindExtension', 'P', 'P', 'shlwapi')
30
+ API.new('PathFindFileName', 'P', 'P', 'shlwapi')
31
+ API.new('PathFindNextComponent', 'P', 'P', 'shlwapi')
32
+ API.new('PathFindOnPath', 'PP', 'B', 'shlwapi')
33
+ API.new('PathFindSuffixArray', 'PPI', 'P', 'shlwapi')
34
+ API.new('PathGetArgs', 'P', 'P', 'shlwapi')
35
+ API.new('PathGetCharType', 'P', 'I', 'shlwapi')
36
+ API.new('PathGetDriveNumber', 'P', 'I', 'shlwapi')
37
+ API.new('PathIsContentType', 'PP', 'B', 'shlwapi')
38
+ API.new('PathIsDirectory', 'P', 'B', 'shlwapi')
39
+ API.new('PathIsDirectoryEmpty', 'P', 'B', 'shlwapi')
40
+ API.new('PathIsFileSpec', 'P', 'B', 'shlwapi')
41
+ API.new('PathIsLFNFileSpec', 'P', 'B', 'shlwapi')
42
+ API.new('PathIsNetworkPath', 'P', 'B', 'shlwapi')
43
+ API.new('PathIsPrefix', 'PP', 'B', 'shlwapi')
44
+ API.new('PathIsRelative', 'P', 'B', 'shlwapi')
45
+ API.new('PathIsRoot', 'P', 'B', 'shlwapi')
46
+ API.new('PathIsSameRoot', 'PP', 'B', 'shlwapi')
47
+ API.new('PathIsSystemFolder', 'PL', 'B', 'shlwapi')
48
+ API.new('PathIsUNC', 'P', 'B', 'shlwapi')
49
+ API.new('PathIsUNCServer', 'P', 'B', 'shlwapi')
50
+ API.new('PathIsUNCServerShare', 'P', 'B', 'shlwapi')
51
+ API.new('PathIsURL', 'P', 'B', 'shlwapi')
52
+ API.new('PathMakePretty', 'P', 'B', 'shlwapi')
53
+ API.new('PathMakeSystemFolder', 'P', 'B', 'shlwapi')
54
+ API.new('PathMatchSpec', 'PP', 'B', 'shlwapi')
55
+ API.new('PathParseIconLocation', 'P', 'I', 'shlwapi')
56
+ API.new('PathQuoteSpaces', 'P', 'V', 'shlwapi')
57
+ API.new('PathRelativePathTo', 'PPLPL', 'B', 'shlwapi')
58
+ API.new('PathRemoveArgs', 'P', 'V', 'shlwapi')
59
+ API.new('PathRemoveBackslash', 'P', 'P', 'shlwapi')
60
+ API.new('PathRemoveBlanks', 'P', 'V', 'shlwapi')
61
+ API.new('PathRemoveExtension', 'P','V', 'shlwapi')
62
+ API.new('PathRemoveFileSpec', 'P', 'B', 'shlwapi')
63
+ API.new('PathRenameExtension', 'PP', 'B', 'shlwapi')
64
+ API.new('PathSearchAndQualify', 'PPI', 'B', 'shlwapi')
65
+ API.new('PathSetDlgItemPath', 'LIP', 'V', 'shlwapi')
66
+ API.new('PathSkipRoot', 'P', 'P', 'shlwapi')
67
+ API.new('PathStripPath', 'P', 'V', 'shlwapi')
68
+ API.new('PathStripToRoot', 'P', 'B', 'shlwapi')
69
+ API.new('PathUndecorate', 'P', 'V', 'shlwapi')
70
+ API.new('PathUnExpandEnvStrings', 'PPI', 'B', 'shlwapi')
71
+ API.new('PathUnmakeSystemFolder', 'P', 'B', 'shlwapi')
72
+ API.new('PathUnquoteSpaces', 'P', 'V', 'shlwapi')
354
73
  end
355
74
  end
data/lib/windows/pipe.rb CHANGED
@@ -1,7 +1,13 @@
1
- require 'Win32API'
1
+ require 'windows/api'
2
+ include Windows
2
3
 
3
4
  module Windows
4
5
  module Pipe
6
+ API.auto_namespace = 'Windows::Pipe'
7
+ API.auto_constant = true
8
+ API.auto_method = true
9
+ API.auto_unicode = true
10
+
5
11
  NMPWAIT_NOWAIT = 0x00000001
6
12
  NMPWAIT_WAIT_FOREVER = 0xffffffff
7
13
  NMPWAIT_USE_DEFAULT_WAIT = 0x00000000
@@ -20,60 +26,16 @@ module Windows
20
26
 
21
27
  PIPE_UNLIMITED_INSTANCES = 255
22
28
 
23
- CallNamedPipe = Win32API.new('kernel32', 'CallNamedPipe', 'PPLPLPL', 'I')
24
- ConnectNamedPipe = Win32API.new('kernel32', 'ConnectNamedPipe', 'LP', 'I')
25
- CreateNamedPipe = Win32API.new('kernel32', 'CreateNamedPipe', 'PLLLLLLL', 'L')
26
- CreatePipe = Win32API.new('kernel32', 'CreatePipe', 'PPPL', 'I')
27
- DisconnectNamedPipe = Win32API.new('kernel32', 'DisconnectNamedPipe', 'L', 'I')
28
- GetNamedPipeHandleState = Win32API.new('kernel32', 'GetNamedPipeHandleState', 'LPPPPPL', 'I')
29
- GetNamedPipeInfo = Win32API.new('kernel32', 'GetNamedPipeInfo', 'LPPPP', 'I')
30
- PeekNamedPipe = Win32API.new('kernel32', 'PeekNamedPipe', 'LPLPPP', 'I')
31
- SetNamedPipeHandleState = Win32API.new('kernel32', 'SetNamedPipeHandleState', 'LPPP', 'I')
32
- TransactNamedPipe = Win32API.new('kernel32', 'TransactNamedPipe', 'LPLPLPP', 'I')
33
- WaitNamedPipe = Win32API.new('kernel32', 'WaitNamedPipe', 'PL', 'I')
34
-
35
- def CallNamedPipe(name, buf, buf_size, out, out_size, read, timeout)
36
- CallNamedPipe.call(name, buf, buf_size, out, out_size, read, timeout) != 0
37
- end
38
-
39
- def ConnectNamedPipe(pipe, overlapped = 0)
40
- ConnectNamedPipe.call(pipe, overlapped) != 0
41
- end
42
-
43
- def CreateNamedPipe(name, open_mode, pipe_mode, max, out_size, in_size, timeout, sec_attr)
44
- CreateNamedPipe.call(name, open_mode, pipe_mode, max, out_size, in_size, timeout, sec_attr)
45
- end
46
-
47
- def CreatePipe(read_pipe, write_pipe, pipe_attr, size)
48
- CreatePipe.call(read_pipe, write_pipe, pipe_attr, size) != 0
49
- end
50
-
51
- def DisconnectNamedPipe(name)
52
- DisconnectNamedPipe.call(name) != 0
53
- end
54
-
55
- def GetNamedPipeHandleState(name, state, instances, count, timeout, user, size)
56
- GetNamedPipeHandleState.call(name, state, instances, count, timeout, user, size) != 0
57
- end
58
-
59
- def GetNamedPipeInfo(name, flags, out_size, in_size, max)
60
- GetNamedPipeInfo.call(name, flags, out_size, in_size, max) != 0
61
- end
62
-
63
- def PeekNamedPipe(name, buf, buf_size, bytes_read, bytes_avail, bytes_left)
64
- PeekNamedPipe.call(name, buf, buf_size, bytes_read, bytes_avail, bytes_left) != 0
65
- end
66
-
67
- def SetNamedPipeHandleState(name, mode, max, timeout)
68
- SetNamedPipeHandleState.call(name, mode, max, timeout) != 0
69
- end
70
-
71
- def TransactNamedPipe(name, in_buf, in_buf_size, out_buf, out_buf_size, read, overlapped)
72
- TransactNamedPipe.call(name, in_buf, in_buf_size, out_buf, out_buf_size, read, overlapped) != 0
73
- end
74
-
75
- def WaitNamedPipe(name, timeout)
76
- WaitNamedPipe.call(name, timeout) != 0
77
- end
29
+ API.new('CallNamedPipe', 'PPLPLPL', 'B')
30
+ API.new('ConnectNamedPipe', 'LP', 'B')
31
+ API.new('CreateNamedPipe', 'PLLLLLLL', 'L')
32
+ API.new('CreatePipe', 'PPPL', 'B')
33
+ API.new('DisconnectNamedPipe', 'L', 'B')
34
+ API.new('GetNamedPipeHandleState', 'LPPPPPL', 'B')
35
+ API.new('GetNamedPipeInfo', 'LPPPP', 'B')
36
+ API.new('PeekNamedPipe', 'LPLPPP', 'B')
37
+ API.new('SetNamedPipeHandleState', 'LPPP', 'B')
38
+ API.new('TransactNamedPipe', 'LPLPLPP', 'B')
39
+ API.new('WaitNamedPipe', 'PL', 'B')
78
40
  end
79
41
  end