windows-pr 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,18 @@
1
+ = 0.6.3 - 2-Feb-2007
2
+ * Fixed the DLL for SetLastErrorEx in the Windows::Error module.
3
+ * Fixed an unitialized constant bug in the Windows::DeviceIO module.
4
+ * Fixed a bug in the NetWkstaSetInfo() method, from the
5
+ Windows::NetworkManagement module. Thanks go to Richard (???) for the spot.
6
+ * Added more security related methods and constants to the Windows::Security
7
+ module.
8
+ * Fixed a bug in the GetComputerName method in the Windows::SystemInfo module.
9
+ Thanks go to Russell Christopher for the spot and the fix.
10
+ * Changed method prototype for GetUserName and GetUserNameEx in the
11
+ Windows::SystemInfo module.
12
+ * Added the PIPE_UNLIMITED_INSTANCES constant to the Windows::Pipe module.
13
+ * Altered the prototype for the ConvertSidToStringSid() and
14
+ ConvertStringSidToSid() methods from the Windows::Security module.
15
+
1
16
  = 0.6.2 - 21-Dec-2006
2
17
  * Added file related constants from sys/stat.h to the Windows::MSVCRT::File
3
18
  module.
data/MANIFEST CHANGED
@@ -12,6 +12,7 @@ lib/windows/device_io.rb
12
12
  lib/windows/directory.rb
13
13
  lib/windows/error.rb
14
14
  lib/windows/eventlog.rb
15
+ lib/windows/file_mapping.rb
15
16
  lib/windows/file.rb
16
17
  lib/windows/filesystem.rb
17
18
  lib/windows/handle.rb
@@ -19,15 +20,19 @@ lib/windows/library.rb
19
20
  lib/windows/limits.rb
20
21
  lib/windows/memory.rb
21
22
  lib/windows/national.rb
23
+ lib/windows/network_management.rb
22
24
  lib/windows/path.rb
25
+ lib/windows/pipe.rb
23
26
  lib/windows/process.rb
24
27
  lib/windows/registry.rb
25
28
  lib/windows/security.rb
29
+ lib/windows/service.rb
26
30
  lib/windows/shell.rb
27
31
  lib/windows/sound.rb
28
32
  lib/windows/synchronize.rb
29
33
  lib/windows/system_info.rb
30
34
  lib/windows/unicode.rb
35
+ lib/windows/volume.rb
31
36
  lib/windows/window.rb
32
37
 
33
38
  lib/windows/gdi/bitmap.rb
data/README CHANGED
@@ -135,7 +135,7 @@
135
135
  warranties of merchantability and fitness for a particular purpose.
136
136
 
137
137
  == Copyright
138
- (C) 2006, Daniel J. Berger
138
+ (C) 2006, 2007, Daniel J. Berger
139
139
  All Rights Reserved
140
140
 
141
141
  == Author
@@ -78,11 +78,11 @@ module Windows
78
78
  end
79
79
 
80
80
  def FSCTL_SET_COMPRESSION
81
- CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, 0, FILE_READ_DATA | FILE_WRITE_DATA)
81
+ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, 0, 3)
82
82
  end
83
83
 
84
84
  def FSCTL_SET_SPARSE
85
- CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, 0, FILE_SPECIAL_ACCESS)
85
+ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, 0, FILE_ANY_ACCESS)
86
86
  end
87
87
  end
88
88
  end
@@ -276,7 +276,7 @@ module Windows
276
276
  FormatMessageW = Win32API.new('kernel32', 'FormatMessageW', 'LLLLPLP', 'L')
277
277
 
278
278
  begin
279
- SetLastErrorEx = Win32API.new('kernel32', 'SetLastErrorEx', 'LL', 'V')
279
+ SetLastErrorEx = Win32API.new('user32', 'SetLastErrorEx', 'LL', 'V')
280
280
  rescue Exception
281
281
  end
282
282
 
@@ -419,7 +419,7 @@ module Windows
419
419
  NetWkstaGetInfo.call(server, level, buf) == NERR_Success
