windows_error 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b7978f60617ca8a56247b39c4ef54d827bb30660ead51049d7e047d921bc3e0
4
- data.tar.gz: f6d7a286bfb9fdd482cb8558268c424bb1aa3d65e590af44c20e5bf0d6219e4c
3
+ metadata.gz: 37e364f4623b1af47ff8280b2f2dcd6c025b92860fa7661cfd8a6e7f5e5a1704
4
+ data.tar.gz: 697e8d708b14d497cb3d94f666abbd2f78631a2ad3462feceeb80c1abb73f53e
5
5
  SHA512:
6
- metadata.gz: 3352746cef8a1c8a4962ca38b1640b45a610718ee75d8e1c3f66e422dec8ecc39d370dd35b954c8d65d8676fec6f3c78ac8802362b49a720997548c2301c3aab
7
- data.tar.gz: b4fd3aec1bbb76f42cd708feb65b3c72c392cf2935c9274c18f8f8dfddeb731758141e73902cffe1ec0649216205939b99cebe1fee20562bb6e53a2c2f4f3017
6
+ metadata.gz: f765e1dc23dcec3b505b7780f0e49288d51422163f02a28190d93b8ddab7b5073c474b3a88616c0629b1afdd23e21183dea6f93ea97cf7b6761029bdf5f754bc
7
+ data.tar.gz: cc0a06b0ba5575d4c7a068160b32d495116d12efe8dd60285d3c4737bca63a5397bdb60f6609ca1f53670b906d9a87760195d0f89045d7ff701e39074cd2f7b2
checksums.yaml.gz.sig CHANGED
Binary file
@@ -28,7 +28,7 @@ module WindowsError
28
28
  self.freeze
29
29
  end
30
30
 
31
- # Overirdes the equality test for ErrorCodes. Equality is
31
+ # Overrides the equality test for ErrorCodes. Equality is
32
32
  # always tested against the #value of the error code.
33
33
  #
34
34
  # @param [Object] other_object the object to test equality against
