windows-pr 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,6 +1,17 @@
1
+ = 0.9.7 - 5-Dec-2008
2
+ * Renamed Windows::NTFS::File to Windows::NTFS::Winternl.
3
+ * Updated the Windows::Network::Management and Windows::Shell modules to use
4
+ the 'S' prototype where appropriate.
5
+ * Updated the Windows::File module to use the 'S' prototype where appropriate.
6
+ * Added the GetFinalPathNameByHandle function to the Windows::NTFS::Winternl
7
+ module for Windows XP/2000.
8
+ * Added a few new functions to the Windows::Volume module and converted 'P'
9
+ prototypes to 'S' where appropriate.
10
+ * Added SE_OBJECT_TYPE enumeration values to the Windows::Security module.
11
+
1
12
  = 0.9.6 - 14-Nov-2008
2
13
  * Updated the RegisterServiceCtrlHandler and RegisterServiceCtrlHandlerEx
3
- protoypes in the Windows::Service module. Changed old 'P' prototype to 'K'
14
+ prototypes in the Windows::Service module. Changed old 'P' prototype to 'K'
4
15
  for callbacks.
5
16
  * Added explicit ANSI and Wide character functions for GetFileSecurity and
6
17
  SetFileSecurity in the Windows::Security module (since automatic unicode
data/lib/windows/file.rb CHANGED
@@ -198,36 +198,36 @@ module Windows
198
198
  IO_REPARSE_TAG_SIS = 0x80000007
199
199
  IO_REPARSE_TAG_SYMLINK = 0xA000000C
200
200
 
201
- API.new('CopyFile', 'PPI', 'B')
202
- API.new('CopyFileEx', 'PPKPPL', 'B')
203
- API.new('CreateFile', 'PLLPLLL', 'L')
204
- API.new('CreateHardLink', 'PPP', 'B')
205
- API.new('DecryptFile', 'PL', 'B', 'advapi32')
206
- API.new('DeleteFile', 'P', 'B')
207
- API.new('EncryptFile', 'P', 'B', 'advapi32')
201
+ API.new('CopyFile', 'SSI', 'B')
202
+ API.new('CopyFileEx', 'SSKPPL', 'B')
203
+ API.new('CreateFile', 'SLLPLLL', 'L')
204
+ API.new('CreateHardLink', 'SSP', 'B')
205
+ API.new('DecryptFile', 'SL', 'B', 'advapi32')
206
+ API.new('DeleteFile', 'S', 'B')
207
+ API.new('EncryptFile', 'S', 'B', 'advapi32')
208
208
  API.new('FindClose', 'L', 'B')
209
- API.new('FindFirstFile', 'PP', 'L')
210
- API.new('FindFirstFileEx', 'PIPIII', 'L')
209
+ API.new('FindFirstFile', 'SP', 'L')
210
+ API.new('FindFirstFileEx', 'SIPIII', 'L')
211
211
  API.new('FindNextFile', 'LP', 'B')
212
212
  API.new('FlushFileBuffers', 'L', 'B')
213
- API.new('GetBinaryType', 'PP', 'B')
214
- API.new('GetFileAttributes', 'P', 'L')
215
- API.new('GetFileAttributesEx', 'PPP', 'I')
213
+ API.new('GetBinaryType', 'SP', 'B')
214
+ API.new('GetFileAttributes', 'S', 'L')
215
+ API.new('GetFileAttributesEx', 'SPP', 'I')
216
216
  API.new('GetFileInformationByHandle', 'LP', 'B')
217
217
  API.new('GetFileSize', 'LP', 'L')
218
218
  API.new('GetFileSizeEx', 'LP', 'B')
219
219
  API.new('GetFileType', 'L', 'L')
220
- API.new('GetFullPathName', 'PLPP', 'L')
221
- API.new('GetLongPathName', 'PPL', 'L')
222
- API.new('GetShortPathName', 'PPL', 'L')
220
+ API.new('GetFullPathName', 'SLPP', 'L')
221
+ API.new('GetLongPathName', 'SPL', 'L')
222
+ API.new('GetShortPathName', 'SPL', 'L')
223
223
  API.new('LockFile', 'LLLLL', 'B')
224
224
  API.new('LockFileEx', 'LLLLLL', 'B')
225
- API.new('MoveFile', 'PP', 'B')
226
- API.new('MoveFileEx', 'PPL', 'B')
225
+ API.new('MoveFile', 'SS', 'B')
226
+ API.new('MoveFileEx', 'SSL', 'B')
227
227
  API.new('ReadFile', 'LPLPP', 'B')
228
228
  API.new('ReadFileEx', 'LPLPK', 'B')
229
229
  API.new('SetEndOfFile', 'L', 'B')
230
- API.new('SetFileAttributes', 'PL', 'B')
230
+ API.new('SetFileAttributes', 'SL', 'B')
231
231
  API.new('UnlockFile', 'LLLLL', 'B')
232
232
  API.new('UnlockFileEx', 'LLLLL', 'B')
233
233
  API.new('WriteFile', 'LPLPP', 'B')
@@ -252,8 +252,8 @@ module Windows
252
252
 
253
253
  # Windows Vista
254
254
  begin
255
- API.new('CreateSymbolicLink', 'PPL', 'B')
256
- API.new('CreateSymbolicLinkTransacted', 'PPLL', 'B')
255
+ API.new('CreateSymbolicLink', 'SSL', 'B')
256
+ API.new('CreateSymbolicLinkTransacted', 'SSLL', 'B')
257
257
  API.new('GetFileInformationByHandleEx', 'LLPL', 'B')
258
258
  API.new('GetFinalPathNameByHandle', 'LPLL', 'L')
259
259
  API.new('SetFileInformationByHandle', 'LLPL', 'B')
@@ -14,6 +14,7 @@ module Windows
14
14
 
15
15
  API.new('CreateFileMapping', 'LPLLLP', 'L')
16
16
  API.new('FlushViewOfFile', 'PL', 'B')
17
+ API.new('GetMappedFileName', 'LLPL', 'L', 'psapi')
17
18
  API.new('MapViewOfFile', 'LLLLL', 'L')
18
19
  API.new('MapViewOfFileEx', 'LLLLLL', 'L')
19
20
  API.new('OpenFileMapping', 'LIP', 'L')
@@ -107,82 +107,82 @@ module Windows
107
107
  SV_TYPE_DOMAIN_ENUM = 0x80000000
108
108
  SV_TYPE_ALL = 0xFFFFFFFF
109
109
 
110
- API.new('NetAlertRaise', 'PPL', 'L', 'netapi32')
111
- API.new('NetAlertRaiseEx', 'PPLP', 'L', 'netapi32')
110
+ API.new('NetAlertRaise', 'SPL', 'L', 'netapi32')
111
+ API.new('NetAlertRaiseEx', 'SPLS', 'L', 'netapi32')
112
112
  API.new('NetApiBufferAllocate', 'LP', 'L', 'netapi32')
113
113
  API.new('NetApiBufferFree', 'P', 'L', 'netapi32')
114
114
  API.new('NetApiBufferReallocate', 'PLP', 'L', 'netapi32')
115
115
  API.new('NetApiBufferSize', 'PP', 'L', 'netapi32')
116
- API.new('NetGetAnyDCName', 'PPP', 'L', 'netapi32')
117
- API.new('NetGetDCName', 'PPP', 'L', 'netapi32')
118
- API.new('NetGetDisplayInformationIndex', 'PLPP', 'L', 'netapi32')
119
- API.new('NetGetJoinableOUs', 'PPPPPP', 'L', 'netapi32')
120
- API.new('NetGetJoinInformation', 'PPP', 'L', 'netapi32')
121
- API.new('NetGroupAdd', 'PLPP', 'L', 'netapi32')
122
- API.new('NetGroupAddUser', 'PPP', 'L', 'netapi32')
123
- API.new('NetGroupDel', 'PP', 'L', 'netapi32')
124
- API.new('NetGroupDelUser', 'PPP', 'L', 'netapi32')
125
- API.new('NetGroupEnum', 'PLPLPPP', 'L', 'netapi32')
126
- API.new('NetGroupGetInfo', 'PPLP', 'L', 'netapi32')
127
- API.new('NetGroupGetUsers', 'PPLPLPPP', 'L', 'netapi32')
128
- API.new('NetGroupSetInfo', 'PPLPP', 'L', 'netapi32')
129
- API.new('NetGroupSetUsers', 'PPLPL', 'L', 'netapi32')
130
- API.new('NetJoinDomain', 'PPPPPL', 'L', 'netapi32')
131
- API.new('NetLocalGroupAdd', 'PLPP', 'L', 'netapi32')
132
- API.new('NetLocalGroupAddMembers', 'PPLPL', 'L', 'netapi32')
133
- API.new('NetLocalGroupDel', 'PP', 'L', 'netapi32')
134
- API.new('NetLocalGroupDelMembers', 'PPLPL', 'L', 'netapi32')
135
- API.new('NetLocalGroupEnum', 'PLPLPPP', 'L', 'netapi32')
136
- API.new('NetLocalGroupGetInfo', 'PPLP', 'L', 'netapi32')
137
- API.new('NetLocalGroupGetMembers', 'PPLPLPPP', 'L', 'netapi32')
138
- API.new('NetLocalGroupSetInfo', 'PPLPP', 'L', 'netapi32')
139
- API.new('NetLocalGroupSetMembers', 'PPLPP', 'L', 'netapi32')
140
- API.new('NetMessageBufferSend', 'PPPPL', 'L', 'netapi32')
141
- API.new('NetMessageNameAdd', 'PP', 'L', 'netapi32')
142
- API.new('NetMessageNameDel', 'PP', 'L', 'netapi32')
143
- API.new('NetMessageNameEnum', 'PLPLPPP', 'L', 'netapi32')
144
- API.new('NetMessageNameGetInfo', 'PPLP', 'L', 'netapi32')
145
- API.new('NetQueryDisplayInformation', 'PLLLLPP', 'L', 'netapi32')
146
- API.new('NetRemoteComputerSupports', 'PLP', 'L', 'netapi32')
147
- API.new('NetRemoteTOD', 'PP', 'L', 'netapi32')
148
- API.new('NetRenameMachineInDomain', 'PPPPL', 'L', 'netapi32')
149
- API.new('NetScheduleJobAdd', 'PPP', 'L', 'netapi32')
150
- API.new('NetScheduleJobDel', 'PLL', 'L', 'netapi32')
151
- API.new('NetScheduleJobEnum', 'PPLPPP', 'L', 'netapi32')
152
- API.new('NetScheduleJobGetInfo', 'PLP', 'L', 'netapi32')
153
- API.new('NetServerComputerNameAdd', 'PPP', 'L', 'netapi32')
154
- API.new('NetServerComputerNameDel', 'PP', 'L', 'netapi32')
155
- API.new('NetServerDiskEnum', 'PLPLPPP', 'L', 'netapi32')
156
- API.new('NetServerEnum', 'PLPLPPLPP', 'L', 'netapi32')
157
- API.new('NetServerGetInfo', 'PLP', 'L', 'netapi32')
158
- API.new('NetServerSetInfo', 'PLPP', 'L', 'netapi32')
159
- API.new('NetServerTransportAdd', 'PLP', 'L', 'netapi32')
160
- API.new('NetServerTransportAddEx', 'PLP', 'L', 'netapi32')
161
- API.new('NetServerTransportDel', 'PLP', 'L', 'netapi32')
162
- API.new('NetServerTransportEnum', 'PLPLPPP', 'L', 'netapi32')
163
- API.new('NetUnjoinDomain', 'PPPL', 'L', 'netapi32')
164
- API.new('NetUseAdd', 'PLPP', 'L', 'netapi32')
165
- API.new('NetUseDel', 'PPL', 'L', 'netapi32')
166
- API.new('NetUseEnum', 'PLPLPPP', 'L', 'netapi32')
167
- API.new('NetUseGetInfo', 'PPLP', 'L', 'netapi32')
168
- API.new('NetUserAdd', 'PLPP', 'L', 'netapi32')
169
- API.new('NetUserChangePassword', 'PPPP', 'L', 'netapi32')
170
- API.new('NetUserDel', 'PP', 'L', 'netapi32')
171
- API.new('NetUserEnum', 'PLLPLPPP', 'L', 'netapi32')
172
- API.new('NetUserGetGroups', 'PPLPLPP', 'L', 'netapi32')
173
- API.new('NetUserGetInfo', 'PPLP', 'L', 'netapi32')
174
- API.new('NetUserGetLocalGroups', 'PPLLPLPP', 'L', 'netapi32')
175
- API.new('NetUserModalsGet', 'PLP', 'L', 'netapi32')
176
- API.new('NetUserModalsSet', 'PLPP', 'L', 'netapi32')
177
- API.new('NetUserSetGroups', 'PPLPL', 'L', 'netapi32')
178
- API.new('NetUserSetInfo', 'PPLPP', 'L', 'netapi32')
179
- API.new('NetValidateName', 'PPPPP', 'L', 'netapi32')
180
- API.new('NetWkstaGetInfo', 'PLP', 'L', 'netapi32')
181
- API.new('NetWkstaSetInfo', 'PLPP', 'L', 'netapi32')
182
- API.new('NetWkstaTransportAdd', 'PLPP', 'L', 'netapi32')
183
- API.new('NetWkstaTransportDel', 'PPL', 'L', 'netapi32')
184
- API.new('NetWkstaTransportEnum', 'PLPLPPP', 'L', 'netapi32')
185
- API.new('NetWkstaUserEnum', 'PLPLPPP', 'L', 'netapi32')
116
+ API.new('NetGetAnyDCName', 'SSP', 'L', 'netapi32')
117
+ API.new('NetGetDCName', 'SSP', 'L', 'netapi32')
118
+ API.new('NetGetDisplayInformationIndex', 'SLPP', 'L', 'netapi32')
119
+ API.new('NetGetJoinableOUs', 'SSSSPP', 'L', 'netapi32')
120
+ API.new('NetGetJoinInformation', 'SPP', 'L', 'netapi32')
121
+ API.new('NetGroupAdd', 'SLPP', 'L', 'netapi32')
122
+ API.new('NetGroupAddUser', 'SSS', 'L', 'netapi32')
123
+ API.new('NetGroupDel', 'SS', 'L', 'netapi32')
124
+ API.new('NetGroupDelUser', 'SSS', 'L', 'netapi32')
125
+ API.new('NetGroupEnum', 'SLPLPPP', 'L', 'netapi32')
126
+ API.new('NetGroupGetInfo', 'SSLP', 'L', 'netapi32')
127
+ API.new('NetGroupGetUsers', 'SSLPLPPP', 'L', 'netapi32')
128
+ API.new('NetGroupSetInfo', 'SSLPP', 'L', 'netapi32')
129
+ API.new('NetGroupSetUsers', 'SSLPL', 'L', 'netapi32')
130
+ API.new('NetJoinDomain', 'SSSSSL', 'L', 'netapi32')
131
+ API.new('NetLocalGroupAdd', 'SLPP', 'L', 'netapi32')
132
+ API.new('NetLocalGroupAddMembers', 'SSLPL', 'L', 'netapi32')
133
+ API.new('NetLocalGroupDel', 'SS', 'L', 'netapi32')
134
+ API.new('NetLocalGroupDelMembers', 'SSLPL', 'L', 'netapi32')
135
+ API.new('NetLocalGroupEnum', 'SLPLPPP', 'L', 'netapi32')
136
+ API.new('NetLocalGroupGetInfo', 'SSLP', 'L', 'netapi32')
137
+ API.new('NetLocalGroupGetMembers', 'SSLPLPPP', 'L', 'netapi32')
138
+ API.new('NetLocalGroupSetInfo', 'SSLPP', 'L', 'netapi32')
139
+ API.new('NetLocalGroupSetMembers', 'SSLPP', 'L', 'netapi32')
140
+ API.new('NetMessageBufferSend', 'SSSPL', 'L', 'netapi32')
141
+ API.new('NetMessageNameAdd', 'SS', 'L', 'netapi32')
142
+ API.new('NetMessageNameDel', 'SS', 'L', 'netapi32')
143
+ API.new('NetMessageNameEnum', 'SLPLPPP', 'L', 'netapi32')
144
+ API.new('NetMessageNameGetInfo', 'SSLP', 'L', 'netapi32')
145
+ API.new('NetQueryDisplayInformation', 'SLLLLPP', 'L', 'netapi32')
146
+ API.new('NetRemoteComputerSupports', 'SLP', 'L', 'netapi32')
147
+ API.new('NetRemoteTOD', 'SP', 'L', 'netapi32')
148
+ API.new('NetRenameMachineInDomain', 'SSSSL', 'L', 'netapi32')
149
+ API.new('NetScheduleJobAdd', 'SPP', 'L', 'netapi32')
150
+ API.new('NetScheduleJobDel', 'SLL', 'L', 'netapi32')
151
+ API.new('NetScheduleJobEnum', 'SPLPPP', 'L', 'netapi32')
152
+ API.new('NetScheduleJobGetInfo', 'SLP', 'L', 'netapi32')
153
+ API.new('NetServerComputerNameAdd', 'SSS', 'L', 'netapi32')
154
+ API.new('NetServerComputerNameDel', 'SS', 'L', 'netapi32')
155
+ API.new('NetServerDiskEnum', 'SLPLPPP', 'L', 'netapi32')
156
+ API.new('NetServerEnum', 'SLPLPPLPP', 'L', 'netapi32')
157
+ API.new('NetServerGetInfo', 'SLP', 'L', 'netapi32')
158
+ API.new('NetServerSetInfo', 'SLPP', 'L', 'netapi32')
159
+ API.new('NetServerTransportAdd', 'SLP', 'L', 'netapi32')
160
+ API.new('NetServerTransportAddEx', 'SLP', 'L', 'netapi32')
161
+ API.new('NetServerTransportDel', 'SLP', 'L', 'netapi32')
162
+ API.new('NetServerTransportEnum', 'SLPLPPP', 'L', 'netapi32')
163
+ API.new('NetUnjoinDomain', 'SSSL', 'L', 'netapi32')
164
+ API.new('NetUseAdd', 'SLPP', 'L', 'netapi32')
165
+ API.new('NetUseDel', 'SSL', 'L', 'netapi32')
166
+ API.new('NetUseEnum', 'SLPLPPP', 'L', 'netapi32')
167
+ API.new('NetUseGetInfo', 'SSLP', 'L', 'netapi32')
168
+ API.new('NetUserAdd', 'SLPP', 'L', 'netapi32')
169
+ API.new('NetUserChangePassword', 'SSSS', 'L', 'netapi32')
170
+ API.new('NetUserDel', 'SS', 'L', 'netapi32')
171
+ API.new('NetUserEnum', 'SLLPLPPP', 'L', 'netapi32')
172
+ API.new('NetUserGetGroups', 'SSLPLPP', 'L', 'netapi32')
173
+ API.new('NetUserGetInfo', 'SSLP', 'L', 'netapi32')
174
+ API.new('NetUserGetLocalGroups', 'SSLLPLPP', 'L', 'netapi32')
175
+ API.new('NetUserModalsGet', 'SLP', 'L', 'netapi32')
176
+ API.new('NetUserModalsSet', 'SLPP', 'L', 'netapi32')
177
+ API.new('NetUserSetGroups', 'SSLPL', 'L', 'netapi32')
178
+ API.new('NetUserSetInfo', 'SSLPP', 'L', 'netapi32')
179
+ API.new('NetValidateName', 'SSSSP', 'L', 'netapi32')
180
+ API.new('NetWkstaGetInfo', 'SLP', 'L', 'netapi32')
181
+ API.new('NetWkstaSetInfo', 'SLPP', 'L', 'netapi32')
182
+ API.new('NetWkstaTransportAdd', 'SLPP', 'L', 'netapi32')
183
+ API.new('NetWkstaTransportDel', 'SSL', 'L', 'netapi32')
184
+ API.new('NetWkstaTransportEnum', 'SLPLPPP', 'L', 'netapi32')
185
+ API.new('NetWkstaUserEnum', 'SLPLPPP', 'L', 'netapi32')
186
186
  API.new('NetWkstaUserGetInfo', 'PLP', 'L', 'netapi32')
187
187
  API.new('NetWkstaUserSetInfo', 'PPLP', 'L', 'netapi32')
188
188
 
@@ -2,8 +2,8 @@ require 'windows/api'
2
2
 
3
3
  module Windows
4
4
  module NTFS
5
- module File
6
- API.auto_namespace = 'Windows::NTFS::File'
5
+ module Winternl
6
+ API.auto_namespace = 'Windows::NTFS::Winternl'
7
7
  API.auto_constant = true
8
8
  API.auto_method = true
9
9
  API.auto_unicode = false
@@ -50,9 +50,41 @@ module Windows
50
50
  FileTrackingInformation = 36
51
51
  FileValidDataLengthInformation = 39
52
52
 
53
+ ObjectNameInformation = 1
54
+
53
55
  STATUS_SUCCESS = 0
54
56
 
55
57
  API.new('NtQueryInformationFile', 'LPPLL', 'L', 'ntdll')
58
+ API.new('NtQueryObject', 'LLPLP', 'L', 'ntdll')
59
+
60
+ # Should work for Windows XP/2000
61
+ unless defined? GetFinalPathNameByHandle
62
+ require 'windows/handle'
63
+ require 'windows/error'
64
+ require 'windows/unicode'
65
+
66
+ def GetFinalPathNameByHandle(file)
67
+ begin
68
+ MAX_PATH = 256
69
+ fh = File.open(file, 'r')
70
+ handle = get_osfhandle(fh.fileno)
71
+ object_name_information = 0.chr * (8 + (MAX_PATH*2))
72
+
73
+ status = NtQueryObject(
74
+ handle,
75
+ ObjectNameInformation,
76
+ object_name_information,
77
+ object_name_information.size
78
+ 0
79
+ )
80
+
81
+ name = wide_to_multi(object_name_information[8..-1])
82
+ ensure
83
+ fh.close
84
+ end
85
+ name
86
+ end
87
+ end
56
88
  end
57
89
  end
58
90
  end
@@ -21,6 +21,7 @@ module Windows
21
21
  SE_DACL_PRESENT = 4
22
22
  SECURITY_DESCRIPTOR_MIN_LENGTH = 20
23
23
  SECURITY_DESCRIPTOR_REVISION = 1
24
+ SECURITY_DESCRIPTOR_REVISION1 = 1
24
25
 
25
26
  SECURITY_NULL_SID_AUTHORITY = 0
26
27
  SECURITY_WORLD_SID_AUTHORITY = 1
@@ -130,6 +131,25 @@ module Windows
130
131
  SE_PRIVILEGE_REMOVED = 0X00000004
131
132
  SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000
132
133
 
134
+ OWNER_SECURITY_INFORMATION = 1
135
+ GROUP_SECURITY_INFORMATION = 2
136
+
137
+ # SE_OBJECT_TYPE Enumeration
138
+
139
+ SE_UNKNOWN_OBJECT_TYPE = 0
140
+ SE_FILE_OBJECT = 1
141
+ SE_SERVICE = 2
142
+ SE_PRINTER = 3
143
+ SE_REGISTRY_KEY = 4
144
+ SE_LMSHARE = 5
145
+ SE_KERNEL_OBJECT = 6
146
+ SE_WINDOW_OBJECT = 7
147
+ SE_DS_OBJECT = 8
148
+ SE_DS_OBJECT_ALL = 9
149
+ SE_PROVIDER_DEFINED_OBJECT = 10
150
+ SE_WMIGUID_OBJECT = 11
151
+ SE_REGISTRY_WOW64_32KEY = 12
152
+
133
153
  # Defined Privileges
134
154
 
135
155
  SE_CREATE_TOKEN_NAME = "SeCreateTokenPrivilege"
data/lib/windows/shell.rb CHANGED
@@ -137,23 +137,23 @@ module Windows
137
137
  SHGFI_OVERLAYINDEX = 0x000000040 # Get the index of the overlay
138
138
 
139
139
  API.new('DragQueryFile', 'LIPI', 'I', 'shell32')
140
- API.new('ExtractIcon', 'LPI', 'L', 'shell32')
141
- API.new('ExtractIconEx', 'PIPPI', 'I', 'shell32')
142
- API.new('FindExecutable', 'PPP', 'L', 'shell32')
140
+ API.new('ExtractIcon', 'LSI', 'L', 'shell32')
141
+ API.new('ExtractIconEx', 'SIPPI', 'I', 'shell32')
142
+ API.new('FindExecutable', 'SSP', 'L', 'shell32')
143
143
  API.new('GetAllUsersProfileDirectory', 'PP', 'B', 'userenv')
144
144
  API.new('GetDefaultUserProfileDirectory', 'PP', 'B', 'userenv')
145
145
  API.new('GetProfilesDirectory', 'PP', 'B', 'userenv')
146
146
  API.new('GetUserProfileDirectory', 'LPP', 'B', 'userenv')
147
- API.new('ShellAbout', 'LPPL', 'I', 'shell32')
147
+ API.new('ShellAbout', 'LSSL', 'I', 'shell32')
148
148
  API.new('SHBrowseForFolder', 'P', 'P', 'shell32')
149
149
  API.new('SHChangeNotify', 'LILL', 'V', 'shell32')
150
- API.new('ShellExecute', 'LPPPPI', 'L', 'shell32')
150
+ API.new('ShellExecute', 'LSSSSI', 'L', 'shell32')
151
151
  API.new('ShellExecuteEx', 'P', 'B', 'shell32')
152
152
  API.new('SHFileOperation', 'P', 'I', 'shell32')
153
153
  API.new('SHGetFileInfo', 'PLPII', 'L', 'shell32')
154
154
  API.new('SHGetFolderLocation', 'LILLP', 'L', 'shell32')
155
155
  API.new('SHGetFolderPath', 'LLLLP', 'L', 'shell32')
156
- API.new('SHGetNewLinkInfo', 'PPPPI', 'B', 'shell32')
156
+ API.new('SHGetNewLinkInfo', 'SSPPI', 'B', 'shell32')
157
157
  API.new('SHGetPathFromIDList', 'LL', 'B', 'shell32')
158
158
  API.new('SHGetSpecialFolderLocation', 'LIP', 'L', 'shell32')
159
159
  API.new('SHGetSpecialFolderPath', 'LPLL','L', 'shell32')
@@ -15,27 +15,36 @@ module Windows
15
15
  DRIVE_CDROM = 5
16
16
  DRIVE_RAMDISK = 6
17
17
 
18
+ API.new('DefineDosDevice', 'LSS', 'B')
19
+ API.new('DeleteVolumeMountPoint', 'S', 'B')
18
20
  API.new('FindFirstVolume', 'PL', 'L')
19
- API.new('FindFirstVolumeMountPoint', 'PPL', 'L')
21
+ API.new('FindFirstVolumeMountPoint', 'SPL', 'L')
20
22
  API.new('FindNextVolume', 'LPL', 'B')
21
23
  API.new('FindNextVolumeMountPoint', 'LPL', 'B')
22
24
  API.new('FindVolumeClose', 'L', 'B')
23
25
  API.new('FindVolumeMountPointClose', 'L', 'B')
24
- API.new('GetDriveType', 'P', 'I')
26
+ API.new('GetDriveType', 'S', 'I')
25
27
  API.new('GetLogicalDrives', 'V', 'L')
26
28
  API.new('GetLogicalDriveStrings', 'LP', 'L')
27
- API.new('GetVolumeInformation', 'PPLPPPPL', 'B')
28
- API.new('GetVolumeNameForVolumeMountPoint', 'PPL', 'B')
29
+ API.new('GetVolumeInformation', 'SPLPPPPL', 'B')
30
+ API.new('GetVolumeNameForVolumeMountPoint', 'SPL', 'B')
29
31
  API.new('GetVolumePathName', 'PPL', 'B')
30
- API.new('SetVolumeLabel', 'PP', 'B')
31
- API.new('SetVolumeMountPoint', 'PP', 'B')
32
+ API.new('QueryDosDevice', 'SPL', 'L')
33
+ API.new('SetVolumeLabel', 'SS', 'B')
34
+ API.new('SetVolumeMountPoint', 'SS', 'B')
32
35
 
33
36
  # Windows XP or later
34
37
  begin
35
- API.new('GetVolumePathNamesForVolumeName', 'PPLL', 'B')
38
+ API.new('GetVolumePathNamesForVolumeName', 'SPLL', 'B')
36
39
  rescue Windows::API::Error
37
- # Do nothing - not supported on current platform. It's up to you to
38
- # check for the existence of the constant in your code.
40
+ # Do nothing. Not supported on current platform.
39
41
  end
42
+
43
+ # Windows Vista or later
44
+ begin
45
+ API.new('GetVolumeInformationByHandleW', 'LPLPPPPL', 'B')
46
+ rescue
47
+ # Do nothing. Not supported on your platform.
48
+ end
40
49
  end
41
50
  end
data/windows-pr.gemspec CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = "windows-pr"
5
- gem.version = "0.9.6"
5
+ gem.version = "0.9.7"
6
6
  gem.authors = ["Daniel J. Berger", "Park Heesob"]
7
7
  gem.email = "djberg96@gmail.com"
8
8
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
@@ -18,10 +18,9 @@ spec = Gem::Specification.new do |gem|
18
18
  gem.require_path = "lib"
19
19
  gem.extra_rdoc_files = ["MANIFEST", "README", "CHANGES"]
20
20
  gem.add_dependency("windows-api", ">= 0.2.4")
21
- gem.add_dependency("win32-api", ">= 1.2.1")
21
+ gem.add_dependency("win32-api", ">= 1.2.2")
22
22
  end
23
23
 
24
24
  if $0 == __FILE__
25
- Gem.manage_gems
26
25
  Gem::Builder.new(spec).build
27
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: windows-pr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-11-14 00:00:00 -07:00
13
+ date: 2008-12-05 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 1.2.1
34
+ version: 1.2.2
35
35
  version:
36
36
  description: Windows functions and constants bundled via Win32::API
37
37
  email: djberg96@gmail.com
@@ -75,7 +75,7 @@ files:
75
75
  - lib/windows/network/snmp.rb
76
76
  - lib/windows/network/winsock.rb
77
77
  - lib/windows/nio.rb
78
- - lib/windows/ntfs/file.rb
78
+ - lib/windows/ntfs/winternl.rb
79
79
  - lib/windows/path.rb
80
80
  - lib/windows/pipe.rb
81
81
  - lib/windows/process.rb