windows-pr 0.4.0-mswin32 → 0.5.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +12 -6
- data/MANIFEST +11 -0
- data/doc/conversion_guide.txt +2 -2
- data/lib/windows/clipboard.rb +0 -33
- data/lib/windows/error.rb +2 -1
- data/lib/windows/eventlog.rb +85 -0
- data/lib/windows/library.rb +5 -0
- data/lib/windows/memory.rb +1 -31
- data/lib/windows/national.rb +557 -0
- data/lib/windows/path.rb +1 -77
- data/lib/windows/process.rb +5 -0
- data/lib/windows/registry.rb +226 -0
- data/lib/windows/system_info.rb +7 -1
- data/test/tc_memory.rb +51 -0
- data/test/tc_registry.rb +36 -0
- data/test/ts_all.rb +1 -0
- metadata +7 -2
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 0.5.0 - 23-May-2006
|
2
|
+
* Added the Registry module
|
3
|
+
* Added the EventLog module
|
4
|
+
* Added the National module
|
5
|
+
* Added the SystemInfo module
|
6
|
+
|
1
7
|
= 0.4.0 - 7-May-2006
|
2
8
|
* Bug fix for the WaitForMultipleObjects method in synchronize.rb
|
3
9
|
* Added the Window module (just a few constants for now)
|
@@ -6,16 +12,16 @@
|
|
6
12
|
* Added the Directory module (CreateDirectory, etc)
|
7
13
|
* Added the Shell module (some constants, a few methods for now)
|
8
14
|
* Added the Unicode module (WideCharToMultiByte, etc)
|
9
|
-
* Added process creation, priority and startf flags to
|
15
|
+
* Added process creation, priority and startf flags to the Process module
|
10
16
|
|
11
17
|
= 0.3.0 - 22-Apr-2006
|
12
|
-
* Added the
|
13
|
-
* Added the
|
14
|
-
* Fixed a signature bug in the
|
18
|
+
* Added the Limits module.
|
19
|
+
* Added the Security module.
|
20
|
+
* Fixed a signature bug in the MSVCRT/Buffer module.
|
15
21
|
|
16
22
|
= 0.2.0 - 13-Apr-2006
|
17
|
-
* Added the
|
18
|
-
* Fixed signature and dll mistakes in the
|
23
|
+
* Added the FileSystem module.
|
24
|
+
* Fixed signature and dll mistakes in the File module.
|
19
25
|
|
20
26
|
= 0.1.0 - 4-Apr-2006
|
21
27
|
* Initial release
|
data/MANIFEST
CHANGED
@@ -7,17 +7,28 @@ windows-pr.gemspec
|
|
7
7
|
doc/conversion_guide.txt
|
8
8
|
|
9
9
|
lib/windows/clipboard.rb
|
10
|
+
lib/windows/console.rb
|
10
11
|
lib/windows/device_io.rb
|
12
|
+
lib/windows/directory.rb
|
11
13
|
lib/windows/error.rb
|
14
|
+
lib/windows/eventlog.rb
|
12
15
|
lib/windows/file.rb
|
13
16
|
lib/windows/filesystem.rb
|
14
17
|
lib/windows/handle.rb
|
18
|
+
lib/windows/library.rb
|
15
19
|
lib/windows/limits.rb
|
16
20
|
lib/windows/memory.rb
|
21
|
+
lib/windows/national.rb
|
17
22
|
lib/windows/path.rb
|
23
|
+
lib/windows/process.rb
|
24
|
+
lib/windows/registry.rb
|
18
25
|
lib/windows/security.rb
|
26
|
+
lib/windows/shell.rb
|
19
27
|
lib/windows/sound.rb
|
20
28
|
lib/windows/synchronize.rb
|
29
|
+
lib/windows/system_info.rb
|
30
|
+
lib/windows/unicode.rb
|
31
|
+
lib/windows/window.rb
|
21
32
|
|
22
33
|
lib/windows/msvcrt/buffer.rb
|
23
34
|
lib/windows/msvcrt/file.rb
|
data/doc/conversion_guide.txt
CHANGED
@@ -12,7 +12,7 @@ LPDWORD => 'P'
|
|
12
12
|
LPTSTR => 'P'
|
13
13
|
UINT => 'I'
|
14
14
|
VOID => 'V'
|
15
|
-
WORD
|
15
|
+
WORD => 'I'
|
16
16
|
|
17
17
|
= C Data Types
|
18
18
|
void => 'V'
|
@@ -20,6 +20,6 @@ void* => 'P'
|
|
20
20
|
char* => 'P'
|
21
21
|
const char* => 'L'
|
22
22
|
int => 'I'
|
23
|
-
long
|
23
|
+
long => 'L'
|
24
24
|
struct => 'P'
|
25
25
|
struct* => 'P'
|
data/lib/windows/clipboard.rb
CHANGED
@@ -1,36 +1,3 @@
|
|
1
|
-
#############################################################################
|
2
|
-
# clipboard.rb
|
3
|
-
#
|
4
|
-
# Includes the following functions:
|
5
|
-
#
|
6
|
-
# CloseClipboard()
|
7
|
-
# CoundClipboardFormats()
|
8
|
-
# EmptyClipboard()
|
9
|
-
# EnumClipboardFormats()
|
10
|
-
# GetClipboardData()
|
11
|
-
# GetClipboardFormatName()
|
12
|
-
# IsClipboardFormatAvailable()
|
13
|
-
# OpenClipboard()
|
14
|
-
# RegisterClipboardFormat()
|
15
|
-
# SetClipboardData()
|
16
|
-
#
|
17
|
-
# Defines the following constants:
|
18
|
-
#
|
19
|
-
# CF_TEXT
|
20
|
-
# CF_BITMAP
|
21
|
-
# CF_METAFILEPICT
|
22
|
-
# CF_SYLK
|
23
|
-
# CF_DIF
|
24
|
-
# CF_TIFF
|
25
|
-
# CF_OEMTEXT
|
26
|
-
# CF_DIB
|
27
|
-
# CF_PALETTE
|
28
|
-
# CF_PENDATA
|
29
|
-
# CF_RIFF
|
30
|
-
# CF_WAVE
|
31
|
-
# CF_UNICODETEXT
|
32
|
-
# CF_ENHMETAFILE
|
33
|
-
#############################################################################
|
34
1
|
require 'Win32API'
|
35
2
|
|
36
3
|
module Windows
|
data/lib/windows/error.rb
CHANGED
@@ -26,6 +26,7 @@ module Windows
|
|
26
26
|
SEM_NOOPENFILEERRORBOX = 0x8000
|
27
27
|
|
28
28
|
NO_ERROR = 0
|
29
|
+
ERROR_SUCCESS = 0
|
29
30
|
ERROR_INVALID_FUNCTION = 1
|
30
31
|
ERROR_FILE_NOT_FOUND = 2
|
31
32
|
ERROR_PATH_NOT_FOUND = 3
|
@@ -271,7 +272,7 @@ module Windows
|
|
271
272
|
SetLastError = Win32API.new('kernel32', 'GetLastError', 'L', 'V')
|
272
273
|
SetLastErrorEx = Win32API.new('kernel32', 'GetLastError', 'LL', 'V')
|
273
274
|
SetErrorMode = Win32API.new('kernel32', 'SetErrorMode', 'I', 'I')
|
274
|
-
FormatMessage = Win32API.new('kernel32', 'FormatMessage', '
|
275
|
+
FormatMessage = Win32API.new('kernel32', 'FormatMessage', 'LLLLPLP', 'L')
|
275
276
|
|
276
277
|
def GetLastError
|
277
278
|
GetLastError.call
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'Win32API'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module EventLog
|
5
|
+
EVENTLOG_SEQUENTIAL_READ = 0x0001
|
6
|
+
EVENTLOG_SEEK_READ = 0x0002
|
7
|
+
EVENTLOG_FORWARDS_READ = 0x0004
|
8
|
+
EVENTLOG_BACKWARDS_READ = 0x0008
|
9
|
+
|
10
|
+
EVENTLOG_SUCCESS = 0x0000
|
11
|
+
EVENTLOG_ERROR_TYPE = 0x0001
|
12
|
+
EVENTLOG_WARNING_TYPE = 0x0002
|
13
|
+
EVENTLOG_INFORMATION_TYPE = 0x0004
|
14
|
+
EVENTLOG_AUDIT_SUCCESS = 0x0008
|
15
|
+
EVENTLOG_AUDIT_FAILURE = 0x0010
|
16
|
+
|
17
|
+
EVENTLOG_FULL_INFO = 0
|
18
|
+
|
19
|
+
BackupEventLog = Win32API.new('advapi32', 'BackupEventLog', 'LP', 'I')
|
20
|
+
ClearEventLog = Win32API.new('advapi32', 'ClearEventLog', 'LP', 'I')
|
21
|
+
CloseEventLog = Win32API.new('advapi32', 'CloseEventLog', 'L', 'I')
|
22
|
+
DeregisterEventSource = Win32API.new('advapi32', 'DeregisterEventSource', 'L', 'I')
|
23
|
+
GetEventLogInformation = Win32API.new('advapi32', 'GetEventLogInformation', 'LLPLP', 'I')
|
24
|
+
GetNumberOfEventLogRecords = Win32API.new('advapi32', 'GetNumberOfEventLogRecords', 'LP', 'I')
|
25
|
+
GetOldestEventLogRecord = Win32API.new('advapi32', 'GetOldestEventLogRecord', 'LP', 'I')
|
26
|
+
NotifyChangeEventLog = Win32API.new('advapi32', 'NotifyChangeEventLog', 'LL', 'I')
|
27
|
+
OpenBackupEventLog = Win32API.new('advapi32', 'OpenBackupEventLog', 'PP', 'L')
|
28
|
+
OpenEventLog = Win32API.new('advapi32', 'OpenEventLog', 'PP', 'L')
|
29
|
+
ReadEventLog = Win32API.new('advapi32', 'ReadEventLog', 'LLLPLPP', 'I')
|
30
|
+
RegisterEventSource = Win32API.new('advapi32', 'RegisterEventSource', 'PP', 'L')
|
31
|
+
ReportEvent = Win32API.new('advapi32', 'ReportEvent', 'LIILPILPP', 'I')
|
32
|
+
|
33
|
+
def BackupEventLog(handle, file)
|
34
|
+
BackupEventLog.call(handle, file) != 0
|
35
|
+
end
|
36
|
+
|
37
|
+
def ClearEventLog(handle, file = 0)
|
38
|
+
ClearEventLog.call(handle, file) != 0
|
39
|
+
end
|
40
|
+
|
41
|
+
def CloseEventLog(handle)
|
42
|
+
CloseEventLog.call(handle) != 0
|
43
|
+
end
|
44
|
+
|
45
|
+
def DeregisterEventSource(handle)
|
46
|
+
DeregisterEventSource.call(handle) != 0
|
47
|
+
end
|
48
|
+
|
49
|
+
def GetEventLogInformation(handle, level, buf, buf_size, bytes)
|
50
|
+
GetEventLogInformation.call(handle, level, buf, buf_size, bytes) != 0
|
51
|
+
end
|
52
|
+
|
53
|
+
def GetNumberOfEventLogRecords(handle, num)
|
54
|
+
GetNumberOfEventLogRecords.call(handle, num) != 0
|
55
|
+
end
|
56
|
+
|
57
|
+
def GetOldestEventLogRecord(handle, rec)
|
58
|
+
GetOldestEventLogRecord.call(handle, rec) != 0
|
59
|
+
end
|
60
|
+
|
61
|
+
def NotifyChangeEventLog(handle, event)
|
62
|
+
NotifyChangeEventLog.call(handle, event) != 0
|
63
|
+
end
|
64
|
+
|
65
|
+
def OpenBackupEventLog(server, file)
|
66
|
+
OpenBackupEventLog.call(server, file)
|
67
|
+
end
|
68
|
+
|
69
|
+
def OpenEventLog(server, source)
|
70
|
+
OpenEventLog.call(server, source)
|
71
|
+
end
|
72
|
+
|
73
|
+
def ReadEventLog(handle, flags, offset, buf, bytes, bytes_read, min_bytes)
|
74
|
+
ReadEventLog.call(handle, flags, offset, buf, bytes, bytes_read, min_bytes) != 0
|
75
|
+
end
|
76
|
+
|
77
|
+
def RegisterEventSource(server, source)
|
78
|
+
RegisterEventSource.call(server, source)
|
79
|
+
end
|
80
|
+
|
81
|
+
def ReportEvent(handle, type, cat, id, sid, num, size, strings, raw)
|
82
|
+
ReportEvent.call(handle, type, cat, id, sid, num, size, strings, raw) != 0
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/windows/library.rb
CHANGED
@@ -11,6 +11,11 @@ module Windows
|
|
11
11
|
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 2
|
12
12
|
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 4
|
13
13
|
|
14
|
+
DONT_RESOLVE_DLL_REFERENCES = 0x00000001
|
15
|
+
LOAD_LIBRARY_AS_DATAFILE = 0x00000002
|
16
|
+
LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008
|
17
|
+
LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010
|
18
|
+
|
14
19
|
DisableThreadLibraryCalls = Win32API.new('kernel32', 'DisableThreadLibraryCalls', 'L', 'I')
|
15
20
|
FreeLibrary = Win32API.new('kernel32', 'FreeLibrary', 'L', 'I')
|
16
21
|
FreeLibraryAndExitThread = Win32API.new('kernel32', 'FreeLibraryAndExitThread', 'LL', 'V')
|
data/lib/windows/memory.rb
CHANGED
@@ -1,28 +1,3 @@
|
|
1
|
-
######################################################################
|
2
|
-
# memory.rb
|
3
|
-
#
|
4
|
-
# Includes the following functions:
|
5
|
-
#
|
6
|
-
# GlobalAlloc()
|
7
|
-
# GlobalDiscard()
|
8
|
-
# GlobalFlags()
|
9
|
-
# GlobalFree()
|
10
|
-
# GlobalHandle()
|
11
|
-
# GlobalLock()
|
12
|
-
# GlobalMemoryStatus()
|
13
|
-
# GlobalMemoryStatusEx()
|
14
|
-
# GlobalReAlloc()
|
15
|
-
# GlobalSize()
|
16
|
-
# GlobalUnlock()
|
17
|
-
#
|
18
|
-
# Defines the following constants:
|
19
|
-
#
|
20
|
-
# GHND
|
21
|
-
# GMEM_FIXED
|
22
|
-
# GMEM_MOVABLE
|
23
|
-
# GMEM_ZEROINIT
|
24
|
-
# GPTR
|
25
|
-
######################################################################
|
26
1
|
require 'Win32API'
|
27
2
|
|
28
3
|
module Windows
|
@@ -34,11 +9,10 @@ module Windows
|
|
34
9
|
GPTR = 0x0040
|
35
10
|
|
36
11
|
GlobalAlloc = Win32API.new('kernel32', 'GlobalAlloc', 'II', 'I')
|
37
|
-
GlobalDiscard = Win32API.new('kernel32', 'GlobalDiscard', 'I', 'I')
|
38
12
|
GlobalFlags = Win32API.new('kernel32', 'GlobalFlags', 'I', 'I')
|
39
13
|
GlobalFree = Win32API.new('kernel32', 'GlobalFree', 'I', 'I')
|
40
14
|
GlobalHandle = Win32API.new('kernel32', 'GlobalHandle', 'P', 'I')
|
41
|
-
GlobalLock = Win32API.new('kernel32', 'GlobalLock', '
|
15
|
+
GlobalLock = Win32API.new('kernel32', 'GlobalLock', 'L', 'L')
|
42
16
|
GlobalMemoryStatus = Win32API.new('kernel32', 'GlobalMemoryStatus', 'P', 'V')
|
43
17
|
GlobalMemoryStatusEx = Win32API.new('kernel32', 'GlobalMemoryStatus', 'P', 'V')
|
44
18
|
GlobalReAlloc = Win32API.new('kernel32', 'GlobalReAlloc', 'III', 'I')
|
@@ -49,10 +23,6 @@ module Windows
|
|
49
23
|
GlobalAlloc.call(flags, bytes)
|
50
24
|
end
|
51
25
|
|
52
|
-
def GlobalDiscard(handle)
|
53
|
-
GlobalDiscard.call(handle)
|
54
|
-
end
|
55
|
-
|
56
26
|
def GlobalFlags(handle)
|
57
27
|
GlobalFlags.call(handle)
|
58
28
|
end
|
@@ -0,0 +1,557 @@
|
|
1
|
+
require 'Win32API'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module National
|
5
|
+
# Code page identifiers. Used for get_acp_string method.
|
6
|
+
CODE_PAGE = {
|
7
|
+
037 => 'IBM EBCDIC = U.S./Canada',
|
8
|
+
437 => 'OEM = United States',
|
9
|
+
500 => 'IBM EBCDIC - International',
|
10
|
+
708 => 'Arabic - ASMO 708',
|
11
|
+
709 => 'Arabic - ASMO 449+, BCON V4',
|
12
|
+
710 => 'Arabic - Transparent Arabic',
|
13
|
+
720 => 'Arabic - Transparent ASMO',
|
14
|
+
737 => 'OEM - Greek (formerly 437G)',
|
15
|
+
775 => 'OEM - Baltic',
|
16
|
+
850 => 'OEM - Multilingual Latin I',
|
17
|
+
852 => 'OEM - Latin II',
|
18
|
+
855 => 'OEM - Cyrillic (primarily Russian)',
|
19
|
+
857 => 'OEM - Turkish',
|
20
|
+
858 => 'OEM - Multilingual Latin I + Euro symbol',
|
21
|
+
860 => 'OEM - Portuguese',
|
22
|
+
861 => 'OEM - Icelandic',
|
23
|
+
862 => 'OEM - Hebrew',
|
24
|
+
863 => 'OEM - Canadian-French',
|
25
|
+
864 => 'OEM - Arabic',
|
26
|
+
865 => 'OEM - Nordic',
|
27
|
+
866 => 'OEM - Russian',
|
28
|
+
869 => 'OEM - Modern Greek',
|
29
|
+
870 => 'IBM EBCDIC - Multilingual/ROECE (Latin-2)',
|
30
|
+
874 => 'ANSI/OEM - Thai (same as 28605, ISO 8859-15)',
|
31
|
+
875 => 'IBM EBCDIC - Modern Greek',
|
32
|
+
932 => 'ANSI/OEM - Japanese, Shift-JIS',
|
33
|
+
936 => 'ANSI/OEM - Simplified Chinese (PRC, Singapore)',
|
34
|
+
949 => 'ANSI/OEM - Korean (Unified Hangul Code)',
|
35
|
+
950 => 'ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC)',
|
36
|
+
1026 => 'IBM EBCDIC - Turkish (Latin-5)',
|
37
|
+
1047 => 'IBM EBCDIC - Latin 1/Open System',
|
38
|
+
1140 => 'IBM EBCDIC - U.S./Canada (037 + Euro symbol)',
|
39
|
+
1141 => 'IBM EBCDIC - Germany (20273 + Euro symbol)',
|
40
|
+
1142 => 'IBM EBCDIC - Denmark/Norway (20277 + Euro symbol)',
|
41
|
+
1143 => 'IBM EBCDIC - Finland/Sweden (20278 + Euro symbol)',
|
42
|
+
1144 => 'IBM EBCDIC - Italy (20280 + Euro symbol)',
|
43
|
+
1145 => 'IBM EBCDIC - Latin America/Spain (20284 + Euro symbol)',
|
44
|
+
1146 => 'IBM EBCDIC - United Kingdom (20285 + Euro symbol)',
|
45
|
+
1147 => 'IBM EBCDIC - France (20297 + Euro symbol)',
|
46
|
+
1148 => 'IBM EBCDIC - International (500 + Euro symbol)',
|
47
|
+
1149 => 'IBM EBCDIC - Icelandic (20871 + Euro symbol)',
|
48
|
+
1200 => 'Unicode UCS-2 Little-Endian (BMP of ISO 10646)',
|
49
|
+
1201 => 'Unicode UCS-2 Big-Endian',
|
50
|
+
1250 => 'ANSI - Central European',
|
51
|
+
1251 => 'ANSI - Cyrillic',
|
52
|
+
1252 => 'ANSI - Latin I',
|
53
|
+
1253 => 'ANSI - Greek',
|
54
|
+
1254 => 'ANSI - Turkish',
|
55
|
+
1255 => 'ANSI - Hebrew',
|
56
|
+
1256 => 'ANSI - Arabic',
|
57
|
+
1257 => 'ANSI - Baltic',
|
58
|
+
1258 => 'ANSI/OEM - Vietnamese',
|
59
|
+
1361 => 'Korean (Johab)',
|
60
|
+
10000 => 'MAC - Roman',
|
61
|
+
10001 => 'MAC - Japanese',
|
62
|
+
10002 => 'MAC - Traditional Chinese (Big5)',
|
63
|
+
10003 => 'MAC - Korean',
|
64
|
+
10004 => 'MAC - Arabic',
|
65
|
+
10005 => 'MAC - Hebrew',
|
66
|
+
10006 => 'MAC - Greek I',
|
67
|
+
10007 => 'MAC - Cyrillic',
|
68
|
+
10008 => 'MAC - Simplified Chinese (GB 2312)',
|
69
|
+
10010 => 'MAC - Romania',
|
70
|
+
10017 => 'MAC - Ukraine',
|
71
|
+
10021 => 'MAC - Thai',
|
72
|
+
10029 => 'MAC - Latin II',
|
73
|
+
10079 => 'MAC - Icelandic',
|
74
|
+
10081 => 'MAC - Turkish',
|
75
|
+
10082 => 'MAC - Croatia',
|
76
|
+
12000 => 'Unicode UCS-4 Little-Endian',
|
77
|
+
12001 => 'Unicode UCS-4 Big-Endian',
|
78
|
+
20000 => 'CNS - Taiwan',
|
79
|
+
20001 => 'TCA - Taiwan',
|
80
|
+
20002 => 'Eten - Taiwan',
|
81
|
+
20003 => 'IBM5550 - Taiwan',
|
82
|
+
20004 => 'TeleText - Taiwan',
|
83
|
+
20005 => 'Wang - Taiwan',
|
84
|
+
20105 => 'IA5 IRV International Alphabet No. 5 (7-bit)',
|
85
|
+
20106 => 'IA5 German (7-bit)',
|
86
|
+
20107 => 'IA5 Swedish (7-bit)',
|
87
|
+
20108 => 'IA5 Norwegian (7-bit)',
|
88
|
+
20127 => 'US-ASCII (7-bit)',
|
89
|
+
20261 => 'T.61',
|
90
|
+
20269 => 'ISO 6937 Non-Spacing Accent',
|
91
|
+
20273 => 'IBM EBCDIC - Germany',
|
92
|
+
20277 => 'IBM EBCDIC - Denmark/Norway',
|
93
|
+
20278 => 'IBM EBCDIC - Finland/Sweden',
|
94
|
+
20280 => 'IBM EBCDIC - Italy',
|
95
|
+
20284 => 'IBM EBCDIC - Latin America/Spain',
|
96
|
+
20285 => 'IBM EBCDIC - United Kingdom',
|
97
|
+
20290 => 'IBM EBCDIC - Japanese Katakana Extended',
|
98
|
+
20297 => 'IBM EBCDIC - France',
|
99
|
+
20420 => 'IBM EBCDIC - Arabic',
|
100
|
+
20423 => 'IBM EBCDIC - Greek',
|
101
|
+
20424 => 'IBM EBCDIC - Hebrew',
|
102
|
+
20833 => 'IBM EBCDIC - Korean Extended',
|
103
|
+
20838 => 'IBM EBCDIC - Thai',
|
104
|
+
20866 => 'Russian - KOI8-R',
|
105
|
+
20871 => 'IBM EBCDIC - Icelandic',
|
106
|
+
20880 => 'IBM EBCDIC - Cyrillic (Russian)',
|
107
|
+
20905 => 'IBM EBCDIC - Turkish',
|
108
|
+
20924 => 'IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol)',
|
109
|
+
20932 => 'JIS X 0208-1990 & 0121-1990',
|
110
|
+
20936 => 'Simplified Chinese (GB2312)',
|
111
|
+
21025 => 'IBM EBCDIC - Cyrillic (Serbian, Bulgarian)',
|
112
|
+
21027 => '(deprecated)',
|
113
|
+
21866 => 'Ukrainian (KOI8-U)',
|
114
|
+
28591 => 'ISO 8859-1 Latin I',
|
115
|
+
28592 => 'ISO 8859-2 Central Europe',
|
116
|
+
28593 => 'ISO 8859-3 Latin 3',
|
117
|
+
28594 => 'ISO 8859-4 Baltic',
|
118
|
+
28595 => 'ISO 8859-5 Cyrillic',
|
119
|
+
28596 => 'ISO 8859-6 Arabic',
|
120
|
+
28597 => 'ISO 8859-7 Greek',
|
121
|
+
28598 => 'ISO 8859-8 Hebrew',
|
122
|
+
28599 => 'ISO 8859-9 Latin 5',
|
123
|
+
28605 => 'ISO 8859-15 Latin 9',
|
124
|
+
29001 => 'Europa 3',
|
125
|
+
38598 => 'ISO 8859-8 Hebrew',
|
126
|
+
50220 => 'ISO 2022 Japanese with no halfwidth Katakana',
|
127
|
+
50221 => 'ISO 2022 Japanese with halfwidth Katakana',
|
128
|
+
50222 => 'ISO 2022 Japanese JIS X 0201-1989',
|
129
|
+
50225 => 'ISO 2022 Korean',
|
130
|
+
50227 => 'ISO 2022 Simplified Chinese',
|
131
|
+
50229 => 'ISO 2022 Traditional Chinese',
|
132
|
+
50930 => 'Japanese (Katakana) Extended',
|
133
|
+
50931 => 'US/Canada and Japanese',
|
134
|
+
50933 => 'Korean Extended and Korean',
|
135
|
+
50935 => 'Simplified Chinese Extended and Simplified Chinese',
|
136
|
+
50936 => 'Simplified Chinese',
|
137
|
+
50937 => 'US/Canada and Traditional Chinese',
|
138
|
+
50939 => 'Japanese (Latin) Extended and Japanese',
|
139
|
+
51932 => 'EUC - Japanese',
|
140
|
+
51936 => 'EUC - Simplified Chinese',
|
141
|
+
51949 => 'EUC - Korean',
|
142
|
+
51950 => 'EUC - Traditional Chinese',
|
143
|
+
52936 => 'HZ-GB2312 Simplified Chinese',
|
144
|
+
54936 => 'Windows XP: GB18030 Simplified Chinese (4 Byte)',
|
145
|
+
57002 => 'ISCII Devanagari',
|
146
|
+
57003 => 'ISCII Bengali',
|
147
|
+
57004 => 'ISCII Tamil',
|
148
|
+
57005 => 'ISCII Telugu',
|
149
|
+
57006 => 'ISCII Assamese',
|
150
|
+
57007 => 'ISCII Oriya',
|
151
|
+
57008 => 'ISCII Kannada',
|
152
|
+
57009 => 'ISCII Malayalam',
|
153
|
+
57010 => 'ISCII Gujarati',
|
154
|
+
57011 => 'ISCII Punjabi',
|
155
|
+
65000 => 'Unicode UTF-7',
|
156
|
+
65001 => 'Unicode UTF-8'
|
157
|
+
}
|
158
|
+
|
159
|
+
LANG_NEUTRAL = 0x00
|
160
|
+
LANG_INVARIANT = 0x7f
|
161
|
+
|
162
|
+
LANG_AFRIKAANS = 0x36
|
163
|
+
LANG_ALBANIAN = 0x1c
|
164
|
+
LANG_ARABIC = 0x01
|
165
|
+
LANG_ARMENIAN = 0x2b
|
166
|
+
LANG_ASSAMESE = 0x4d
|
167
|
+
LANG_AZERI = 0x2c
|
168
|
+
LANG_BASQUE = 0x2d
|
169
|
+
LANG_BELARUSIAN = 0x23
|
170
|
+
LANG_BENGALI = 0x45
|
171
|
+
LANG_BOSNIAN = 0x1a
|
172
|
+
LANG_BULGARIAN = 0x02
|
173
|
+
LANG_CATALAN = 0x03
|
174
|
+
LANG_CHINESE = 0x04
|
175
|
+
LANG_CROATIAN = 0x1a
|
176
|
+
LANG_CZECH = 0x05
|
177
|
+
LANG_DANISH = 0x06
|
178
|
+
LANG_DIVEHI = 0x65
|
179
|
+
LANG_DUTCH = 0x13
|
180
|
+
LANG_ENGLISH = 0x09
|
181
|
+
LANG_ESTONIAN = 0x25
|
182
|
+
LANG_FAEROESE = 0x38
|
183
|
+
LANG_FARSI = 0x29
|
184
|
+
LANG_FINNISH = 0x0b
|
185
|
+
LANG_FRENCH = 0x0c
|
186
|
+
LANG_GALICIAN = 0x56
|
187
|
+
LANG_GEORGIAN = 0x37
|
188
|
+
LANG_GERMAN = 0x07
|
189
|
+
LANG_GREEK = 0x08
|
190
|
+
LANG_GUJARATI = 0x47
|
191
|
+
LANG_HEBREW = 0x0d
|
192
|
+
LANG_HINDI = 0x39
|
193
|
+
LANG_HUNGARIAN = 0x0e
|
194
|
+
LANG_ICELANDIC = 0x0f
|
195
|
+
LANG_INDONESIAN = 0x21
|
196
|
+
LANG_ITALIAN = 0x10
|
197
|
+
LANG_JAPANESE = 0x11
|
198
|
+
LANG_KANNADA = 0x4b
|
199
|
+
LANG_KASHMIRI = 0x60
|
200
|
+
LANG_KAZAK = 0x3f
|
201
|
+
LANG_KONKANI = 0x57
|
202
|
+
LANG_KOREAN = 0x12
|
203
|
+
LANG_KYRGYZ = 0x40
|
204
|
+
LANG_LATVIAN = 0x26
|
205
|
+
LANG_LITHUANIAN = 0x27
|
206
|
+
LANG_MACEDONIAN = 0x2f
|
207
|
+
LANG_MALAY = 0x3e
|
208
|
+
LANG_MALAYALAM = 0x4c
|
209
|
+
LANG_MALTESE = 0x3a
|
210
|
+
LANG_MANIPURI = 0x58
|
211
|
+
LANG_MAORI = 0x81
|
212
|
+
LANG_MARATHI = 0x4e
|
213
|
+
LANG_MONGOLIAN = 0x50
|
214
|
+
LANG_NEPALI = 0x61
|
215
|
+
LANG_NORWEGIAN = 0x14
|
216
|
+
LANG_ORIYA = 0x48
|
217
|
+
LANG_POLISH = 0x15
|
218
|
+
LANG_PORTUGUESE = 0x16
|
219
|
+
LANG_PUNJABI = 0x46
|
220
|
+
LANG_QUECHUA = 0x6b
|
221
|
+
LANG_ROMANIAN = 0x18
|
222
|
+
LANG_RUSSIAN = 0x19
|
223
|
+
LANG_SAMI = 0x3b
|
224
|
+
LANG_SANSKRIT = 0x4f
|
225
|
+
LANG_SERBIAN = 0x1a
|
226
|
+
LANG_SINDHI = 0x59
|
227
|
+
LANG_SLOVAK = 0x1b
|
228
|
+
LANG_SLOVENIAN = 0x24
|
229
|
+
LANG_SOTHO = 0x6c
|
230
|
+
LANG_SPANISH = 0x0a
|
231
|
+
LANG_SWAHILI = 0x41
|
232
|
+
LANG_SWEDISH = 0x1d
|
233
|
+
LANG_SYRIAC = 0x5a
|
234
|
+
LANG_TAMIL = 0x49
|
235
|
+
LANG_TATAR = 0x44
|
236
|
+
LANG_TELUGU = 0x4a
|
237
|
+
LANG_THAI = 0x1e
|
238
|
+
LANG_TSWANA = 0x32
|
239
|
+
LANG_TURKISH = 0x1f
|
240
|
+
LANG_UKRAINIAN = 0x22
|
241
|
+
LANG_URDU = 0x20
|
242
|
+
LANG_UZBEK = 0x43
|
243
|
+
LANG_VIETNAMESE = 0x2a
|
244
|
+
LANG_WELSH = 0x52
|
245
|
+
LANG_XHOSA = 0x34
|
246
|
+
LANG_ZULU = 0x35
|
247
|
+
|
248
|
+
SUBLANG_NEUTRAL = 0x00 # language neutral
|
249
|
+
SUBLANG_DEFAULT = 0x01 # user default
|
250
|
+
SUBLANG_SYS_DEFAULT = 0x02 # system default
|
251
|
+
|
252
|
+
SUBLANG_ARABIC_SAUDI_ARABIA = 0x01 # Arabic (Saudi Arabia)
|
253
|
+
SUBLANG_ARABIC_IRAQ = 0x02 # Arabic (Iraq)
|
254
|
+
SUBLANG_ARABIC_EGYPT = 0x03 # Arabic (Egypt)
|
255
|
+
SUBLANG_ARABIC_LIBYA = 0x04 # Arabic (Libya)
|
256
|
+
SUBLANG_ARABIC_ALGERIA = 0x05 # Arabic (Algeria)
|
257
|
+
SUBLANG_ARABIC_MOROCCO = 0x06 # Arabic (Morocco)
|
258
|
+
SUBLANG_ARABIC_TUNISIA = 0x07 # Arabic (Tunisia)
|
259
|
+
SUBLANG_ARABIC_OMAN = 0x08 # Arabic (Oman)
|
260
|
+
SUBLANG_ARABIC_YEMEN = 0x09 # Arabic (Yemen)
|
261
|
+
SUBLANG_ARABIC_SYRIA = 0x0a # Arabic (Syria)
|
262
|
+
SUBLANG_ARABIC_JORDAN = 0x0b # Arabic (Jordan)
|
263
|
+
SUBLANG_ARABIC_LEBANON = 0x0c # Arabic (Lebanon)
|
264
|
+
SUBLANG_ARABIC_KUWAIT = 0x0d # Arabic (Kuwait)
|
265
|
+
SUBLANG_ARABIC_UAE = 0x0e # Arabic (U.A.E)
|
266
|
+
SUBLANG_ARABIC_BAHRAIN = 0x0f # Arabic (Bahrain)
|
267
|
+
SUBLANG_ARABIC_QATAR = 0x10 # Arabic (Qatar)
|
268
|
+
SUBLANG_AZERI_LATIN = 0x01 # Azeri (Latin)
|
269
|
+
SUBLANG_AZERI_CYRILLIC = 0x02 # Azeri (Cyrillic)
|
270
|
+
SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN = 0x05 # Bosnian (Bosnia and Herzegovina - Latin)
|
271
|
+
SUBLANG_CHINESE_TRADITIONAL = 0x01 # Chinese (Taiwan)
|
272
|
+
SUBLANG_CHINESE_SIMPLIFIED = 0x02 # Chinese (PR China)
|
273
|
+
SUBLANG_CHINESE_HONGKONG = 0x03 # Chinese (Hong Kong S.A.R., P.R.C.)
|
274
|
+
SUBLANG_CHINESE_SINGAPORE = 0x04 # Chinese (Singapore)
|
275
|
+
SUBLANG_CHINESE_MACAU = 0x05 # Chinese (Macau S.A.R.)
|
276
|
+
SUBLANG_CROATIAN_CROATIA = 0x01 # Croatian (Croatia)
|
277
|
+
SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN = 0x04 # Croatian (Bosnia and Herzegovina - Latin)
|
278
|
+
SUBLANG_DUTCH = 0x01 # Dutch
|
279
|
+
SUBLANG_DUTCH_BELGIAN = 0x02 # Dutch (Belgian)
|
280
|
+
SUBLANG_ENGLISH_US = 0x01 # English (USA)
|
281
|
+
SUBLANG_ENGLISH_UK = 0x02 # English (UK)
|
282
|
+
SUBLANG_ENGLISH_AUS = 0x03 # English (Australian)
|
283
|
+
SUBLANG_ENGLISH_CAN = 0x04 # English (Canadian)
|
284
|
+
SUBLANG_ENGLISH_NZ = 0x05 # English (New Zealand)
|
285
|
+
SUBLANG_ENGLISH_EIRE = 0x06 # English (Irish)
|
286
|
+
SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07 # English (South Africa)
|
287
|
+
SUBLANG_ENGLISH_JAMAICA = 0x08 # English (Jamaica)
|
288
|
+
SUBLANG_ENGLISH_CARIBBEAN = 0x09 # English (Caribbean)
|
289
|
+
SUBLANG_ENGLISH_BELIZE = 0x0a # English (Belize)
|
290
|
+
SUBLANG_ENGLISH_TRINIDAD = 0x0b # English (Trinidad)
|
291
|
+
SUBLANG_ENGLISH_ZIMBABWE = 0x0c # English (Zimbabwe)
|
292
|
+
SUBLANG_ENGLISH_PHILIPPINES = 0x0d # English (Philippines)
|
293
|
+
SUBLANG_FRENCH = 0x01 # French
|
294
|
+
SUBLANG_FRENCH_BELGIAN = 0x02 # French (Belgian)
|
295
|
+
SUBLANG_FRENCH_CANADIAN = 0x03 # French (Canadian)
|
296
|
+
SUBLANG_FRENCH_SWISS = 0x04 # French (Swiss)
|
297
|
+
SUBLANG_FRENCH_LUXEMBOURG = 0x05 # French (Luxembourg)
|
298
|
+
SUBLANG_FRENCH_MONACO = 0x06 # French (Monaco)
|
299
|
+
SUBLANG_GERMAN = 0x01 # German
|
300
|
+
SUBLANG_GERMAN_SWISS = 0x02 # German (Swiss)
|
301
|
+
SUBLANG_GERMAN_AUSTRIAN = 0x03 # German (Austrian)
|
302
|
+
SUBLANG_GERMAN_LUXEMBOURG = 0x04 # German (Luxembourg)
|
303
|
+
SUBLANG_GERMAN_LIECHTENSTEIN = 0x05 # German (Liechtenstein)
|
304
|
+
SUBLANG_ITALIAN = 0x01 # Italian
|
305
|
+
SUBLANG_ITALIAN_SWISS = 0x02 # Italian (Swiss)
|
306
|
+
SUBLANG_KASHMIRI_SASIA = 0x02 # Kashmiri (South Asia)
|
307
|
+
SUBLANG_KASHMIRI_INDIA = 0x02 # For app compatibility only
|
308
|
+
SUBLANG_KOREAN = 0x01 # Korean (Extended Wansung)
|
309
|
+
SUBLANG_LITHUANIAN = 0x01 # Lithuanian
|
310
|
+
SUBLANG_MALAY_MALAYSIA = 0x01 # Malay (Malaysia)
|
311
|
+
SUBLANG_MALAY_BRUNEI_DARUSSALAM = 0x02 # Malay (Brunei Darussalam)
|
312
|
+
SUBLANG_NEPALI_INDIA = 0x02 # Nepali (India)
|
313
|
+
SUBLANG_NORWEGIAN_BOKMAL = 0x01 # Norwegian (Bokmal)
|
314
|
+
SUBLANG_NORWEGIAN_NYNORSK = 0x02 # Norwegian (Nynorsk)
|
315
|
+
SUBLANG_PORTUGUESE = 0x02 # Portuguese
|
316
|
+
SUBLANG_PORTUGUESE_BRAZILIAN = 0x01 # Portuguese (Brazilian)
|
317
|
+
SUBLANG_QUECHUA_BOLIVIA = 0x01 # Quechua (Bolivia)
|
318
|
+
SUBLANG_QUECHUA_ECUADOR = 0x02 # Quechua (Ecuador)
|
319
|
+
SUBLANG_QUECHUA_PERU = 0x03 # Quechua (Peru)
|
320
|
+
SUBLANG_SAMI_NORTHERN_NORWAY = 0x01 # Northern Sami (Norway)
|
321
|
+
SUBLANG_SAMI_NORTHERN_SWEDEN = 0x02 # Northern Sami (Sweden)
|
322
|
+
SUBLANG_SAMI_NORTHERN_FINLAND = 0x03 # Northern Sami (Finland)
|
323
|
+
SUBLANG_SAMI_LULE_NORWAY = 0x04 # Lule Sami (Norway)
|
324
|
+
SUBLANG_SAMI_LULE_SWEDEN = 0x05 # Lule Sami (Sweden)
|
325
|
+
SUBLANG_SAMI_SOUTHERN_NORWAY = 0x06 # Southern Sami (Norway)
|
326
|
+
SUBLANG_SAMI_SOUTHERN_SWEDEN = 0x07 # Southern Sami (Sweden)
|
327
|
+
SUBLANG_SAMI_SKOLT_FINLAND = 0x08 # Skolt Sami (Finland)
|
328
|
+
SUBLANG_SAMI_INARI_FINLAND = 0x09 # Inari Sami (Finland)
|
329
|
+
SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN = 0x06 # Serbian (Bosnia and Herzegovina - Latin)
|
330
|
+
SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC = 0x07 # Serbian (Bosnia and Herzegovina - Cyrillic)
|
331
|
+
SUBLANG_SERBIAN_LATIN = 0x02 # Serbian (Latin)
|
332
|
+
SUBLANG_SERBIAN_CYRILLIC = 0x03 # Serbian (Cyrillic)
|
333
|
+
SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA = 0x01 # Northern Sotho (South Africa)
|
334
|
+
SUBLANG_SPANISH = 0x01 # Spanish (Castilian)
|
335
|
+
SUBLANG_SPANISH_MEXICAN = 0x02 # Spanish (Mexican)
|
336
|
+
SUBLANG_SPANISH_MODERN = 0x03 # Spanish (Modern)
|
337
|
+
SUBLANG_SPANISH_GUATEMALA = 0x04 # Spanish (Guatemala)
|
338
|
+
SUBLANG_SPANISH_COSTA_RICA = 0x05 # Spanish (Costa Rica)
|
339
|
+
SUBLANG_SPANISH_PANAMA = 0x06 # Spanish (Panama)
|
340
|
+
SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07 # Spanish (Dominican Republic)
|
341
|
+
SUBLANG_SPANISH_VENEZUELA = 0x08 # Spanish (Venezuela)
|
342
|
+
SUBLANG_SPANISH_COLOMBIA = 0x09 # Spanish (Colombia)
|
343
|
+
SUBLANG_SPANISH_PERU = 0x0a # Spanish (Peru)
|
344
|
+
SUBLANG_SPANISH_ARGENTINA = 0x0b # Spanish (Argentina)
|
345
|
+
SUBLANG_SPANISH_ECUADOR = 0x0c # Spanish (Ecuador)
|
346
|
+
SUBLANG_SPANISH_CHILE = 0x0d # Spanish (Chile)
|
347
|
+
SUBLANG_SPANISH_URUGUAY = 0x0e # Spanish (Uruguay)
|
348
|
+
SUBLANG_SPANISH_PARAGUAY = 0x0f # Spanish (Paraguay)
|
349
|
+
SUBLANG_SPANISH_BOLIVIA = 0x10 # Spanish (Bolivia)
|
350
|
+
SUBLANG_SPANISH_EL_SALVADOR = 0x11 # Spanish (El Salvador)
|
351
|
+
SUBLANG_SPANISH_HONDURAS = 0x12 # Spanish (Honduras)
|
352
|
+
SUBLANG_SPANISH_NICARAGUA = 0x13 # Spanish (Nicaragua)
|
353
|
+
SUBLANG_SPANISH_PUERTO_RICO = 0x14 # Spanish (Puerto Rico)
|
354
|
+
SUBLANG_SWEDISH = 0x01 # Swedish
|
355
|
+
SUBLANG_SWEDISH_FINLAND = 0x02 # Swedish (Finland)
|
356
|
+
SUBLANG_URDU_PAKISTAN = 0x01 # Urdu (Pakistan)
|
357
|
+
SUBLANG_URDU_INDIA = 0x02 # Urdu (India)
|
358
|
+
SUBLANG_UZBEK_LATIN = 0x01 # Uzbek (Latin)
|
359
|
+
SUBLANG_UZBEK_CYRILLIC = 0x02 # Uzbek (Cyrillic)
|
360
|
+
|
361
|
+
LOCALE_NOUSEROVERRIDE = 0x80000000
|
362
|
+
LOCALE_USE_CP_ACP = 0x40000000
|
363
|
+
LOCALE_RETURN_NUMBER = 0x20000000
|
364
|
+
|
365
|
+
LOCALE_ILANGUAGE = 0x00000001
|
366
|
+
LOCALE_SLANGUAGE = 0x00000002
|
367
|
+
LOCALE_SENGLANGUAGE = 0x00001001
|
368
|
+
LOCALE_SABBREVLANGNAME = 0x00000003
|
369
|
+
LOCALE_SNATIVELANGNAME = 0x00000004
|
370
|
+
|
371
|
+
LOCALE_ICOUNTRY = 0x00000005
|
372
|
+
LOCALE_SCOUNTRY = 0x00000006
|
373
|
+
LOCALE_SENGCOUNTRY = 0x00001002
|
374
|
+
LOCALE_SABBREVCTRYNAME = 0x00000007
|
375
|
+
LOCALE_SNATIVECTRYNAME = 0x00000008
|
376
|
+
|
377
|
+
LOCALE_IDEFAULTLANGUAGE = 0x00000009 # default language id
|
378
|
+
LOCALE_IDEFAULTCOUNTRY = 0x0000000A # default country code
|
379
|
+
LOCALE_IDEFAULTCODEPAGE = 0x0000000B # default oem code page
|
380
|
+
LOCALE_IDEFAULTANSICODEPAGE = 0x00001004 # default ansi code page
|
381
|
+
LOCALE_IDEFAULTMACCODEPAGE = 0x00001011 # default mac code page
|
382
|
+
|
383
|
+
LOCALE_SLIST = 0x0000000C # list item separator
|
384
|
+
LOCALE_IMEASURE = 0x0000000D # 0 = metric, 1 = US
|
385
|
+
|
386
|
+
LOCALE_SDECIMAL = 0x0000000E # decimal separator
|
387
|
+
LOCALE_STHOUSAND = 0x0000000F # thousand separator
|
388
|
+
LOCALE_SGROUPING = 0x00000010 # digit grouping
|
389
|
+
LOCALE_IDIGITS = 0x00000011 # number of fractional digits
|
390
|
+
LOCALE_ILZERO = 0x00000012 # leading zeros for decimal
|
391
|
+
LOCALE_INEGNUMBER = 0x00001010 # negative number mode
|
392
|
+
LOCALE_SNATIVEDIGITS = 0x00000013 # native ascii 0-9
|
393
|
+
|
394
|
+
LOCALE_SCURRENCY = 0x00000014 # local monetary symbol
|
395
|
+
LOCALE_SINTLSYMBOL = 0x00000015 # intl monetary symbol
|
396
|
+
LOCALE_SMONDECIMALSEP = 0x00000016 # monetary decimal separator
|
397
|
+
LOCALE_SMONTHOUSANDSEP = 0x00000017 # monetary thousand separator
|
398
|
+
LOCALE_SMONGROUPING = 0x00000018 # monetary grouping
|
399
|
+
LOCALE_ICURRDIGITS = 0x00000019 # # local monetary digits
|
400
|
+
LOCALE_IINTLCURRDIGITS = 0x0000001A # # intl monetary digits
|
401
|
+
LOCALE_ICURRENCY = 0x0000001B # positive currency mode
|
402
|
+
LOCALE_INEGCURR = 0x0000001C # negative currency mode
|
403
|
+
|
404
|
+
LOCALE_SDATE = 0x0000001D # date separator
|
405
|
+
LOCALE_STIME = 0x0000001E # time separator
|
406
|
+
LOCALE_SSHORTDATE = 0x0000001F # short date format string
|
407
|
+
LOCALE_SLONGDATE = 0x00000020 # long date format string
|
408
|
+
LOCALE_STIMEFORMAT = 0x00001003 # time format string
|
409
|
+
LOCALE_IDATE = 0x00000021 # short date format ordering
|
410
|
+
LOCALE_ILDATE = 0x00000022 # long date format ordering
|
411
|
+
LOCALE_ITIME = 0x00000023 # time format specifier
|
412
|
+
LOCALE_ITIMEMARKPOSN = 0x00001005 # time marker position
|
413
|
+
LOCALE_ICENTURY = 0x00000024 # century format specifier (short date)
|
414
|
+
LOCALE_ITLZERO = 0x00000025 # leading zeros in time field
|
415
|
+
LOCALE_IDAYLZERO = 0x00000026 # leading zeros in day field (short date)
|
416
|
+
LOCALE_IMONLZERO = 0x00000027 # leading zeros in month field (short date)
|
417
|
+
LOCALE_S1159 = 0x00000028 # AM designator
|
418
|
+
LOCALE_S2359 = 0x00000029 # PM designator
|
419
|
+
|
420
|
+
LOCALE_ICALENDARTYPE = 0x00001009 # type of calendar specifier
|
421
|
+
LOCALE_IOPTIONALCALENDAR = 0x0000100B # additional calendar types specifier
|
422
|
+
LOCALE_IFIRSTDAYOFWEEK = 0x0000100C # first day of week specifier
|
423
|
+
LOCALE_IFIRSTWEEKOFYEAR = 0x0000100D # first week of year specifier
|
424
|
+
|
425
|
+
LOCALE_SDAYNAME1 = 0x0000002A # long name for Monday
|
426
|
+
LOCALE_SDAYNAME2 = 0x0000002B # long name for Tuesday
|
427
|
+
LOCALE_SDAYNAME3 = 0x0000002C # long name for Wednesday
|
428
|
+
LOCALE_SDAYNAME4 = 0x0000002D # long name for Thursday
|
429
|
+
LOCALE_SDAYNAME5 = 0x0000002E # long name for Friday
|
430
|
+
LOCALE_SDAYNAME6 = 0x0000002F # long name for Saturday
|
431
|
+
LOCALE_SDAYNAME7 = 0x00000030 # long name for Sunday
|
432
|
+
LOCALE_SABBREVDAYNAME1 = 0x00000031 # abbreviated name for Monday
|
433
|
+
LOCALE_SABBREVDAYNAME2 = 0x00000032 # abbreviated name for Tuesday
|
434
|
+
LOCALE_SABBREVDAYNAME3 = 0x00000033 # abbreviated name for Wednesday
|
435
|
+
LOCALE_SABBREVDAYNAME4 = 0x00000034 # abbreviated name for Thursday
|
436
|
+
LOCALE_SABBREVDAYNAME5 = 0x00000035 # abbreviated name for Friday
|
437
|
+
LOCALE_SABBREVDAYNAME6 = 0x00000036 # abbreviated name for Saturday
|
438
|
+
LOCALE_SABBREVDAYNAME7 = 0x00000037 # abbreviated name for Sunday
|
439
|
+
LOCALE_SMONTHNAME1 = 0x00000038 # long name for January
|
440
|
+
LOCALE_SMONTHNAME2 = 0x00000039 # long name for February
|
441
|
+
LOCALE_SMONTHNAME3 = 0x0000003A # long name for March
|
442
|
+
LOCALE_SMONTHNAME4 = 0x0000003B # long name for April
|
443
|
+
LOCALE_SMONTHNAME5 = 0x0000003C # long name for May
|
444
|
+
LOCALE_SMONTHNAME6 = 0x0000003D # long name for June
|
445
|
+
LOCALE_SMONTHNAME7 = 0x0000003E # long name for July
|
446
|
+
LOCALE_SMONTHNAME8 = 0x0000003F # long name for August
|
447
|
+
LOCALE_SMONTHNAME9 = 0x00000040 # long name for September
|
448
|
+
LOCALE_SMONTHNAME10 = 0x00000041 # long name for October
|
449
|
+
LOCALE_SMONTHNAME11 = 0x00000042 # long name for November
|
450
|
+
LOCALE_SMONTHNAME12 = 0x00000043 # long name for December
|
451
|
+
LOCALE_SMONTHNAME13 = 0x0000100E # long name for 13th month (if exists)
|
452
|
+
LOCALE_SABBREVMONTHNAME1 = 0x00000044 # abbreviated name for January
|
453
|
+
LOCALE_SABBREVMONTHNAME2 = 0x00000045 # abbreviated name for February
|
454
|
+
LOCALE_SABBREVMONTHNAME3 = 0x00000046 # abbreviated name for March
|
455
|
+
LOCALE_SABBREVMONTHNAME4 = 0x00000047 # abbreviated name for April
|
456
|
+
LOCALE_SABBREVMONTHNAME5 = 0x00000048 # abbreviated name for May
|
457
|
+
LOCALE_SABBREVMONTHNAME6 = 0x00000049 # abbreviated name for June
|
458
|
+
LOCALE_SABBREVMONTHNAME7 = 0x0000004A # abbreviated name for July
|
459
|
+
LOCALE_SABBREVMONTHNAME8 = 0x0000004B # abbreviated name for August
|
460
|
+
LOCALE_SABBREVMONTHNAME9 = 0x0000004C # abbreviated name for September
|
461
|
+
LOCALE_SABBREVMONTHNAME10 = 0x0000004D # abbreviated name for October
|
462
|
+
LOCALE_SABBREVMONTHNAME11 = 0x0000004E # abbreviated name for November
|
463
|
+
LOCALE_SABBREVMONTHNAME12 = 0x0000004F # abbreviated name for December
|
464
|
+
LOCALE_SABBREVMONTHNAME13 = 0x0000100F # abbreviated name for 13th month (if exists)
|
465
|
+
|
466
|
+
LOCALE_SPOSITIVESIGN = 0x00000050 # positive sign
|
467
|
+
LOCALE_SNEGATIVESIGN = 0x00000051 # negative sign
|
468
|
+
LOCALE_IPOSSIGNPOSN = 0x00000052 # positive sign position
|
469
|
+
LOCALE_INEGSIGNPOSN = 0x00000053 # negative sign position
|
470
|
+
LOCALE_IPOSSYMPRECEDES = 0x00000054 # mon sym precedes pos amt
|
471
|
+
LOCALE_IPOSSEPBYSPACE = 0x00000055 # mon sym sep by space from pos amt
|
472
|
+
LOCALE_INEGSYMPRECEDES = 0x00000056 # mon sym precedes neg amt
|
473
|
+
LOCALE_INEGSEPBYSPACE = 0x00000057 # mon sym sep by space from neg amt
|
474
|
+
|
475
|
+
LOCALE_FONTSIGNATURE = 0x00000058 # font signature
|
476
|
+
LOCALE_SISO639LANGNAME = 0x00000059 # ISO abbreviated language name
|
477
|
+
LOCALE_SISO3166CTRYNAME = 0x0000005A # ISO abbreviated country name
|
478
|
+
|
479
|
+
LOCALE_IDEFAULTEBCDICCODEPAGE = 0x00001012 # default ebcdic code page
|
480
|
+
LOCALE_IPAPERSIZE = 0x0000100A # 1 = letter, 5 = legal, 8 = a3, 9 = a4
|
481
|
+
LOCALE_SENGCURRNAME = 0x00001007 # english name of currency
|
482
|
+
LOCALE_SNATIVECURRNAME = 0x00001008 # native name of currency
|
483
|
+
LOCALE_SYEARMONTH = 0x00001006 # year month format string
|
484
|
+
LOCALE_SSORTNAME = 0x00001013 # sort name
|
485
|
+
LOCALE_IDIGITSUBSTITUTION = 0x00001014 # 0 = context, 1 = none, 2 = national
|
486
|
+
|
487
|
+
TIME_NOMINUTESORSECONDS = 0x00000001 # do not use minutes or seconds
|
488
|
+
TIME_NOSECONDS = 0x00000002 # do not use seconds
|
489
|
+
TIME_NOTIMEMARKER = 0x00000004 # do not use time marker
|
490
|
+
TIME_FORCE24HOURFORMAT = 0x00000008 # always use 24 hour format
|
491
|
+
|
492
|
+
DATE_SHORTDATE = 0x00000001 # use short date picture
|
493
|
+
DATE_LONGDATE = 0x00000002 # use long date picture
|
494
|
+
DATE_USE_ALT_CALENDAR = 0x00000004 # use alternate calendar (if any)
|
495
|
+
|
496
|
+
DATE_YEARMONTH = 0x00000008 # use year month picture
|
497
|
+
DATE_LTRREADING = 0x00000010 # add marks for left to right reading order layout
|
498
|
+
DATE_RTLREADING = 0x00000020 # add marks for right to left reading order layout
|
499
|
+
|
500
|
+
SORT_DEFAULT = 0x0 # sorting default
|
501
|
+
|
502
|
+
SORT_JAPANESE_XJIS = 0x0 # Japanese XJIS order
|
503
|
+
SORT_JAPANESE_UNICODE = 0x1 # Japanese Unicode order
|
504
|
+
|
505
|
+
SORT_CHINESE_BIG5 = 0x0 # Chinese BIG5 order
|
506
|
+
SORT_CHINESE_PRCP = 0x0 # PRC Chinese Phonetic order
|
507
|
+
SORT_CHINESE_UNICODE = 0x1 # Chinese Unicode order
|
508
|
+
SORT_CHINESE_PRC = 0x2 # PRC Chinese Stroke Count order
|
509
|
+
SORT_CHINESE_BOPOMOFO = 0x3 # Traditional Chinese Bopomofo order
|
510
|
+
|
511
|
+
SORT_KOREAN_KSC = 0x0 # Korean KSC order
|
512
|
+
SORT_KOREAN_UNICODE = 0x1 # Korean Unicode order
|
513
|
+
|
514
|
+
SORT_GERMAN_PHONE_BOOK = 0x1 # German Phone Book order
|
515
|
+
|
516
|
+
SORT_HUNGARIAN_DEFAULT = 0x0 # Hungarian Default order
|
517
|
+
SORT_HUNGARIAN_TECHNICAL = 0x1 # Hungarian Technical order
|
518
|
+
|
519
|
+
SORT_GEORGIAN_TRADITIONAL = 0x0 # Georgian Traditional order
|
520
|
+
SORT_GEORGIAN_MODERN = 0x1 # Georgian Modern order
|
521
|
+
|
522
|
+
LANG_SYSTEM_DEFAULT = 2
|
523
|
+
LANG_USER_DEFAULT = 1
|
524
|
+
LOCALE_SYSTEM_DEFAULT = 131072
|
525
|
+
LOCALE_USER_DEFAULT = 65536
|
526
|
+
|
527
|
+
GetACP = Win32API.new('kernel32', 'GetACP', 'V', 'I')
|
528
|
+
GetDateFormat = Win32API.new('kernel32', 'GetDateFormat', 'LLPPPI', 'I')
|
529
|
+
|
530
|
+
def GetACP()
|
531
|
+
GetACP.call
|
532
|
+
end
|
533
|
+
|
534
|
+
def GetDateFormat(locale, flags, date, format, datestr, size)
|
535
|
+
GetDateFormat.call(locale, flags, date, format, datestr, size)
|
536
|
+
end
|
537
|
+
|
538
|
+
# Convenience method for converting the results of the GetACP()
|
539
|
+
# function to a human readable string.
|
540
|
+
#
|
541
|
+
def get_acp_string
|
542
|
+
CODE_PAGE[GetACP.call]
|
543
|
+
end
|
544
|
+
|
545
|
+
# Equivalent of the MAKELCID macro in WinNT.h
|
546
|
+
#
|
547
|
+
def MAKELCID(srtid, lgid)
|
548
|
+
srtid << 16 | lgid
|
549
|
+
end
|
550
|
+
|
551
|
+
# Equivalent of the MAKELANGID macro in WinNT.h
|
552
|
+
#
|
553
|
+
def MAKELANGID(p, s)
|
554
|
+
s << 10 | p
|
555
|
+
end
|
556
|
+
end
|
557
|
+
end
|
data/lib/windows/path.rb
CHANGED
@@ -1,79 +1,3 @@
|
|
1
|
-
######################################################################
|
2
|
-
# path.rb
|
3
|
-
#
|
4
|
-
# Defines the following functions:
|
5
|
-
#
|
6
|
-
# PathAddBackslash()
|
7
|
-
# PathAddExtension()
|
8
|
-
# PathAppend()
|
9
|
-
# PathBuildRoot()
|
10
|
-
# PathCanonicalize()
|
11
|
-
# PathCombine()
|
12
|
-
# PathCommonPrefix()
|
13
|
-
# PathCompactPath()
|
14
|
-
# PathCompactPathEx()
|
15
|
-
# PathCreateFromUrl()
|
16
|
-
# PathFileExists()
|
17
|
-
# PathFindExtension()
|
18
|
-
# PathFindFileName()
|
19
|
-
# PathFindNextComponent()
|
20
|
-
# PathFindOnPath()
|
21
|
-
# PathFindSuffixArray()
|
22
|
-
# PathGetArgs()
|
23
|
-
# PathGetCharType()
|
24
|
-
# PathGetDriveNumber()
|
25
|
-
# PathIsContentType()
|
26
|
-
# PathIsDirectory()
|
27
|
-
# PathIsDirectoryEmpty()
|
28
|
-
# PathIsFileSpec()
|
29
|
-
# PathIsHTMLFile() - BROKEN
|
30
|
-
# PathIsLFNFileSpec()
|
31
|
-
# PathIsNetworkPath()
|
32
|
-
# PathIsPrefix()
|
33
|
-
# PathIsRelative()
|
34
|
-
# PathIsRoot()
|
35
|
-
# PathIsSameRoot()
|
36
|
-
# PathIsSystemFolder()
|
37
|
-
# PathIsUNC()
|
38
|
-
# PathIsUNCServer()
|
39
|
-
# PathIsUNCServerShare()
|
40
|
-
# PathIsURL()
|
41
|
-
# PathMakePretty()
|
42
|
-
# PathMakeSystemFolder()
|
43
|
-
# PathMatchSpec()
|
44
|
-
# PathParseIconLocation()
|
45
|
-
# PathQuoteSpaces()
|
46
|
-
# PathRelativePathTo()
|
47
|
-
# PathRemoveArgs()
|
48
|
-
# PathRemoveBackslash()
|
49
|
-
# PathRemoveBlanks()
|
50
|
-
# PathRemoveExtension()
|
51
|
-
# PathRemoveFileSpec()
|
52
|
-
# PathRenameExtension()
|
53
|
-
# PathSearchAndQualify()
|
54
|
-
# PathSetDlgItemPath()
|
55
|
-
# PathSkipRoot()
|
56
|
-
# PathStripPath()
|
57
|
-
# PathStripToRoot()
|
58
|
-
# PathUndecorate()
|
59
|
-
# PathUnExpandEnvStrings()
|
60
|
-
# PathUnmakeSystemFolder()
|
61
|
-
# PathUnquoteSpaces()
|
62
|
-
#
|
63
|
-
# Defines the following constants:
|
64
|
-
#
|
65
|
-
# GCT_INVALID
|
66
|
-
# GCT_LFNCHAR
|
67
|
-
# GCT_SHORTCHAR
|
68
|
-
# GCT_WILD
|
69
|
-
# GCT_SEPARATOR
|
70
|
-
#
|
71
|
-
# Notes:
|
72
|
-
#
|
73
|
-
# The PathIsHTMLFile() function does not appear to be exported in the
|
74
|
-
# shlwapi.dll file that is currently (March, 2006) shipped with the
|
75
|
-
# free compiler libs from Microsoft.
|
76
|
-
######################################################################
|
77
1
|
require 'Win32API'
|
78
2
|
|
79
3
|
module Windows
|
@@ -160,7 +84,7 @@ module Windows
|
|
160
84
|
end
|
161
85
|
|
162
86
|
def PathCanonicalize(dst, src)
|
163
|
-
PathCanonicalize.call(dst, src)
|
87
|
+
PathCanonicalize.call(dst, src) > 0
|
164
88
|
end
|
165
89
|
|
166
90
|
def PathCombine(dest, dir, file)
|
data/lib/windows/process.rb
CHANGED
@@ -53,6 +53,7 @@ module Windows
|
|
53
53
|
|
54
54
|
CreateProcess = Win32API.new('kernel32', 'CreateProcess', 'LPLLLLLLPP', 'I')
|
55
55
|
CreateRemoteThread = Win32API.new('kernel32', 'CreateRemoteThread', 'LPLLPLP', 'L')
|
56
|
+
CreateThread = Win32API.new('kernel32', 'CreateThread', 'PLPPLP', 'L')
|
56
57
|
ExitProcess = Win32API.new('kernel32', 'ExitProcess', 'L', 'V')
|
57
58
|
GetCommandLine = Win32API.new('kernel32', 'GetCommandLine', 'V', 'P')
|
58
59
|
GetCurrentProcess = Win32API.new('kernel32', 'GetCurrentProcess', 'V', 'L')
|
@@ -80,6 +81,10 @@ module Windows
|
|
80
81
|
CreateRemoteThread.call(handle, tattr, size, start, param, flags, tid)
|
81
82
|
end
|
82
83
|
|
84
|
+
def CreateThread(attr, size, addr, param, flags, id)
|
85
|
+
CreateThread.call(attr, size, addr, param, flags, id)
|
86
|
+
end
|
87
|
+
|
83
88
|
def ExitProcess(exit_code)
|
84
89
|
ExitProcess.call(exit_code)
|
85
90
|
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
require 'windows/file'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module Registry
|
5
|
+
include Windows::File
|
6
|
+
|
7
|
+
HKEY_CLASSES_ROOT = 0x80000000
|
8
|
+
KEY_CURRENT_USER = 0x80000001
|
9
|
+
HKEY_LOCAL_MACHINE = 0x80000002
|
10
|
+
HKEY_USERS = 0x80000003
|
11
|
+
HKEY_PERFORMANCE_DATA = 0x80000004
|
12
|
+
HKEY_PERFORMANCE_TEXT = 0x80000050
|
13
|
+
HKEY_PERFORMANCE_NLSTEXT = 0x80000060
|
14
|
+
HKEY_CURRENT_CONFIG = 0x80000005
|
15
|
+
HKEY_DYN_DATA = 0x80000006
|
16
|
+
|
17
|
+
KEY_QUERY_VALUE = 0x0001
|
18
|
+
KEY_SET_VALUE = 0x0002
|
19
|
+
KEY_CREATE_SUB_KEY = 0x0004
|
20
|
+
KEY_ENUMERATE_SUB_KEYS = 0x0008
|
21
|
+
KEY_NOTIFY = 0x0010
|
22
|
+
KEY_CREATE_LINK = 0x0020
|
23
|
+
KEY_WOW64_32KEY = 0x0200
|
24
|
+
KEY_WOW64_64KEY = 0x0100
|
25
|
+
KEY_WOW64_RES = 0x0300
|
26
|
+
|
27
|
+
KEY_READ = (STANDARD_RIGHTS_READ|KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|
|
28
|
+
KEY_NOTIFY) & (~SYNCHRONIZE)
|
29
|
+
|
30
|
+
KEY_WRITE = (STANDARD_RIGHTS_WRITE|KEY_SET_VALUE|
|
31
|
+
KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE)
|
32
|
+
|
33
|
+
KEY_EXECUTE = KEY_READ & (~SYNCHRONIZE)
|
34
|
+
|
35
|
+
KEY_ALL_ACCESS = (STANDARD_RIGHTS_ALL|KEY_QUERY_VALUE|KEY_SET_VALUE|
|
36
|
+
KEY_CREATE_SUB_KEY|KEY_ENUMERATE_SUB_KEYS|KEY_NOTIFY|
|
37
|
+
KEY_CREATE_LINK) & (~SYNCHRONIZE)
|
38
|
+
|
39
|
+
REG_OPTION_RESERVED = 0
|
40
|
+
REG_OPTION_NON_VOLATILE = 0
|
41
|
+
REG_OPTION_VOLATILE = 1
|
42
|
+
REG_OPTION_CREATE_LINK = 2
|
43
|
+
REG_OPTION_BACKUP_RESTORE = 4
|
44
|
+
REG_OPTION_OPEN_LINK = 8
|
45
|
+
|
46
|
+
REG_LEGAL_OPTION = REG_OPTION_RESERVED|REG_OPTION_NON_VOLATILE|
|
47
|
+
REG_OPTION_VOLATILE|REG_OPTION_CREATE_LINK|REG_OPTION_BACKUP_RESTORE|
|
48
|
+
REG_OPTION_OPEN_LINK
|
49
|
+
|
50
|
+
REG_CREATED_NEW_KEY = 1
|
51
|
+
REG_OPENED_EXISTING_KEY = 2
|
52
|
+
|
53
|
+
REG_STANDARD_FORMAT = 1
|
54
|
+
REG_LATEST_FORMAT = 2
|
55
|
+
REG_NO_COMPRESSION = 4
|
56
|
+
|
57
|
+
REG_WHOLE_HIVE_VOLATILE = 1
|
58
|
+
REG_REFRESH_HIVE = 2
|
59
|
+
REG_NO_LAZY_FLUSH = 4
|
60
|
+
REG_FORCE_RESTORE = 8
|
61
|
+
|
62
|
+
REG_FORCE_UNLOAD = 1
|
63
|
+
|
64
|
+
REG_NOTIFY_CHANGE_NAME = 1
|
65
|
+
REG_NOTIFY_CHANGE_ATTRIBUTES = 2
|
66
|
+
REG_NOTIFY_CHANGE_LAST_SET = 4
|
67
|
+
REG_NOTIFY_CHANGE_SECURITY = 8
|
68
|
+
|
69
|
+
REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME|
|
70
|
+
REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET|
|
71
|
+
REG_NOTIFY_CHANGE_SECURITY
|
72
|
+
|
73
|
+
REG_NONE = 0
|
74
|
+
REG_SZ = 1
|
75
|
+
REG_EXPAND_SZ = 2
|
76
|
+
REG_BINARY = 3
|
77
|
+
REG_DWORD = 4
|
78
|
+
REG_DWORD_LITTLE_ENDIAN = 4
|
79
|
+
REG_DWORD_BIG_ENDIAN = 5
|
80
|
+
REG_LINK = 6
|
81
|
+
REG_MULTI_SZ = 7
|
82
|
+
REG_RESOURCE_LIST = 8
|
83
|
+
REG_FULL_RESOURCE_DESCRIPTOR = 9
|
84
|
+
REG_RESOURCE_REQUIREMENTS_LIST = 10
|
85
|
+
REG_QWORD = 11
|
86
|
+
REG_QWORD_LITTLE_ENDIAN = 11
|
87
|
+
|
88
|
+
RegCloseKey = Win32API.new('advapi32', 'RegCloseKey', 'L', 'L')
|
89
|
+
RegConnectRegistry = Win32API.new('advapi32', 'RegConnectRegistry', 'PLP', 'L')
|
90
|
+
RegCreateKey = Win32API.new('advapi32', 'RegCreateKey', 'LPP', 'L')
|
91
|
+
RegCreateKeyEx = Win32API.new('advapi32', 'RegCreateKeyEx', 'LPLPLLPPP', 'L')
|
92
|
+
RegDeleteKey = Win32API.new('advapi32', 'RegDeleteKey', 'LP', 'L')
|
93
|
+
RegDeleteValue = Win32API.new('advapi32', 'RegDeleteValue', 'LP', 'L')
|
94
|
+
RegDisablePredefinedCache = Win32API.new('advapi32', 'RegDisablePredefinedCache', 'V', 'L')
|
95
|
+
RegEnumKey = Win32API.new('advapi32', 'RegEnumKey', 'LLPL', 'L')
|
96
|
+
RegEnumKeyEx = Win32API.new('advapi32', 'RegEnumKeyEx', 'LLPPPPP', 'L')
|
97
|
+
RegEnumValue = Win32API.new('advapi32', 'RegEnumValue', 'LLPPPPPP', 'L')
|
98
|
+
RegFlushKey = Win32API.new('advapi32', 'RegFlushKey', 'L', 'L')
|
99
|
+
RegLoadKey = Win32API.new('advapi32', 'RegLoadKey', 'LPP', 'L')
|
100
|
+
RegNotifyChangeKeyValue = Win32API.new('advapi32', 'RegNotifyChangeKeyValue', 'LILLI', 'L')
|
101
|
+
RegOpenCurrentUser = Win32API.new('advapi32', 'RegOpenCurrentUser', 'LP', 'L')
|
102
|
+
RegOpenKey = Win32API.new('advapi32', 'RegOpenKey', 'LPP', 'L')
|
103
|
+
RegOpenKeyEx = Win32API.new('advapi32', 'RegOpenKeyEx', 'LPLLP', 'L')
|
104
|
+
RegOpenUserClassesRoot = Win32API.new('advapi32', 'RegOpenUserClassesRoot', 'LLLP', 'L')
|
105
|
+
RegOverridePredefKey = Win32API.new('advapi32', 'RegOverridePredefKey', 'LL', 'L')
|
106
|
+
RegQueryInfoKey = Win32API.new('advapi32', 'RegQueryInfoKey', 'LPPPPPPPPPPP', 'L')
|
107
|
+
RegQueryMultipleValues = Win32API.new('advapi32', 'RegQueryMultipleValues', 'LPLPP', 'L')
|
108
|
+
RegQueryValueEx = Win32API.new('advapi32', 'RegQueryValueEx', 'LPPPPP', 'L')
|
109
|
+
RegReplaceKey = Win32API.new('advapi32', 'RegReplaceKey', 'LPPP', 'L')
|
110
|
+
RegRestoreKey = Win32API.new('advapi32', 'RegRestoreKey', 'LPL', 'L')
|
111
|
+
RegSaveKey = Win32API.new('advapi32', 'RegSaveKey', 'LPP', 'L')
|
112
|
+
RegSaveKeyEx = Win32API.new('advapi32', 'RegSaveKeyEx', 'LPPL', 'L')
|
113
|
+
RegSetValueEx = Win32API.new('advapi32', 'RegSetValueEx', 'LPLLPL', 'L')
|
114
|
+
RegUnLoadKey = Win32API.new('advapi32', 'RegUnLoadKey', 'LP', 'L')
|
115
|
+
|
116
|
+
def RegCloseKey(key)
|
117
|
+
RegCloseKey.call(key)
|
118
|
+
end
|
119
|
+
|
120
|
+
def RegConnectRegistry(machine, key, result)
|
121
|
+
RegConnectRegistry.call(machine, key, result)
|
122
|
+
end
|
123
|
+
|
124
|
+
def RegCreateKey(key, subkey, result)
|
125
|
+
RegCreateKey.call(key, subkey, result)
|
126
|
+
end
|
127
|
+
|
128
|
+
def RegCreateKeyEx(key, subkey, res, klass, opt, sam, sec, result, disp)
|
129
|
+
RegCreateKeyEx.call(key, subkey, res, klass, opt, sam, sec, result, disp)
|
130
|
+
end
|
131
|
+
|
132
|
+
def RegDeleteKey(key, subkey)
|
133
|
+
RegDeleteKey.call(key, subkey)
|
134
|
+
end
|
135
|
+
|
136
|
+
def RegDeleteValue(key, value)
|
137
|
+
RegDeleteValue.call(key, value)
|
138
|
+
end
|
139
|
+
|
140
|
+
def RegDisablePredefinedCache()
|
141
|
+
RegDisablePredefinedCache.call()
|
142
|
+
end
|
143
|
+
|
144
|
+
def RegEnumKey(key, index, name, size)
|
145
|
+
RegEnumKey.call(key, index, name, size)
|
146
|
+
end
|
147
|
+
|
148
|
+
def RegEnumKeyEx(key, index, name, size, res, klass, ksize, time)
|
149
|
+
RegEnumKeyEx.call(key, index, name, size, res, klass, ksize, time)
|
150
|
+
end
|
151
|
+
|
152
|
+
def RegEnumValue(key, index, value, size, res, type, data, dsize)
|
153
|
+
RegEnumValue.call(key, index, value, size, res, type, data, dsize)
|
154
|
+
end
|
155
|
+
|
156
|
+
def RegOpenKeyEx(key, subkey, options, sam, result)
|
157
|
+
RegOpenKeyEx.call(key, subkey, options, sam, result)
|
158
|
+
end
|
159
|
+
|
160
|
+
def RegFlushKey(key)
|
161
|
+
RegFlushKey.call(key)
|
162
|
+
end
|
163
|
+
|
164
|
+
def RegLoadKey(key, subkey, file)
|
165
|
+
RegLoadKey.call(key, subkey, file)
|
166
|
+
end
|
167
|
+
|
168
|
+
def RegNotifyChangeKeyValue(key, subtree, filter, event, async)
|
169
|
+
RegNotifyChangeKeyValue.call(key, subtree, filter, event, async)
|
170
|
+
end
|
171
|
+
|
172
|
+
def RegOpenCurrentUser(sam, result)
|
173
|
+
RegOpenCurrentUser.call(sam, result)
|
174
|
+
end
|
175
|
+
|
176
|
+
def RegOpenKeyEx(key, subkey, options, sam, result)
|
177
|
+
RegOpenKeyEx.call(key, subkey, options, sam, result)
|
178
|
+
end
|
179
|
+
|
180
|
+
def RegOpenUserClassesRoot(token, options, sam, result)
|
181
|
+
RegOpenUserClassesRoot.call(token, options, sam, result)
|
182
|
+
end
|
183
|
+
|
184
|
+
def RegOverridePredefKey(key, new_key)
|
185
|
+
RegOverridePredefKey.call(key, new_key)
|
186
|
+
end
|
187
|
+
|
188
|
+
def RegQueryInfoKey(key, klass, ksize, res, subkeys, maxkey, maxklass,
|
189
|
+
values, maxname, maxvalue, sec, time)
|
190
|
+
RegQueryInfoKey.call(key, klass, ksize, res, subkeys, maxkey, maxklass,
|
191
|
+
values, maxname, maxvalue, sec, time)
|
192
|
+
end
|
193
|
+
|
194
|
+
def RegQueryMultipleValues(key, val_list, num_vals, buf, size)
|
195
|
+
RegQueryMultipleValues.call(key, val_list, num_vals, buf, size)
|
196
|
+
end
|
197
|
+
|
198
|
+
def RegQueryValueEx(key, value, res, type, data, cbdata)
|
199
|
+
RegQueryValueEx.call(key, value, res, type, data, cbdata)
|
200
|
+
end
|
201
|
+
|
202
|
+
def RegReplaceKey(key, subkey, newfile, oldfile)
|
203
|
+
RegReplaceKey.call(key, subkey, newfile, oldfile)
|
204
|
+
end
|
205
|
+
|
206
|
+
def RegRestoreKey(key, file, flags)
|
207
|
+
RegRestoreKey.call(key, file, flags)
|
208
|
+
end
|
209
|
+
|
210
|
+
def RegSaveKey(key, file, sec)
|
211
|
+
RegSaveKey.call(key, file, sec)
|
212
|
+
end
|
213
|
+
|
214
|
+
def RegSaveKeyEx(key, file, sec, flags)
|
215
|
+
RegSaveKeyEx.call(key, file, sec, flags)
|
216
|
+
end
|
217
|
+
|
218
|
+
def RegSetValueEx(key, value, res, type, data, size)
|
219
|
+
RegSetValueEx.call(key, value, res, type, data, size)
|
220
|
+
end
|
221
|
+
|
222
|
+
def RegUnLoadKey(key, subkey)
|
223
|
+
RegUnLoadKey.call(key, subkey)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
data/lib/windows/system_info.rb
CHANGED
@@ -20,14 +20,20 @@ module Windows
|
|
20
20
|
ComputerNamePhysicalDnsFullyQualified = 7
|
21
21
|
ComputerNameMax = 8
|
22
22
|
|
23
|
+
ExpandEnvironmentStrings = Win32API.new('kernel32', 'ExpandEnvironmentStrings', 'PPL', 'L')
|
24
|
+
|
23
25
|
GetComputerName = Win32API.new('kernel32', 'GetComputerName', 'PP', 'I')
|
24
26
|
GetComputerNameEx = Win32API.new('kernel32', 'GetComputerNameEx', 'PPP', 'I')
|
25
27
|
GetSystemInfo = Win32API.new('kernel32', 'GetSystemInfo', 'P', 'V')
|
26
|
-
GetUserName = Win32API.new('
|
28
|
+
GetUserName = Win32API.new('advapi32', 'GetUserName', 'LL', 'I')
|
27
29
|
GetUserNameEx = Win32API.new('secur32', 'GetUserNameEx', 'LPL', 'I')
|
28
30
|
GetVersion = Win32API.new('kernel32', 'GetVersion', 'V', 'L')
|
29
31
|
GetVersionEx = Win32API.new('kernel32', 'GetVersionEx', 'P', 'I')
|
30
32
|
GetWindowsDirectory = Win32API.new('kernel32', 'GetWindowsDirectory', 'LI', 'I')
|
33
|
+
|
34
|
+
def ExpandEnvironmentStrings(src, dest, size)
|
35
|
+
ExpandEnvironmentStrings.call(src, dest, size)
|
36
|
+
end
|
31
37
|
|
32
38
|
def GetComputerName(buffer, size)
|
33
39
|
GetComputerNameEx.call(buffer, size) != 0
|
data/test/tc_memory.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_memory.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Memory module.
|
5
|
+
#####################################################################
|
6
|
+
base = File.basename(Dir.pwd)
|
7
|
+
if base == 'test' || base =~ /windows-pr/
|
8
|
+
Dir.chdir '..' if base == 'test'
|
9
|
+
$LOAD_PATH.unshift Dir.pwd + '/lib'
|
10
|
+
Dir.chdir 'test' rescue nil
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'windows/memory'
|
14
|
+
require 'test/unit'
|
15
|
+
|
16
|
+
class Foo
|
17
|
+
include Windows::Memory
|
18
|
+
end
|
19
|
+
|
20
|
+
class TC_Windows_Path < Test::Unit::TestCase
|
21
|
+
def setup
|
22
|
+
@foo = Foo.new
|
23
|
+
@path = "C:\\"
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_numeric_constants
|
27
|
+
assert_not_nil(Foo::GHND)
|
28
|
+
assert_not_nil(Foo::GMEM_FIXED)
|
29
|
+
assert_not_nil(Foo::GMEM_MOVABLE)
|
30
|
+
assert_not_nil(Foo::GMEM_ZEROINIT)
|
31
|
+
assert_not_nil(Foo::GPTR)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_method_constants
|
35
|
+
assert_not_nil(Foo::GlobalAlloc)
|
36
|
+
assert_not_nil(Foo::GlobalFlags)
|
37
|
+
assert_not_nil(Foo::GlobalFree)
|
38
|
+
assert_not_nil(Foo::GlobalHandle)
|
39
|
+
assert_not_nil(Foo::GlobalLock)
|
40
|
+
assert_not_nil(Foo::GlobalMemoryStatus)
|
41
|
+
assert_not_nil(Foo::GlobalMemoryStatusEx)
|
42
|
+
assert_not_nil(Foo::GlobalReAlloc)
|
43
|
+
assert_not_nil(Foo::GlobalSize)
|
44
|
+
assert_not_nil(Foo::GlobalUnlock)
|
45
|
+
end
|
46
|
+
|
47
|
+
def teardown
|
48
|
+
@foo = nil
|
49
|
+
@path = nil
|
50
|
+
end
|
51
|
+
end
|
data/test/tc_registry.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_registry.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Registry module.
|
5
|
+
#####################################################################
|
6
|
+
base = File.basename(Dir.pwd)
|
7
|
+
if base == 'test' || base =~ /windows-pr/
|
8
|
+
Dir.chdir '..' if base == 'test'
|
9
|
+
$LOAD_PATH.unshift Dir.pwd + '/lib'
|
10
|
+
Dir.chdir 'test' rescue nil
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'windows/registry'
|
14
|
+
require 'test/unit'
|
15
|
+
|
16
|
+
class Foo
|
17
|
+
include Windows::Registry
|
18
|
+
end
|
19
|
+
|
20
|
+
class TC_Windows_Registry < Test::Unit::TestCase
|
21
|
+
def setup
|
22
|
+
@foo = Foo.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_numeric_constants
|
26
|
+
assert_equal(0x80000000, Foo::HKEY_CLASSES_ROOT)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_method_constants
|
30
|
+
assert_not_nil(Foo::RegCloseKey)
|
31
|
+
end
|
32
|
+
|
33
|
+
def teardown
|
34
|
+
@foo = nil
|
35
|
+
end
|
36
|
+
end
|
data/test/ts_all.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: windows-pr
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-05-
|
6
|
+
version: 0.5.0
|
7
|
+
date: 2006-05-23 00:00:00 -06:00
|
8
8
|
summary: Windows functions and constants predefined via Win32API
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -34,14 +34,17 @@ files:
|
|
34
34
|
- lib/windows/device_io.rb
|
35
35
|
- lib/windows/directory.rb
|
36
36
|
- lib/windows/error.rb
|
37
|
+
- lib/windows/eventlog.rb
|
37
38
|
- lib/windows/file.rb
|
38
39
|
- lib/windows/filesystem.rb
|
39
40
|
- lib/windows/handle.rb
|
40
41
|
- lib/windows/library.rb
|
41
42
|
- lib/windows/limits.rb
|
42
43
|
- lib/windows/memory.rb
|
44
|
+
- lib/windows/national.rb
|
43
45
|
- lib/windows/path.rb
|
44
46
|
- lib/windows/process.rb
|
47
|
+
- lib/windows/registry.rb
|
45
48
|
- lib/windows/security.rb
|
46
49
|
- lib/windows/shell.rb
|
47
50
|
- lib/windows/sound.rb
|
@@ -54,8 +57,10 @@ files:
|
|
54
57
|
- lib/windows/msvcrt/file.rb
|
55
58
|
- test/tc_console.rb
|
56
59
|
- test/tc_error.rb
|
60
|
+
- test/tc_memory.rb
|
57
61
|
- test/tc_msvcrt_buffer.rb
|
58
62
|
- test/tc_path.rb
|
63
|
+
- test/tc_registry.rb
|
59
64
|
- test/tc_security.rb
|
60
65
|
- test/tc_synchronize.rb
|
61
66
|
- CHANGES
|