420
420
  end
421
421
 
422
- def NetWkstaSetInfo.call(server, level, buf, error)
422
+ def NetWkstaSetInfo(server, level, buf, error)
423
423
  NetWkstaSetInfo.call(server, level, buf, error) == NERR_Success
424
424
  end
425
425
 
@@ -17,6 +17,8 @@ module Windows
17
17
  PIPE_READMODE_MESSAGE = 0x00000002
18
18
  PIPE_CLIENT_END = 0x00000000
19
19
  PIPE_SERVER_END = 0x00000001
20
+
21
+ PIPE_UNLIMITED_INSTANCES = 255
20
22
 
21
23
  CallNamedPipe = Win32API.new('kernel32', 'CallNamedPipe', 'PPLPLPL', 'I')
22
24
  ConnectNamedPipe = Win32API.new('kernel32', 'ConnectNamedPipe', 'LP', 'I')
@@ -16,23 +16,39 @@ module Windows
16
16
  GENERIC_RIGHTS_CHK = 4026531840
17
17
  REST_RIGHTS_MASK = 2097151
18
18
 
19
- AddAce = Win32API.new('advapi32', 'AddAce', 'PLLLL', 'I')
20
- CopySid = Win32API.new('advapi32', 'CopySid', 'LLP', 'I')
19
+ AddAce = Win32API.new('advapi32', 'AddAce', 'PLLLL', 'I')
20
+ CopySid = Win32API.new('advapi32', 'CopySid', 'LLP', 'I')
21
+
22
+ ConvertSidToStringSid = Win32API.new('advapi32', 'ConvertSidToStringSid', 'PL', 'I')
23
+ ConvertSecurityDescriptorToStringSecurityDescriptor = Win32API.new('advapi32', 'ConvertSecurityDescriptorToStringSecurityDescriptor', 'PLLPP', 'I')
24
+ ConvertStringSecurityDescriptorToSecurityDescriptor = Win32API.new('advapi32', 'ConvertStringSecurityDescriptorToSecurityDescriptor', 'PLPP', 'I')
25
+ ConvertStringSidToSid = Win32API.new('advapi32', 'ConvertStringSidToSid', 'PL', 'I')
26
+
21
27
  GetAce = Win32API.new('advapi32', 'GetAce', 'LLP', 'I')
22
28
  GetFileSecurity = Win32API.new('advapi32', 'GetFileSecurity', 'PLPLP', 'I')
23
29
  GetLengthSid = Win32API.new('advapi32', 'GetLengthSid', 'P', 'L')
24
30
 
25
- GetSecurityDescriptorControl = Win32API.new('advapi32', 'GetSecurityDescriptorControl', 'PPP', 'I')
26
- GetSecurityDescriptorDacl = Win32API.new('advapi32', 'GetSecurityDescriptorDacl', 'PPPP', 'I')
31
+ GetSecurityDescriptorControl = Win32API.new('advapi32', 'GetSecurityDescriptorControl', 'PPP', 'I')
32
+ GetSecurityDescriptorDacl = Win32API.new('advapi32', 'GetSecurityDescriptorDacl', 'PPPP', 'I')
33
+ GetSecurityDescriptorGroup = Win32API.new('advapi32', 'GetSecurityDescriptorGroup', 'PPI', 'I')
34
+ GetSecurityDescriptorLength = Win32API.new('advapi32', 'GetSecurityDescriptorLength', 'P', 'L')
35
+ GetSecurityDescriptorOwner = Win32API.new('advapi32', 'GetSecurityDescriptorOwner', 'PPI', 'I')
36
+ GetSecurityDescriptorRMControl = Win32API.new('advapi32', 'GetSecurityDescriptorRMControl', 'PP', 'L')
37
+ GetSecurityDescriptorSacl = Win32API.new('advapi32', 'GetSecurityDescriptorSacl', 'PIPI', 'I')
27
38
 
28
39
  InitializeAcl = Win32API.new('advapi32', 'InitializeAcl', 'PLL', 'I')