@@ -0,0 +1,203 @@
1
+ module WindowsError
2
+ module HResult
3
+ # This module provides the namespace for all of the HRESULT Facility Codes.
4
+ # See [HRESULT](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)
5
+ # for more details on this particular set of error codes.
6
+ module Facility
7
+ FacilityCode = Struct.new('FacilityCode', :name, :value, :description) do
8
+ def ==(other_object)
9
+ if other_object.kind_of? self.class
10
+ self.value == other_object.value
11
+ elsif other_object.kind_of? Integer
12
+ self.value == other_object
13
+ elsif other_object.nil?
14
+ false
15
+ else
16
+ raise ArgumentError, "Cannot compare a #{self.class} to a #{other_object.class}"
17
+ end
18
+ end
19
+
20
+ alias :=== :==
21
+
22
+ def to_s
23
+ code = sprintf "%04x", self.value
24
+ "(0x#{code}) #{self.name}: #{self.description}"
25
+ end
26
+ end
27
+
28
+ # Return the {WindowsError::HResult::FacilityCode} object that matches
29
+ # the value supplied.
30
+ #
31
+ # @param [Integer] retval the return value you want the facility code for
32
+ # @raise [ArgumentError] if something other than a Integer is supplied
33
+ # @return [WindowsError::HResult::FacilityCode, Nil] the FacilityCode that matched
34
+ def self.find_by_code(retval)
35
+ raise ArgumentError, "Invalid value!" unless retval.kind_of? Integer
36
+
37
+ self.constants.sort.each do |constant_name|
38
+ facility_code = self.const_get(constant_name)
39
+ if facility_code.value == retval
40
+ return facility_code
41
+ end
42
+ end
43
+ end
44
+
45
+ # (0x0000) The default facility code.
46
+ FACILITY_NULL = FacilityCode.new('FACILITY_NULL', 0x0000, 'The default facility code.')
47
+
48
+ # (0x0001) The source of the error code is an RPC subsystem.
49
+ FACILITY_RPC = FacilityCode.new('FACILITY_RPC', 0x0001, 'The source of the error code is an RPC subsystem.')
50
+
51
+ # (0x0002) The source of the error code is a COM Dispatch.
52
+ FACILITY_DISPATCH = FacilityCode.new('FACILITY_DISPATCH', 0x0002, 'The source of the error code is a COM Dispatch.')
53
+
54
+ # (0x0003) The source of the error code is OLE Storage.
55
+ FACILITY_STORAGE = FacilityCode.new('FACILITY_STORAGE', 0x0003, 'The source of the error code is OLE Storage.')
56
+
57
+ # (0x0004) The source of the error code is COM/OLE Interface management.
58
+ FACILITY_ITF = FacilityCode.new('FACILITY_ITF', 0x0004, 'The source of the error code is COM/OLE Interface management.')
59
+
60
+ # (0x0007) This region is reserved to map undecorated error codes into HRESULTs.
61
+ FACILITY_WIN32 = FacilityCode.new('FACILITY_WIN32', 0x0007, 'This region is reserved to map undecorated error codes into HRESULTs.')
62
+
63
+ # (0x0008) The source of the error code is the Windows subsystem.
64
+ FACILITY_WINDOWS = FacilityCode.new('FACILITY_WINDOWS', 0x0008, 'The source of the error code is the Windows subsystem.')
65
+
66
+ # (0x0009) The source of the error code is the Security API layer.
67
+ FACILITY_SECURITY = FacilityCode.new('FACILITY_SECURITY', 0x0009, 'The source of the error code is the Security API layer.')
68
+
69
+ # (0x0009) The source of the error code is the Security API layer.
70
+ FACILITY_SSPI = FacilityCode.new('FACILITY_SSPI', 0x0009, 'The source of the error code is the Security API layer.')
71
+
72
+ # (0x000a) The source of the error code is the control mechanism.
73
+ FACILITY_CONTROL = FacilityCode.new('FACILITY_CONTROL', 0x000a, 'The source of the error code is the control mechanism.')
74
+
75
+ # (0x000b) The source of the error code is a certificate client or server?
76
+ FACILITY_CERT = FacilityCode.new('FACILITY_CERT', 0x000b, 'The source of the error code is a certificate client or server?')
77
+
78
+ # (0x000c) The source of the error code is Wininet related.
79
+ FACILITY_INTERNET = FacilityCode.new('FACILITY_INTERNET', 0x000c, 'The source of the error code is Wininet related.')
80
+
81
+ # (0x000d) The source of the error code is the Windows Media Server.
82
+ FACILITY_MEDIASERVER = FacilityCode.new('FACILITY_MEDIASERVER', 0x000d, 'The source of the error code is the Windows Media Server.')
83
+
84
+ # (0x000e) The source of the error code is the Microsoft Message Queue.
85
+ FACILITY_MSMQ = FacilityCode.new('FACILITY_MSMQ', 0x000e, 'The source of the error code is the Microsoft Message Queue.')
86
+
87
+ # (0x000f) The source of the error code is the Setup API.
88
+ FACILITY_SETUPAPI = FacilityCode.new('FACILITY_SETUPAPI', 0x000f, 'The source of the error code is the Setup API.')
89
+
90
+ # (0x0010) The source of the error code is the Smart-card subsystem.
91
+ FACILITY_SCARD = FacilityCode.new('FACILITY_SCARD', 0x0010, 'The source of the error code is the Smart-card subsystem.')
92
+
93
+ # (0x0011) The source of the error code is COM+.
94
+ FACILITY_COMPLUS = FacilityCode.new('FACILITY_COMPLUS', 0x0011, 'The source of the error code is COM+.')
95
+
96
+ # (0x0012) The source of the error code is the Microsoft agent.
97
+ FACILITY_AAF = FacilityCode.new('FACILITY_AAF', 0x0012, 'The source of the error code is the Microsoft agent.')
98
+
99
+ # (0x0013) The source of the error code is .NET CLR.
100
+ FACILITY_URT = FacilityCode.new('FACILITY_URT', 0x0013, 'The source of the error code is .NET CLR.')
101
+
102
+ # (0x0014) The source of the error code is the audit collection service.
103
+ FACILITY_ACS = FacilityCode.new('FACILITY_ACS', 0x0014, 'The source of the error code is the audit collection service.')
104
+
105
+ # (0x0015) The source of the error code is Direct Play.
106
+ FACILITY_DPLAY = FacilityCode.new('FACILITY_DPLAY', 0x0015, 'The source of the error code is Direct Play.')
107
+
108
+ # (0x0016) The source of the error code is the ubiquitous memoryintrospection service.
109
+ FACILITY_UMI = FacilityCode.new('FACILITY_UMI', 0x0016, 'The source of the error code is the ubiquitous memoryintrospection service.')
110
+
111
+ # (0x0017) The source of the error code is Side-by-side servicing.
112
+ FACILITY_SXS = FacilityCode.new('FACILITY_SXS', 0x0017, 'The source of the error code is Side-by-side servicing.')
113
+
114
+ # (0x0018) The error code is specific to Windows CE.
115
+ FACILITY_WINDOWS_CE = FacilityCode.new('FACILITY_WINDOWS_CE', 0x0018, 'The error code is specific to Windows CE.')
116
+
117
+ # (0x0019) The source of the error code is HTTP support.
118
+ FACILITY_HTTP = FacilityCode.new('FACILITY_HTTP', 0x0019, 'The source of the error code is HTTP support.')
119
+
120
+ # (0x001a) The source of the error code is common Logging support.
121
+ FACILITY_USERMODE_COMMONLOG = FacilityCode.new('FACILITY_USERMODE_COMMONLOG', 0x001a, 'The source of the error code is common Logging support.')
122
+
123
+ # (0x001f) The source of the error code is the user mode filter manager.
124
+ FACILITY_USERMODE_FILTER_MANAGER = FacilityCode.new('FACILITY_USERMODE_FILTER_MANAGER', 0x001f, 'The source of the error code is the user mode filter manager.')
125
+
126
+ # (0x0020) The source of the error code is background copy control
127
+ FACILITY_BACKGROUNDCOPY = FacilityCode.new('FACILITY_BACKGROUNDCOPY', 0x0020, 'The source of the error code is background copy control')
128
+
129
+ # (0x0021) The source of the error code is configuration services.
130
+ FACILITY_CONFIGURATION = FacilityCode.new('FACILITY_CONFIGURATION', 0x0021, 'The source of the error code is configuration services.')
131
+
132
+ # (0x0022) The source of the error code is state management services.
133
+ FACILITY_STATE_MANAGEMENT = FacilityCode.new('FACILITY_STATE_MANAGEMENT', 0x0022, 'The source of the error code is state management services.')
134
+
135
+ # (0x0023) The source of the error code is the Microsoft Identity Server.
136
+ FACILITY_METADIRECTORY = FacilityCode.new('FACILITY_METADIRECTORY', 0x0023, 'The source of the error code is the Microsoft Identity Server.')
137
+
138
+ # (0x0024) The source of the error code is a Windows update.
139
+ FACILITY_WINDOWSUPDATE = FacilityCode.new('FACILITY_WINDOWSUPDATE', 0x0024, 'The source of the error code is a Windows update.')
140
+
141
+ # (0x0025) The source of the error code is Active Directory.
142
+ FACILITY_DIRECTORYSERVICE = FacilityCode.new('FACILITY_DIRECTORYSERVICE', 0x0025, 'The source of the error code is Active Directory.')
143
+
144
+ # (0x0026) The source of the error code is the graphics drivers.
145
+ FACILITY_GRAPHICS = FacilityCode.new('FACILITY_GRAPHICS', 0x0026, 'The source of the error code is the graphics drivers.')
146
+
147
+ # (0x0027) The source of the error code is the user Shell.
148
+ FACILITY_SHELL = FacilityCode.new('FACILITY_SHELL', 0x0027, 'The source of the error code is the user Shell.')
149
+
150
+ # (0x0028) The source of the error code is the Trusted Platform Module services.
151
+ FACILITY_TPM_SERVICES = FacilityCode.new('FACILITY_TPM_SERVICES', 0x0028, 'The source of the error code is the Trusted Platform Module services.')
152
+
153
+ # (0x0029) The source of the error code is the Trusted Platform Module applications.
154
+ FACILITY_TPM_SOFTWARE = FacilityCode.new('FACILITY_TPM_SOFTWARE', 0x0029, 'The source of the error code is the Trusted Platform Module applications.')
155
+
156
+ # (0x0030) The source of the error code is Performance Logs and Alerts
157
+ FACILITY_PLA = FacilityCode.new('FACILITY_PLA', 0x0030, 'The source of the error code is Performance Logs and Alerts')
158
+
159
+ # (0x0031) The source of the error code is Full volume encryption.
160
+ FACILITY_FVE = FacilityCode.new('FACILITY_FVE', 0x0031, 'The source of the error code is Full volume encryption.')
161
+
162
+ # (0x0032) The source of the error code is the Firewall Platform.
163
+ FACILITY_FWP = FacilityCode.new('FACILITY_FWP', 0x0032, 'The source of the error code is the Firewall Platform.')
164
+
165
+ # (0x0033) The source of the error code is the Windows Resource Manager.
166
+ FACILITY_WINRM = FacilityCode.new('FACILITY_WINRM', 0x0033, 'The source of the error code is the Windows Resource Manager.')
167
+
168
+ # (0x00000034) The source of the error code is the Network Driver Interface.
169
+ FACILITY_NDIS = FacilityCode.new('FACILITY_NDIS', 0x00000034, 'The source of the error code is the Network Driver Interface.')
170
+
171
+ # (0x00000035) The source of the error code is the Usermode Hypervisor components.
172
+ FACILITY_USERMODE_HYPERVISOR = FacilityCode.new('FACILITY_USERMODE_HYPERVISOR', 0x00000035, 'The source of the error code is the Usermode Hypervisor components.')
173
+
174
+ # (0x00000036) The source of the error code is the Configuration Management Infrastructure.
175
+ FACILITY_CMI = FacilityCode.new('FACILITY_CMI', 0x00000036, 'The source of the error code is the Configuration Management Infrastructure.')
176
+
177
+ # (0x00000037) The source of the error code is the user mode virtualization subsystem.
178
+ FACILITY_USERMODE_VIRTUALIZATION = FacilityCode.new('FACILITY_USERMODE_VIRTUALIZATION', 0x00000037, 'The source of the error code is the user mode virtualization subsystem.')
179
+
180
+ # (0x00000038) The source of the error code is  the user mode volume manager
181
+ FACILITY_USERMODE_VOLMGR = FacilityCode.new('FACILITY_USERMODE_VOLMGR', 0x00000038, 'The source of the error code is  the user mode volume manager')
182
+
183
+ # (0x00000039) The source of the error code is the Boot Configuration Database.
184
+ FACILITY_BCD = FacilityCode.new('FACILITY_BCD', 0x00000039, 'The source of the error code is the Boot Configuration Database.')
185
+
186
+ # (0x0000003a) The source of the error code is user mode virtual hard disk support.
187
+ FACILITY_USERMODE_VHD = FacilityCode.new('FACILITY_USERMODE_VHD', 0x0000003a, 'The source of the error code is user mode virtual hard disk support.')
188
+
189
+ # (0x0000003c) The source of the error code is System Diagnostics.
190
+ FACILITY_SDIAG = FacilityCode.new('FACILITY_SDIAG', 0x0000003c, 'The source of the error code is System Diagnostics.')
191
+
192
+ # (0x0000003d) The source of the error code is the Web Services.
193
+ FACILITY_WEBSERVICES = FacilityCode.new('FACILITY_WEBSERVICES', 0x0000003d, 'The source of the error code is the Web Services.')
194
+
195
+ # (0x00000050) The source of the error code is a Windows Defender component.
196
+ FACILITY_WINDOWS_DEFENDER = FacilityCode.new('FACILITY_WINDOWS_DEFENDER', 0x00000050, 'The source of the error code is a Windows Defender component.')
197
+
198
+ # (0x00000051) The source of the error code is the open connectivity service.
199
+ FACILITY_OPC = FacilityCode.new('FACILITY_OPC', 0x00000051, 'The source of the error code is the open connectivity service.')
200
+
201
+ end
202
+ end
203
+ end