windows-pr 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -0
- data/lib/windows/network_management.rb +59 -1
- data/lib/windows/process.rb +26 -2
- data/lib/windows/unicode.rb +6 -0
- data/windows-pr.gemspec +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
= 0.7.4 - 11-Dec-2007
|
2
|
+
* Added several more functions to Windows::Window.
|
3
|
+
* Added many more constants to the Windows::NetworkManagement module.
|
4
|
+
* Added several more functions and a few constants to the Windows::Process
|
5
|
+
module.
|
6
|
+
* The multi_to_wide and wide_to_multi methods in Windows::Unicode will now
|
7
|
+
return nil if you pass a nil argument. Also, they will raise a TypeError
|
8
|
+
if you pass a non-nil, non-string object.
|
9
|
+
|
1
10
|
= 0.7.3 - 23-Nov-2007
|
2
11
|
* Several thread related methods were moved out of the Windows::Process
|
3
12
|
module and into the Windows::Thread module.
|
@@ -11,7 +11,65 @@ module Windows
|
|
11
11
|
API.auto_method = false
|
12
12
|
API.auto_unicode = false
|
13
13
|
|
14
|
-
NERR_Success
|
14
|
+
NERR_Success = 0
|
15
|
+
NERR_BASE = 2100
|
16
|
+
NERR_NetNotStarted = NERR_BASE + 2
|
17
|
+
NERR_UnknownServer = NERR_BASE + 3
|
18
|
+
NERR_ShareMem = NERR_BASE + 4
|
19
|
+
NERR_NoNetworkResource = NERR_BASE + 5
|
20
|
+
NERR_RemoteOnly = NERR_BASE + 6
|
21
|
+
NERR_DevNotRedirected = NERR_BASE + 7
|
22
|
+
NERR_AlreadyLoggedOn = NERR_BASE + 100
|
23
|
+
NERR_NotLoggedOn = NERR_BASE + 101
|
24
|
+
NERR_BadUsername = NERR_BASE + 102
|
25
|
+
NERR_BadPassword = NERR_BASE + 103
|
26
|
+
NERR_UnableToAddName_W = NERR_BASE + 104
|
27
|
+
NERR_UnableToAddName_F = NERR_BASE + 105
|
28
|
+
NERR_UnableToDelName_W = NERR_BASE + 106
|
29
|
+
NERR_UnableToDelName_F = NERR_BASE + 107
|
30
|
+
NERR_LogonsPaused = NERR_BASE + 109
|
31
|
+
NERR_LogonServerConflict = NERR_BASE + 110
|
32
|
+
NERR_LogonNoUserPath = NERR_BASE + 111
|
33
|
+
NERR_LogonScriptError = NERR_BASE + 112
|
34
|
+
NERR_StandaloneLogon = NERR_BASE + 114
|
35
|
+
NERR_LogonServerNotFound = NERR_BASE + 115
|
36
|
+
NERR_LogonDomainExists = NERR_BASE + 116
|
37
|
+
NERR_NonValidatedLogon = NERR_BASE + 117
|
38
|
+
NERR_ACFNotFound = NERR_BASE + 119
|
39
|
+
NERR_GroupNotFound = NERR_BASE + 120
|
40
|
+
NERR_UserNotFound = NERR_BASE + 121
|
41
|
+
NERR_ResourceNotFound = NERR_BASE + 122
|
42
|
+
NERR_GroupExists = NERR_BASE + 123
|
43
|
+
NERR_UserExists = NERR_BASE + 124
|
44
|
+
NERR_ResourceExists = NERR_BASE + 125
|
45
|
+
NERR_NotPrimary = NERR_BASE + 126
|
46
|
+
NERR_ACFNotLoaded = NERR_BASE + 127
|
47
|
+
NERR_ACFNoRoom = NERR_BASE + 128
|
48
|
+
NERR_ACFFileIOFail = NERR_BASE + 129
|
49
|
+
NERR_ACFTooManyLists = NERR_BASE + 130
|
50
|
+
NERR_UserLogon = NERR_BASE + 131
|
51
|
+
NERR_ACFNoParent = NERR_BASE + 132
|
52
|
+
NERR_CanNotGrowSegment = NERR_BASE + 133
|
53
|
+
NERR_SpeGroupOp = NERR_BASE + 134
|
54
|
+
NERR_NotInCache = NERR_BASE + 135
|
55
|
+
NERR_UserInGroup = NERR_BASE + 136
|
56
|
+
NERR_UserNotInGroup = NERR_BASE + 137
|
57
|
+
NERR_AccountUndefined = NERR_BASE + 138
|
58
|
+
NERR_AccountExpired = NERR_BASE + 139
|
59
|
+
NERR_InvalidWorkstation = NERR_BASE + 140
|
60
|
+
NERR_InvalidLogonHours = NERR_BASE + 141
|
61
|
+
NERR_PasswordExpired = NERR_BASE + 142
|
62
|
+
NERR_PasswordCantChange = NERR_BASE + 143
|
63
|
+
NERR_PasswordHistConflict = NERR_BASE + 144
|
64
|
+
NERR_PasswordTooShort = NERR_BASE + 145
|
65
|
+
NERR_PasswordTooRecent = NERR_BASE + 146
|
66
|
+
NERR_InvalidDatabase = NERR_BASE + 147
|
67
|
+
NERR_DatabaseUpToDate = NERR_BASE + 148
|
68
|
+
NERR_SyncRequired = NERR_BASE + 149
|
69
|
+
NERR_UseNotFound = NERR_BASE + 150
|
70
|
+
NERR_BadAsgType = NERR_BASE + 151
|
71
|
+
NERR_DeviceIsShared = NERR_BASE + 152
|
72
|
+
|
15
73
|
MAX_PREFERRED_LENGTH = -1
|
16
74
|
|
17
75
|
# Taken from LMServer.h
|
data/lib/windows/process.rb
CHANGED
@@ -57,21 +57,45 @@ module Windows
|
|
57
57
|
STARTF_USESTDHANDLES = 0x00000100
|
58
58
|
STARTF_USEHOTKEY = 0x00000200
|
59
59
|
|
60
|
-
|
60
|
+
LOGON_WITH_PROFILE = 0x00000001
|
61
|
+
LOGON_NETCREDENTIALS_ONLY = 0x00000002
|
62
|
+
|
63
|
+
SHUTDOWN_NORETRY = 0x00000001
|
64
|
+
|
65
|
+
API.new('CreateProcess', 'PPLLLLLPPP', 'B')
|
66
|
+
API.new('CreateProcessAsUser', 'LPPLLILPPPP', 'B', 'advapi32')
|
67
|
+
API.new('CreateProcessWithLogonW', 'PPPLPPLLPPP', 'B', 'advapi32')
|
68
|
+
API.new('EnumProcesses', 'PLP', 'B', 'psapi')
|
61
69
|
API.new('ExitProcess', 'L', 'V')
|
70
|
+
API.new('FreeEnvironmentStrings', 'P', 'B')
|
62
71
|
API.new('GetCommandLine', 'V', 'P')
|
63
72
|
API.new('GetCurrentProcess', 'V', 'L')
|
64
73
|
API.new('GetCurrentProcessId', 'V', 'L')
|
65
74
|
API.new('GetEnvironmentStrings', 'V', 'L')
|
66
75
|
API.new('GetEnvironmentVariable', 'PPL', 'L')
|
67
76
|
API.new('GetExitCodeProcess', 'LP', 'B')
|
77
|
+
API.new('GetGuiResources', 'LL', 'L', 'user32')
|
68
78
|
API.new('GetPriorityClass', 'L', 'L')
|
79
|
+
API.new('GetProcessAffinityMask', 'LPP', 'B')
|
80
|
+
API.new('GetProcessIoCounters', 'LP', 'B')
|
81
|
+
API.new('GetProcessPriorityBoost', 'LP', 'B')
|
82
|
+
API.new('GetProcessShutdownParameters', 'PP', 'B')
|
69
83
|
API.new('GetProcessTimes', 'LPPPP', 'B')
|
84
|
+
API.new('GetProcessVersion', 'L', 'L')
|
85
|
+
API.new('GetProcessWorkingSetSize', 'LPP', 'B')
|
70
86
|
API.new('GetStartupInfo', 'P', 'V')
|
71
87
|
API.new('OpenProcess', 'LIL', 'L')
|
72
|
-
API.new('
|
88
|
+
API.new('Process32First', 'LP', 'B')
|
89
|
+
API.new('Process32Next', 'LP', 'B')
|
90
|
+
API.new('SetEnvironmentVariable', 'PP', 'B')
|
91
|
+
API.new('SetPriorityClass', 'LL', 'B')
|
92
|
+
API.new('SetProcessAffinityMask', 'LL', 'B')
|
93
|
+
API.new('SetProcessPriorityBoost', 'LB', 'B')
|
94
|
+
API.new('SetProcessShutdownParameters', 'LL', 'B')
|
95
|
+
API.new('SetProcessWorkingSetSize', 'LLL', 'B')
|
73
96
|
API.new('TerminateProcess', 'LL', 'B')
|
74
97
|
API.new('WaitForInputIdle', 'LL', 'L', 'user32')
|
98
|
+
API.new('WTSEnumerateProcesses', 'LLLPP', 'B', 'wtsapi32')
|
75
99
|
|
76
100
|
# Windows XP or later
|
77
101
|
begin
|
data/lib/windows/unicode.rb
CHANGED
@@ -89,6 +89,9 @@ module Windows
|
|
89
89
|
# If the function fails it simply returns the string as-is.
|
90
90
|
#
|
91
91
|
def multi_to_wide(string, encoding=nil)
|
92
|
+
return nil unless string
|
93
|
+
raise TypeError unless string.is_a?(String)
|
94
|
+
|
92
95
|
unless encoding
|
93
96
|
encoding = ($KCODE == 'UTF8') ? CP_UTF8 : CP_ACP
|
94
97
|
end
|
@@ -120,6 +123,9 @@ module Windows
|
|
120
123
|
# If the function fails it simply returns the string as-is.
|
121
124
|
#
|
122
125
|
def wide_to_multi(string, encoding=nil)
|
126
|
+
return nil unless string
|
127
|
+
raise TypeError unless string.is_a?(String)
|
128
|
+
|
123
129
|
unless encoding
|
124
130
|
encoding = ($KCODE == 'UTF8') ? CP_UTF8 : CP_ACP
|
125
131
|
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.7.
|
5
|
+
gem.version = "0.7.4"
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windows-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2007-11
|
12
|
+
date: 2007-12-11 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|