29
40
  InitializeSecurityDescriptor = Win32API.new('advapi32', 'InitializeSecurityDescriptor', 'PL', 'I')
41
+ IsValidSecurityDescriptor = Win32API.new('advapi32', 'IsValidSecurityDescriptor', 'P', 'I')
30
42
 
31
43
  LookupAccountName = Win32API.new('advapi32', 'LookupAccountName', 'PPPPPPP', 'I')
32
44
  LookupAccountSid = Win32API.new('advapi32', 'LookupAccountSid', 'PLPPPPP', 'I')
33
45
 
34
- SetFileSecurity = Win32API.new('advapi32', 'SetFileSecurity', 'PPP', 'I')
35
- SetSecurityDescriptorDacl = Win32API.new('advapi32', 'SetSecurityDescriptorDacl', 'PIPI', 'I')
46
+ SetFileSecurity = Win32API.new('advapi32', 'SetFileSecurity', 'PPP', 'I')
47
+ SetSecurityDescriptorDacl = Win32API.new('advapi32', 'SetSecurityDescriptorDacl', 'PIPI', 'I')
48
+ SetSecurityDescriptorGroup = Win32API.new('advapi32', 'SetSecurityDescriptorGroup', 'PPI', 'I')
49
+ SetSecurityDescriptorOwner = Win32API.new('advapi32', 'SetSecurityDescriptorOwner', 'PPI', 'I')
50
+ SetSecurityDescriptorRMControl = Win32API.new('advapi32', 'SetSecurityDescriptorRMControl', 'PP', 'L')
51
+ SetSecurityDescriptorSacl = Win32API.new('advapi32', 'SetSecurityDescriptorSacl', 'PIPI', 'I')
36
52
 
37
53
  def AddAce(acl, rev, index, list, length)
38
54
  AddAce.call(acl, rev, index, list, length) != 0
@@ -42,6 +58,22 @@ module Windows
42
58
  CopySid.call(sid_length, sid_buf, sid_source) != 0
43
59
  end
44
60
 
61
+ def ConvertSidToStringSid(sid, buf)
62
+ ConvertSidToStringSid.call(sid, buf) != 0
63
+ end
64
+
65
+ def ConvertSecurityDescriptorToStringSecurityDescriptor(sid, revision, info, desc, desc_length)
66
+ ConvertSecurityDescriptorToStringSecurityDescriptor.call(sid, revision, info, desc, desc_length).call != 0
67
+ end
68
+
69
+ def ConvertStringSecurityDescriptorToSecurityDescriptor(sid, revision, desc, desc_length)
70
+ ConvertStringSecurityDescriptorToSecurityDescriptor.call(sid, revision, desc, desc_length) != 0
71
+ end
72
+
73
+ def ConvertStringSidToSid(string, sid)
74
+ ConvertStringSidToSid.call(string, sid) != 0
75
+ end
76
+
45
77
  def GetAce(acl, index, ace)
46
78
  GetAce.call(acl, index, ace) != 0
47
79
  end
@@ -61,6 +93,26 @@ module Windows
61
93
  def GetSecurityDescriptorDacl(descriptor, dacl_present, dacl, default)
62
94
  GetSecurityDescriptorDacl.call(descriptor, dacl_present, dacl, default) != 0
63
95
  end
96
+
97
+ def GetSecurityDescriptorGroup(descriptor, group, default)
98
+ GetSecurityDescriptorGroup.call(descriptor, group, default) != 0
99
+ end
100
+
101
+ def GetSecurityDescriptorLength(descriptor)
102
+ GetSecurityDescriptorLength.call(descriptor)
103
+ end
104
+
105
+ def GetSecurityDescriptorOwner(descriptor, owner, default)
106
+ GetSecurityDescriptorOwner.call(descriptor, owner, default) != 0
107
+ end
108
+
109
+ def GetSecurityDescriptorRMControl(descriptor, control)
110
+ GetSecurityDescriptorRMControl.call(descriptor, control)
111
+ end
112
+
113
+ def GetSecurityDescriptorSacl(descriptor, present, sacl, default)
114
+ GetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0
115
+ end
64
116
 
65
117
  def InitializeAcl(acl, length, revision = ACL_REVISION)
66
118
  InitializeAcl.call(acl, length, revision) != 0
@@ -70,6 +122,10 @@ module Windows
70
122
  InitializeSecurityDescriptor.call(descriptor, revision) != 0
71
123
  end
72
124
 
125
+ def IsValidSecurityDescriptor(descriptor)
126
+ IsValidSecurityDescriptor.call(descriptor) != 0
127
+ end
128
+
73
129
  def LookupAccountName(sys, name, sid, sid_size, domain, domain_size, use)
74
130
  LookupAccountName.call(sys, name, sid, sid_size, domain, domain_size, use) != 0
75
131
  end
@@ -85,5 +141,21 @@ module Windows
85
141
  def SetSecurityDescriptorDacl(descriptor, present, dacl, default)
86
142
  SetSecurityDescriptorDacl.call(descriptor, present, dacl, default) != 0
87
143
  end
144
+
145
+ def SetSecurityDescriptorGroup(descriptor, group, default)
146
+ SetSecurityDescriptorGroup.call(descriptor, group, default) != 0
147
+ end
148
+
149
+ def SetSecurityDescriptorOwner(descriptor, owner, default)
150
+ SetSecurityDescriptorOwner.call(descriptor, owner, default) != 0
151
+ end
152
+
153
+ def SetSecurityDescriptorRMControl(descriptor, control)
154
+ SetSecurityDescriptorRMControl.call(descriptor, control)
155
+ end
156
+
157
+ def SetSecurityDescriptorSacl(descriptor, present, sacl, default)
158
+ SetSecurityDescriptorSacl.call(descriptor, present, sacl, default) != 0
159
+ end
88
160
  end
89
161
  end
@@ -25,8 +25,8 @@ module Windows
25
25
  GetComputerName = Win32API.new('kernel32', 'GetComputerName', 'PP', 'I')
26
26
  GetComputerNameEx = Win32API.new('kernel32', 'GetComputerNameEx', 'PPP', 'I')
27
27
  GetSystemInfo = Win32API.new('kernel32', 'GetSystemInfo', 'P', 'V')
28
- GetUserName = Win32API.new('advapi32', 'GetUserName', 'LL', 'I')
29
- GetUserNameEx = Win32API.new('secur32', 'GetUserNameEx', 'LPL', 'I')
28
+ GetUserName = Win32API.new('advapi32', 'GetUserName', 'PP', 'I')
29
+ GetUserNameEx = Win32API.new('secur32', 'GetUserNameEx', 'LPP', 'I')
30
30
  GetVersion = Win32API.new('kernel32', 'GetVersion', 'V', 'L')
31
31
  GetVersionEx = Win32API.new('kernel32', 'GetVersionEx', 'P', 'I')
32
32
  GetWindowsDirectory = Win32API.new('kernel32', 'GetWindowsDirectory', 'LI', 'I')
@@ -36,7 +36,7 @@ module Windows
36
36
  end
37
37
 
38
38
  def GetComputerName(buffer, size)
39
- GetComputerNameEx.call(buffer, size) != 0
39
+ GetComputerName.call(buffer, size) != 0
40
40
  end
41
41
 
42
42
  def GetComputerNameEx(name, buffer, size)
@@ -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.6.2"
5
+ gem.version = "0.6.3"
6
6
  gem.author = "Daniel J. Berger"
7
7
  gem.email = "djberg96@gmail.com"
8
8
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.0.8
3
3
  specification_version: 1
4
4
  name: windows-pr
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.2
7
- date: 2006-12-21 00:00:00 -07:00
6
+ version: 0.6.3
7
+ date: 2007-02-02 00:00:00 -07:00
8
8
  summary: Windows functions and constants predefined via Win32API
9
9
  require_paths:
10
10
  - lib