System Errors - Numerical Order
The following table provides a list of system error codes.

Code Description Name
0 The operation completed successfully.  ERROR_SUCCESS
1 Incorrect function.  ERROR_INVALID_FUNCTION
2 The system cannot find the file specified.  ERROR_FILE_NOT_FOUND
3 The system cannot find the path specified.  ERROR_PATH_NOT_FOUND
4 The system cannot open the file.  ERROR_TOO_MANY_OPEN_FILES
5 Access is denied.  ERROR_ACCESS_DENIED
6 The handle is invalid.  ERROR_INVALID_HANDLE
7 The storage control blocks were destroyed.  ERROR_ARENA_TRASHED
8 Not enough storage is available to process this command.  ERROR_NOT_ENOUGH_MEMORY
9 The storage control block address is invalid.  ERROR_INVALID_BLOCK
10 The environment is incorrect.  ERROR_BAD_ENVIRONMENT
11 An attempt was made to load a program with an incorrect format.  ERROR_BAD_FORMAT
12 The access code is invalid.  ERROR_INVALID_ACCESS
13 The data is invalid.  ERROR_INVALID_DATA
14 Not enough storage is available to complete this operation.  ERROR_OUTOFMEMORY
15 The system cannot find the drive specified.  ERROR_INVALID_DRIVE
16 The directory cannot be removed.  ERROR_CURRENT_DIRECTORY
17 The system cannot move the file to a different disk drive.  ERROR_NOT_SAME_DEVICE
18 There are no more files.  ERROR_NO_MORE_FILES
19 The media is write protected.  ERROR_WRITE_PROTECT
20 The system cannot find the device specified.  ERROR_BAD_UNIT
21 The device is not ready.  ERROR_NOT_READY
22 The device does not recognize the command.  ERROR_BAD_COMMAND
23 Data error (cyclic redundancy check).  ERROR_CRC
24 The program issued a command but the command length is incorrect.  ERROR_BAD_LENGTH
25 The drive cannot locate a specific area or track on the disk.  ERROR_SEEK
26 The specified disk or diskette cannot be accessed.  ERROR_NOT_DOS_DISK
27 The drive cannot find the sector requested.  ERROR_SECTOR_NOT_FOUND
28 The printer is out of paper.  ERROR_OUT_OF_PAPER
29 The system cannot write to the specified device.  ERROR_WRITE_FAULT
30 The system cannot read from the specified device.  ERROR_READ_FAULT
31 A device attached to the system is not functioning.  ERROR_GEN_FAILURE
32 The process cannot access the file because it is being used by another process.  ERROR_SHARING_VIOLATION
33 The process cannot access the file because another process has locked a portion of the file.  ERROR_LOCK_VIOLATION
34 The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1.  ERROR_WRONG_DISK
36 Too many files opened for sharing.  ERROR_SHARING_BUFFER_EXCEEDED
38 Reached the end of the file.  ERROR_HANDLE_EOF
39 The disk is full.  ERROR_HANDLE_DISK_FULL
50 The network request is not supported.  ERROR_NOT_SUPPORTED
51 The remote computer is not available.  ERROR_REM_NOT_LIST
52 A duplicate name exists on the network.  ERROR_DUP_NAME
53 The network path was not found.  ERROR_BAD_NETPATH
54 The network is busy.  ERROR_NETWORK_BUSY
55 The specified network resource or device is no longer available.  ERROR_DEV_NOT_EXIST
56 The network BIOS command limit has been reached.  ERROR_TOO_MANY_CMDS
57 A network adapter hardware error occurred.  ERROR_ADAP_HDW_ERR
58 The specified server cannot perform the requested operation.  ERROR_BAD_NET_RESP
59 An unexpected network error occurred.  ERROR_UNEXP_NET_ERR
60 The remote adapter is not compatible.  ERROR_BAD_REM_ADAP
61 The printer queue is full.  ERROR_PRINTQ_FULL
62 Space to store the file waiting to be printed is not available on the server.  ERROR_NO_SPOOL_SPACE
63 Your file waiting to be printed was deleted.  ERROR_PRINT_CANCELLED
64 The specified network name is no longer available.  ERROR_NETNAME_DELETED
65 Network access is denied.  ERROR_NETWORK_ACCESS_DENIED
66 The network resource type is not correct.  ERROR_BAD_DEV_TYPE
67 The network name cannot be found.  ERROR_BAD_NET_NAME
68 The name limit for the local computer network adapter card was exceeded.  ERROR_TOO_MANY_NAMES
69 The network BIOS session limit was exceeded.  ERROR_TOO_MANY_SESS
70 The remote server has been paused or is in the process of being started.  ERROR_SHARING_PAUSED
71 No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept.  ERROR_REQ_NOT_ACCEP
72 The specified printer or disk device has been paused.  ERROR_REDIR_PAUSED
80 The file exists.  ERROR_FILE_EXISTS
82 The directory or file cannot be created.  ERROR_CANNOT_MAKE
83 Fail on INT 24.  ERROR_FAIL_I24
84 Storage to process this request is not available.  ERROR_OUT_OF_STRUCTURES
85 The local device name is already in use.  ERROR_ALREADY_ASSIGNED
86 The specified network password is not correct.  ERROR_INVALID_PASSWORD
87 The parameter is incorrect.  ERROR_INVALID_PARAMETER
88 A write fault occurred on the network.  ERROR_NET_WRITE_FAULT
89 The system cannot start another process at this time.  ERROR_NO_PROC_SLOTS
100 Cannot create another system semaphore.  ERROR_TOO_MANY_SEMAPHORES
101 The exclusive semaphore is owned by another process.  ERROR_EXCL_SEM_ALREADY_OWNED
102 The semaphore is set and cannot be closed.  ERROR_SEM_IS_SET
103 The semaphore cannot be set again.  ERROR_TOO_MANY_SEM_REQUESTS
104 Cannot request exclusive semaphores at interrupt time.  ERROR_INVALID_AT_INTERRUPT_TIME
105 The previous ownership of this semaphore has ended.  ERROR_SEM_OWNER_DIED
106 Insert the diskette for drive %1.  ERROR_SEM_USER_LIMIT
107 The program stopped because an alternate diskette was not inserted.  ERROR_DISK_CHANGE
108 The disk is in use or locked by another process.  ERROR_DRIVE_LOCKED
109 The pipe has been ended.  ERROR_BROKEN_PIPE
110 The system cannot open the device or file specified.  ERROR_OPEN_FAILED
111 The file name is too long.  ERROR_BUFFER_OVERFLOW
112 There is not enough space on the disk.  ERROR_DISK_FULL
113 No more internal file identifiers available.  ERROR_NO_MORE_SEARCH_HANDLES
114 The target internal file identifier is incorrect.  ERROR_INVALID_TARGET_HANDLE
117 The IOCTL call made by the application program is not correct.  ERROR_INVALID_CATEGORY
118 The verify-on-write switch parameter value is not correct.  ERROR_INVALID_VERIFY_SWITCH
119 The system does not support the command requested.  ERROR_BAD_DRIVER_LEVEL
120 This function is not supported on this system.  ERROR_CALL_NOT_IMPLEMENTED
121 The semaphore timeout period has expired.  ERROR_SEM_TIMEOUT
122 The data area passed to a system call is too small.  ERROR_INSUFFICIENT_BUFFER
123 The filename, directory name, or volume label syntax is incorrect.  ERROR_INVALID_NAME
124 The system call level is not correct.  ERROR_INVALID_LEVEL
125 The disk has no volume label.  ERROR_NO_VOLUME_LABEL
126 The specified module could not be found.  ERROR_MOD_NOT_FOUND
127 The specified procedure could not be found.  ERROR_PROC_NOT_FOUND
128 There are no child processes to wait for.  ERROR_WAIT_NO_CHILDREN
129 The %1 application cannot be run in Win32 mode.  ERROR_CHILD_NOT_COMPLETE
130 Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O.  ERROR_DIRECT_ACCESS_HANDLE
131 An attempt was made to move the file pointer before the beginning of the file.  ERROR_NEGATIVE_SEEK
132 The file pointer cannot be set on the specified device or file.  ERROR_SEEK_ON_DEVICE
133 A JOIN or SUBST command cannot be used for a drive that contains previously joined drives.  ERROR_IS_JOIN_TARGET
134 An attempt was made to use a JOIN or SUBST command on a drive that has already been joined.  ERROR_IS_JOINED
135 An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted.  ERROR_IS_SUBSTED
136 The system tried to delete the JOIN of a drive that is not joined.  ERROR_NOT_JOINED
137 The system tried to delete the substitution of a drive that is not substituted.  ERROR_NOT_SUBSTED
138 The system tried to join a drive to a directory on a joined drive.  ERROR_JOIN_TO_JOIN
139 The system tried to substitute a drive to a directory on a substituted drive.  ERROR_SUBST_TO_SUBST
140 The system tried to join a drive to a directory on a substituted drive.  ERROR_JOIN_TO_SUBST
141 The system tried to SUBST a drive to a directory on a joined drive.  ERROR_SUBST_TO_JOIN
142 The system cannot perform a JOIN or SUBST at this time.  ERROR_BUSY_DRIVE
143 The system cannot join or substitute a drive to or for a directory on the same drive.  ERROR_SAME_DRIVE
144 The directory is not a subdirectory of the root directory.  ERROR_DIR_NOT_ROOT
145 The directory is not empty.  ERROR_DIR_NOT_EMPTY
146 The path specified is being used in a substitute.  ERROR_IS_SUBST_PATH
147 Not enough resources are available to process this command.  ERROR_IS_JOIN_PATH
148 The path specified cannot be used at this time.  ERROR_PATH_BUSY
149 An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute.  ERROR_IS_SUBST_TARGET
150 System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.  ERROR_SYSTEM_TRACE
151 The number of specified semaphore events for DosMuxSemWait is not correct.  ERROR_INVALID_EVENT_COUNT
152 DosMuxSemWait did not execute; too many semaphores are already set.  ERROR_TOO_MANY_MUXWAITERS
153 The DosMuxSemWait list is not correct.  ERROR_INVALID_LIST_FORMAT
154 The volume label you entered exceeds the label character limit of the target file system.  ERROR_LABEL_TOO_LONG
155 Cannot create another thread.  ERROR_TOO_MANY_TCBS
156 The recipient process has refused the signal.  ERROR_SIGNAL_REFUSED
157 The segment is already discarded and cannot be locked.  ERROR_DISCARDED
158 The segment is already unlocked.  ERROR_NOT_LOCKED
159 The address for the thread ID is not correct.  ERROR_BAD_THREADID_ADDR
160 The argument string passed to DosExecPgm is not correct.  ERROR_BAD_ARGUMENTS
161 The specified path is invalid.  ERROR_BAD_PATHNAME
162 A signal is already pending.  ERROR_SIGNAL_PENDING
164 No more threads can be created in the system.  ERROR_MAX_THRDS_REACHED
167 Unable to lock a region of a file.  ERROR_LOCK_FAILED
170 The requested resource is in use.  ERROR_BUSY
173 A lock request was not outstanding for the supplied cancel region.  ERROR_CANCEL_VIOLATION
174 The file system does not support atomic changes to the lock type.  ERROR_ATOMIC_LOCKS_NOT_SUPPORTED
180 The system detected a segment number that was not correct.  ERROR_INVALID_SEGMENT_NUMBER
182 The operating system cannot run %1.  ERROR_INVALID_ORDINAL
183 Cannot create a file when that file already exists.  ERROR_ALREADY_EXISTS
186 The flag passed is not correct.  ERROR_INVALID_FLAG_NUMBER
187 The specified system semaphore name was not found.  ERROR_SEM_NOT_FOUND
188 The operating system cannot run %1.  ERROR_INVALID_STARTING_CODESEG
189 The operating system cannot run %1.  ERROR_INVALID_STACKSEG
190 The operating system cannot run %1.  ERROR_INVALID_MODULETYPE
191 Cannot run %1 in Win32 mode.  ERROR_INVALID_EXE_SIGNATURE
192 The operating system cannot run %1.  ERROR_EXE_MARKED_INVALID
193 is not a valid Win32 application.  ERROR_BAD_EXE_FORMAT
194 The operating system cannot run %1.  ERROR_ITERATED_DATA_EXCEEDS_64k
195 The operating system cannot run %1.  ERROR_INVALID_MINALLOCSIZE
196 The operating system cannot run this application program.  ERROR_DYNLINK_FROM_INVALID_RING
197 The operating system is not presently configured to run this application.  ERROR_IOPL_NOT_ENABLED
198 The operating system cannot run %1.  ERROR_INVALID_SEGDPL
199 The operating system cannot run this application program.  ERROR_AUTODATASEG_EXCEEDS_64k
200 The code segment cannot be greater than or equal to 64K.  ERROR_RING2SEG_MUST_BE_MOVABLE
201 The operating system cannot run %1.  ERROR_RELOC_CHAIN_XEEDS_SEGLIM
202 The operating system cannot run %1.  ERROR_INFLOOP_IN_RELOC_CHAIN
203 The system could not find the environment option that was entered.  ERROR_ENVVAR_NOT_FOUND
205 No process in the command subtree has a signal handler.  ERROR_NO_SIGNAL_SENT
206 The filename or extension is too long.  ERROR_FILENAME_EXCED_RANGE
207 The ring 2 stack is in use.  ERROR_RING2_STACK_IN_USE
208 The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified.  ERROR_META_EXPANSION_TOO_LONG
209 The signal being posted is not correct.  ERROR_INVALID_SIGNAL_NUMBER
210 The signal handler cannot be set.  ERROR_THREAD_1_INACTIVE
212 The segment is locked and cannot be reallocated.  ERROR_LOCKED
214 Too many dynamic-link modules are attached to this program or dynamic-link module.  ERROR_TOO_MANY_MODULES
215 Can't nest calls to LoadModule.  ERROR_NESTING_NOT_ALLOWED
216 The image file %1 is valid, but is for a machine type other than the current machine.  ERROR_EXE_MACHINE_TYPE_MISMATCH
230 The pipe state is invalid.  ERROR_BAD_PIPE
231 All pipe instances are busy.  ERROR_PIPE_BUSY
232 The pipe is being closed.  ERROR_NO_DATA
233 No process is on the other end of the pipe.  ERROR_PIPE_NOT_CONNECTED
234 More data is available.  ERROR_MORE_DATA
240 The session was canceled.  ERROR_VC_DISCONNECTED
254 The specified extended attribute name was invalid.  ERROR_INVALID_EA_NAME
255 The extended attributes are inconsistent.  ERROR_EA_LIST_INCONSISTENT
259 No more data is available.  ERROR_NO_MORE_ITEMS
266 The copy functions cannot be used.  ERROR_CANNOT_COPY
267 The directory name is invalid.  ERROR_DIRECTORY
275 The extended attributes did not fit in the buffer.  ERROR_EAS_DIDNT_FIT
276 The extended attribute file on the mounted file system is corrupt.  ERROR_EA_FILE_CORRUPT
277 The extended attribute table file is full.  ERROR_EA_TABLE_FULL
278 The specified extended attribute handle is invalid.  ERROR_INVALID_EA_HANDLE
282 The mounted file system does not support extended attributes.  ERROR_EAS_NOT_SUPPORTED
288 Attempt to release mutex not owned by caller.  ERROR_NOT_OWNER
298 Too many posts were made to a semaphore.  ERROR_TOO_MANY_POSTS
299 Only part of a ReadProcessMemoty or WriteProcessMemory request was completed.  ERROR_PARTIAL_COPY
300 The oplock request is denied.  ERROR_OPLOCK_NOT_GRANTED
301 An invalid oplock acknowledgment was received by the system.  ERROR_INVALID_OPLOCK_PROTOCOL
317 The system cannot find message text for message number 0x%1 in the message file for %2.  ERROR_MR_MID_NOT_FOUND
487 Attempt to access invalid address.  ERROR_INVALID_ADDRESS
534 Arithmetic result exceeded 32 bits.  ERROR_ARITHMETIC_OVERFLOW
535 There is a process on other end of the pipe.  ERROR_PIPE_CONNECTED
536 Waiting for a process to open the other end of the pipe.  ERROR_PIPE_LISTENING
994 Access to the extended attribute was denied.  ERROR_EA_ACCESS_DENIED
995 The I/O operation has been aborted because of either a thread exit or an application request.  ERROR_OPERATION_ABORTED
996 Overlapped I/O event is not in a signaled state.  ERROR_IO_INCOMPLETE
997 Overlapped I/O operation is in progress.  ERROR_IO_PENDING
998 Invalid access to memory location.  ERROR_NOACCESS
999 Error performing inpage operation.  ERROR_SWAPERROR
1001 Recursion too deep; the stack overflowed.  ERROR_STACK_OVERFLOW
1002 The window cannot act on the sent message.  ERROR_INVALID_MESSAGE
1003 Cannot complete this function.  ERROR_CAN_NOT_COMPLETE
1004 Invalid flags.  ERROR_INVALID_FLAGS
1005 The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted.  ERROR_UNRECOGNIZED_VOLUME
1006 The volume for a file has been externally altered so that the opened file is no longer valid.  ERROR_FILE_INVALID
1007 The requested operation cannot be performed in full-screen mode.  ERROR_FULLSCREEN_MODE
1008 An attempt was made to reference a token that does not exist.  ERROR_NO_TOKEN
1009 The configuration registry database is corrupt.  ERROR_BADDB
1010 The configuration registry key is invalid.  ERROR_BADKEY
1011 The configuration registry key could not be opened.  ERROR_CANTOPEN
1012 The configuration registry key could not be read.  ERROR_CANTREAD
1013 The configuration registry key could not be written.  ERROR_CANTWRITE
1014 One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful.  ERROR_REGISTRY_RECOVERED
1015 The registry is corrupted. The structure of one of the files that contains registry data is corrupted, or the system's image of the file in memory is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted.  ERROR_REGISTRY_CORRUPT
1016 An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry.  ERROR_REGISTRY_IO_FAILED
1017 The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format.  ERROR_NOT_REGISTRY_FILE
1018 Illegal operation attempted on a registry key that has been marked for deletion.  ERROR_KEY_DELETED
1019 System could not allocate the required space in a registry log.  ERROR_NO_LOG_SPACE
1020 Cannot create a symbolic link in a registry key that already has subkeys or values.  ERROR_KEY_HAS_CHILDREN
1021 Cannot create a stable subkey under a volatile parent key.  ERROR_CHILD_MUST_BE_VOLATILE
1022 A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes.  ERROR_NOTIFY_ENUM_DIR
1051 A stop control has been sent to a service that other running services are dependent on.  ERROR_DEPENDENT_SERVICES_RUNNING
1052 The requested control is not valid for this service.  ERROR_INVALID_SERVICE_CONTROL
1053 The service did not respond to the start or control request in a timely fashion.  ERROR_SERVICE_REQUEST_TIMEOUT
1054 A thread could not be created for the service.  ERROR_SERVICE_NO_THREAD
1055 The service database is locked.  ERROR_SERVICE_DATABASE_LOCKED
1056 An instance of the service is already running.  ERROR_SERVICE_ALREADY_RUNNING
1057 The account name is invalid or does not exist.  ERROR_INVALID_SERVICE_ACCOUNT
1058 The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.  ERROR_SERVICE_DISABLED
1059 Circular service dependency was specified.  ERROR_CIRCULAR_DEPENDENCY
1060 The specified service does not exist as an installed service.  ERROR_SERVICE_DOES_NOT_EXIST
1061 The service cannot accept control messages at this time.  ERROR_SERVICE_CANNOT_ACCEPT_CTRL
1062 The service has not been started.  ERROR_SERVICE_NOT_ACTIVE
1063 The service process could not connect to the service controller.  ERROR_FAILED_SERVICE_CONTROLLER_CONNECT
1064 An exception occurred in the service when handling the control request.  ERROR_EXCEPTION_IN_SERVICE
1065 The database specified does not exist.  ERROR_DATABASE_DOES_NOT_EXIST
1066 The service has returned a service-specific error code.  ERROR_SERVICE_SPECIFIC_ERROR
1067 The process terminated unexpectedly.  ERROR_PROCESS_ABORTED
1068 The dependency service or group failed to start.  ERROR_SERVICE_DEPENDENCY_FAIL
1069 The service did not start due to a logon failure.  ERROR_SERVICE_LOGON_FAILED
1070 After starting, the service hung in a start-pending state.  ERROR_SERVICE_START_HANG
1071 The specified service database lock is invalid.  ERROR_INVALID_SERVICE_LOCK
1072 The specified service has been marked for deletion.  ERROR_SERVICE_MARKED_FOR_DELETE
1073 The specified service already exists.  ERROR_SERVICE_EXISTS
1074 The system is currently running with the last-known-good configuration.  ERROR_ALREADY_RUNNING_LKG
1075 The dependency service does not exist or has been marked for deletion.  ERROR_SERVICE_DEPENDENCY_DELETED
1076 The current boot has already been accepted for use as the last-known-good control set.  ERROR_BOOT_ALREADY_ACCEPTED
1077 No attempts to start the service have been made since the last boot.  ERROR_SERVICE_NEVER_STARTED
1078 The name is already in use as either a service name or a service display name.  ERROR_DUPLICATE_SERVICE_NAME
1079 The account specified for this service is different from the account specified for other services running in the same process.  ERROR_DIFFERENT_SERVICE_ACCOUNT
1080 Failure actions can only be set for Win32 services, not for drivers.  ERROR_CANNOT_DETECT_DRIVER_FAILURE
1081 This service runs in the same process as the service control manager. Therefore, the service control manager cannot take action if this service's process terminates unexpectedly.  ERROR_CANNOT_DETECT_PROCESS_ABORT
1082 No recovery program has been configured for this service.  ERROR_NO_RECOVERY_PROGRAM
1100 The physical end of the tape has been reached.  ERROR_END_OF_MEDIA
1101 A tape access reached a filemark.  ERROR_FILEMARK_DETECTED
1102 The beginning of the tape or a partition was encountered.  ERROR_BEGINNING_OF_MEDIA
1103 A tape access reached the end of a set of files.  ERROR_SETMARK_DETECTED
1104 No more data is on the tape.  ERROR_NO_DATA_DETECTED
1105 Tape could not be partitioned.  ERROR_PARTITION_FAILURE
1106 When accessing a new tape of a multivolume partition, the current blocksize is incorrect.  ERROR_INVALID_BLOCK_LENGTH
1107 Tape partition information could not be found when loading a tape.  ERROR_DEVICE_NOT_PARTITIONED
1108 Unable to lock the media eject mechanism.  ERROR_UNABLE_TO_LOCK_MEDIA
1109 Unable to unload the media.  ERROR_UNABLE_TO_UNLOAD_MEDIA
1110 The media in the drive may have changed.  ERROR_MEDIA_CHANGED
1111 The I/O bus was reset.  ERROR_BUS_RESET
1112 No media in drive.  ERROR_NO_MEDIA_IN_DRIVE
1113 No mapping for the Unicode character exists in the target multi-byte code page.  ERROR_NO_UNICODE_TRANSLATION
1114 A dynamic link library (DLL) initialization routine failed.  ERROR_DLL_INIT_FAILED
1115 A system shutdown is in progress.  ERROR_SHUTDOWN_IN_PROGRESS
1116 Unable to abort the system shutdown because no shutdown was in progress.  ERROR_NO_SHUTDOWN_IN_PROGRESS
1117 The request could not be performed because of an I/O device error.  ERROR_IO_DEVICE
1118 No serial device was successfully initialized. The serial driver will unload.  ERROR_SERIAL_NO_DEVICE
1119 Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened.  ERROR_IRQ_BUSY
1120 A serial I/O operation was completed by another write to the serial port. The IOCTL_SERIAL_XOFF_COUNTER reached zero.)  ERROR_MORE_WRITES
1121 A serial I/O operation completed because the timeout period expired. The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)  ERROR_COUNTER_TIMEOUT
1122 No ID address mark was found on the floppy disk.  ERROR_FLOPPY_ID_MARK_NOT_FOUND
1123 Mismatch between the floppy disk sector ID field and the floppy disk controller track address.  ERROR_FLOPPY_WRONG_CYLINDER
1124 The floppy disk controller reported an error that is not recognized by the floppy disk driver.  ERROR_FLOPPY_UNKNOWN_ERROR
1125 The floppy disk controller returned inconsistent results in its registers.  ERROR_FLOPPY_BAD_REGISTERS
1126 While accessing the hard disk, a recalibrate operation failed, even after retries.  ERROR_DISK_RECALIBRATE_FAILED
1127 While accessing the hard disk, a disk operation failed even after retries.  ERROR_DISK_OPERATION_FAILED
1128 While accessing the hard disk, a disk controller reset was needed, but even that failed.  ERROR_DISK_RESET_FAILED
1129 Physical end of tape encountered.  ERROR_EOM_OVERFLOW
1130 Not enough server storage is available to process this command.  ERROR_NOT_ENOUGH_SERVER_MEMORY
1131 A potential deadlock condition has been detected.  ERROR_POSSIBLE_DEADLOCK
1132 The base address or the file offset specified does not have the proper alignment.  ERROR_MAPPED_ALIGNMENT
1140 An attempt to change the system power state was vetoed by another application or driver.  ERROR_SET_POWER_STATE_VETOED
1141 The system BIOS failed an attempt to change the system power state.  ERROR_SET_POWER_STATE_FAILED
1142 An attempt was made to create more links on a file than the file system supports.  ERROR_TOO_MANY_LINKS
1150 The specified program requires a newer version of Windows.  ERROR_OLD_WIN_VERSION
1151 The specified program is not a Windows or MS-DOS program.  ERROR_APP_WRONG_OS
1152 Cannot start more than one instance of the specified program.  ERROR_SINGLE_INSTANCE_APP
1153 The specified program was written for an earlier version of Windows.  ERROR_RMODE_APP
1154 One of the library files needed to run this application is damaged.  ERROR_INVALID_DLL
1155 No application is associated with the specified file for this operation.  ERROR_NO_ASSOCIATION
1156 An error occurred in sending the command to the application.  ERROR_DDE_FAIL
1157 One of the library files needed to run this application cannot be found.  ERROR_DLL_NOT_FOUND
1158 The current process has used all of its system allowance of handles for Window Manager objects.  ERROR_NO_MORE_USER_HANDLES
1159 The message can be used only with synchronous operations.  ERROR_MESSAGE_SYNC_ONLY
1160 The indicated source element has no media.  ERROR_SOURCE_ELEMENT_EMPTY
1161 The indicated destination element already contains media.  ERROR_DESTINATION_ELEMENT_FULL
1162 The indicated element does not exist.  ERROR_ILLEGAL_ELEMENT_ADDRESS
1163 The indicated element is part of a magazine that is not present.  ERROR_MAGAZINE_NOT_PRESENT
1164 The indicated device requires reinitialization due to hardware errors.  ERROR_DEVICE_REINITIALIZATION_NEEDED
1165 The device has indicated that cleaning is required before further operations are attempted.  ERROR_DEVICE_REQUIRES_CLEANING
1166 The device has indicated that its door is open.  ERROR_DEVICE_DOOR_OPEN
1167 The device is not connected.  ERROR_DEVICE_NOT_CONNECTED
1168 Element not found.  ERROR_NOT_FOUND
1169 There was no match for the specified key in the index.  ERROR_NO_MATCH
1170 The property set specified does not exist on the object.  ERROR_SET_NOT_FOUND
1171 The point passed to GetMouseMovePoints is not in the buffer.  ERROR_POINT_NOT_FOUND
1172 The tracking (workstation) service is not running.  ERROR_NO_TRACKING_SERVICE
1173 The Volume ID could not be found.  ERROR_NO_VOLUME_ID
1200 The specified device name is invalid.  ERROR_BAD_DEVICE
1201 The device is not currently connected but it is a remembered connection.  ERROR_CONNECTION_UNAVAIL
1202 An attempt was made to remember a device that had previously been remembered.  ERROR_DEVICE_ALREADY_REMEMBERED
1203 No network provider accepted the given network path.  ERROR_NO_NET_OR_BAD_PATH
1204 The specified network provider name is invalid.  ERROR_BAD_PROVIDER
1205 Unable to open the network connection profile.  ERROR_CANNOT_OPEN_PROFILE
1206 The network connection profile is corrupted.  ERROR_BAD_PROFILE
1207 Cannot enumerate a noncontainer.  ERROR_NOT_CONTAINER
1208 An extended error has occurred.  ERROR_EXTENDED_ERROR
1209 The format of the specified group name is invalid.  ERROR_INVALID_GROUPNAME
1210 The format of the specified computer name is invalid.  ERROR_INVALID_COMPUTERNAME
1211 The format of the specified event name is invalid.  ERROR_INVALID_EVENTNAME
1212 The format of the specified domain name is invalid.  ERROR_INVALID_DOMAINNAME
1213 The format of the specified service name is invalid.  ERROR_INVALID_SERVICENAME
1214 The format of the specified network name is invalid.  ERROR_INVALID_NETNAME
1215 The format of the specified share name is invalid.  ERROR_INVALID_SHARENAME
1216 The format of the specified password is invalid.  ERROR_INVALID_PASSWORDNAME
1217 The format of the specified message name is invalid.  ERROR_INVALID_MESSAGENAME
1218 The format of the specified message destination is invalid.  ERROR_INVALID_MESSAGEDEST
1219 The credentials supplied conflict with an existing set of credentials.  ERROR_SESSION_CREDENTIAL_CONFLICT
1220 An attempt was made to establish a session to a network server, but there are already too many sessions established to that server.  ERROR_REMOTE_SESSION_LIMIT_EXCEEDED
1221 The workgroup or domain name is already in use by another computer on the network.  ERROR_DUP_DOMAINNAME
1222 The network is not present or not started.  ERROR_NO_NETWORK
1223 The operation was canceled by the user.  ERROR_CANCELLED
1224 The requested operation cannot be performed on a file with a user-mapped section open.  ERROR_USER_MAPPED_FILE
1225 The remote system refused the network connection.  ERROR_CONNECTION_REFUSED
1226 The network connection was gracefully closed.  ERROR_GRACEFUL_DISCONNECT
1227 The network transport endpoint already has an address associated with it.  ERROR_ADDRESS_ALREADY_ASSOCIATED
1228 An address has not yet been associated with the network endpoint.  ERROR_ADDRESS_NOT_ASSOCIATED
1229 An operation was attempted on a nonexistent network connection.  ERROR_CONNECTION_INVALID
1230 An invalid operation was attempted on an active network connection.  ERROR_CONNECTION_ACTIVE
1231 The remote network is not reachable by the transport.  ERROR_NETWORK_UNREACHABLE
1232 The remote system is not reachable by the transport.  ERROR_HOST_UNREACHABLE
1233 The remote system does not support the transport protocol.  ERROR_PROTOCOL_UNREACHABLE
1234 No service is operating at the destination network endpoint on the remote system.  ERROR_PORT_UNREACHABLE
1235 The request was aborted.  ERROR_REQUEST_ABORTED
1236 The network connection was aborted by the local system.  ERROR_CONNECTION_ABORTED
1237 The operation could not be completed. A retry should be performed.  ERROR_RETRY
1238 A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached.  ERROR_CONNECTION_COUNT_LIMIT
1239 Attempting to log in during an unauthorized time of day for this account.  ERROR_LOGIN_TIME_RESTRICTION
1240 The account is not authorized to log in from this station.  ERROR_LOGIN_WKSTA_RESTRICTION
1241 The network address could not be used for the operation requested.  ERROR_INCORRECT_ADDRESS
1242 The service is already registered.  ERROR_ALREADY_REGISTERED
1243 The specified service does not exist.  ERROR_SERVICE_NOT_FOUND
1244 The operation being requested was not performed because the user has not been authenticated.  ERROR_NOT_AUTHENTICATED
1245 The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist.  ERROR_NOT_LOGGED_ON
1246 Continue with work in progress.  ERROR_CONTINUE
1247 An attempt was made to perform an initialization operation when initialization has already been completed.  ERROR_ALREADY_INITIALIZED
1248 No more local devices.  ERROR_NO_MORE_DEVICES
1249 The specified site does not exist.  ERROR_NO_SUCH_SITE
1250 A domain controller with the specified name already exists.  ERROR_DOMAIN_CONTROLLER_EXISTS
1251 An error occurred while installing the Windows NT directory service. Please view the event log for more information.  ERROR_DS_NOT_INSTALLED
1300 Not all privileges referenced are assigned to the caller.  ERROR_NOT_ALL_ASSIGNED
1301 Some mapping between account names and security IDs was not done.  ERROR_SOME_NOT_MAPPED
1302 No system quota limits are specifically set for this account.  ERROR_NO_QUOTAS_FOR_ACCOUNT
1303 No encryption key is available. A well-known encryption key was returned.  ERROR_LOCAL_USER_SESSION_KEY
1304 The Windows NT password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string.  ERROR_NULL_LM_PASSWORD
1305 The revision level is unknown.  ERROR_UNKNOWN_REVISION
1306 Indicates two revision levels are incompatible.  ERROR_REVISION_MISMATCH
1307 This security ID may not be assigned as the owner of this object.  ERROR_INVALID_OWNER
1308 This security ID may not be assigned as the primary group of an object.  ERROR_INVALID_PRIMARY_GROUP
1309 An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client.  ERROR_NO_IMPERSONATION_TOKEN
1310 The group may not be disabled.  ERROR_CANT_DISABLE_MANDATORY
1311 There are currently no logon servers available to service the logon request.  ERROR_NO_LOGON_SERVERS
1312 A specified logon session does not exist. It may already have been terminated.  ERROR_NO_SUCH_LOGON_SESSION
1313 A specified privilege does not exist.  ERROR_NO_SUCH_PRIVILEGE
1314 A required privilege is not held by the client.  ERROR_PRIVILEGE_NOT_HELD
1315 The name provided is not a properly formed account name.  ERROR_INVALID_ACCOUNT_NAME
1316 The specified user already exists.  ERROR_USER_EXISTS
1317 The specified user does not exist.  ERROR_NO_SUCH_USER
1318 The specified group already exists.  ERROR_GROUP_EXISTS
1319 The specified group does not exist.  ERROR_NO_SUCH_GROUP
1320 Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member.  ERROR_MEMBER_IN_GROUP
1321 The specified user account is not a member of the specified group account.  ERROR_MEMBER_NOT_IN_GROUP
1322 The last remaining administration account cannot be disabled or deleted.  ERROR_LAST_ADMIN
1323 Unable to update the password. The value provided as the current password is incorrect.  ERROR_WRONG_PASSWORD
1324 Unable to update the password. The value provided for the new password contains values that are not allowed in passwords.  ERROR_ILL_FORMED_PASSWORD
1325 Unable to update the password because a password update rule has been violated.  ERROR_PASSWORD_RESTRICTION
1326 Logon failure: unknown user name or bad password.  ERROR_LOGON_FAILURE
1327 Logon failure: user account restriction.  ERROR_ACCOUNT_RESTRICTION
1328 Logon failure: account logon time restriction violation.  ERROR_INVALID_LOGON_HOURS
1329 Logon failure: user not allowed to log on to this computer.  ERROR_INVALID_WORKSTATION
1330 Logon failure: the specified account password has expired.  ERROR_PASSWORD_EXPIRED
1331 Logon failure: account currently disabled.  ERROR_ACCOUNT_DISABLED
1332 No mapping between account names and security IDs was done.  ERROR_NONE_MAPPED
1333 Too many local user identifiers (LUIDs) were requested at one time.  ERROR_TOO_MANY_LUIDS_REQUESTED
1334 No more local user identifiers (LUIDs) are available.  ERROR_LUIDS_EXHAUSTED
1335 The subauthority part of a security ID is invalid for this particular use.  ERROR_INVALID_SUB_AUTHORITY
1336 The access control list (ACL) structure is invalid.  ERROR_INVALID_ACL
1337 The security ID structure is invalid.  ERROR_INVALID_SID
1338 The security descriptor structure is invalid.  ERROR_INVALID_SECURITY_DESCR
1340 The inherited access control list (ACL) or access control entry (ACE) could not be built.  ERROR_BAD_INHERITANCE_ACL
1341 The server is currently disabled.  ERROR_SERVER_DISABLED
1342 The server is currently enabled.  ERROR_SERVER_NOT_DISABLED
1343 The value provided was an invalid value for an identifier authority.  ERROR_INVALID_ID_AUTHORITY
1344 No more memory is available for security information updates.  ERROR_ALLOTTED_SPACE_EXCEEDED
1345 The specified attributes are invalid, or incompatible with the attributes for the group as a whole.  ERROR_INVALID_GROUP_ATTRIBUTES
1346 Either a required impersonation level was not provided, or the provided impersonation level is invalid.  ERROR_BAD_IMPERSONATION_LEVEL
1347 Cannot open an anonymous level security token.  ERROR_CANT_OPEN_ANONYMOUS
1348 The validation information class requested was invalid.  ERROR_BAD_VALIDATION_CLASS
1349 The type of the token is inappropriate for its attempted use.  ERROR_BAD_TOKEN_TYPE
1350 Unable to perform a security operation on an object that has no associated security.  ERROR_NO_SECURITY_ON_OBJECT
1351 Indicates a Windows NT Server could not be contacted or that objects within the domain are protected such that necessary information could not be retrieved.  ERROR_CANT_ACCESS_DOMAIN_INFO
1352 The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation.  ERROR_INVALID_SERVER_STATE
1353 The domain was in the wrong state to perform the security operation.  ERROR_INVALID_DOMAIN_STATE
1354 This operation is only allowed for the Primary Domain Controller of the domain.  ERROR_INVALID_DOMAIN_ROLE
1355 The specified domain did not exist.  ERROR_NO_SUCH_DOMAIN
1356 The specified domain already exists.  ERROR_DOMAIN_EXISTS
1357 An attempt was made to exceed the limit on the number of domains per server.  ERROR_DOMAIN_LIMIT_EXCEEDED
1358 Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.  ERROR_INTERNAL_DB_CORRUPTION
1359 The security account database contains an internal inconsistency.  ERROR_INTERNAL_ERROR
1360 Generic access types were contained in an access mask which should already be mapped to nongeneric types.  ERROR_GENERIC_NOT_MAPPED
1361 A security descriptor is not in the right format (absolute or self-relative).  ERROR_BAD_DESCRIPTOR_FORMAT
1362 The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process.  ERROR_NOT_LOGON_PROCESS
1363 Cannot start a new logon session with an ID that is already in use.  ERROR_LOGON_SESSION_EXISTS
1364 A specified authentication package is unknown.  ERROR_NO_SUCH_PACKAGE
1365 The logon session is not in a state that is consistent with the requested operation.  ERROR_BAD_LOGON_SESSION_STATE
1366 The logon session ID is already in use.  ERROR_LOGON_SESSION_COLLISION
1367 A logon request contained an invalid logon type value.  ERROR_INVALID_LOGON_TYPE
1368 Unable to impersonate using a named pipe until data has been read from that pipe.  ERROR_CANNOT_IMPERSONATE
1369 The transaction state of a registry subtree is incompatible with the requested operation.  ERROR_RXACT_INVALID_STATE
1370 An internal security database corruption has been encountered.  ERROR_RXACT_COMMIT_FAILURE
1371 Cannot perform this operation on built-in accounts.  ERROR_SPECIAL_ACCOUNT
1372 Cannot perform this operation on this built-in special group.  ERROR_SPECIAL_GROUP
1373 Cannot perform this operation on this built-in special user.  ERROR_SPECIAL_USER
1374 The user cannot be removed from a group because the group is currently the user's primary group.  ERROR_MEMBERS_PRIMARY_GROUP
1375 The token is already in use as a primary token.  ERROR_TOKEN_ALREADY_IN_USE
1376 The specified local group does not exist.  ERROR_NO_SUCH_ALIAS
1377 The specified account name is not a member of the local group.  ERROR_MEMBER_NOT_IN_ALIAS
1378 The specified account name is already a member of the local group.  ERROR_MEMBER_IN_ALIAS
1379 The specified local group already exists.  ERROR_ALIAS_EXISTS
1380 Logon failure: the user has not been granted the requested logon type at this computer.  ERROR_LOGON_NOT_GRANTED
1381 The maximum number of secrets that may be stored in a single system has been exceeded.  ERROR_TOO_MANY_SECRETS
1382 The length of a secret exceeds the maximum length allowed.  ERROR_SECRET_TOO_LONG
1383 The local security authority database contains an internal inconsistency.  ERROR_INTERNAL_DB_ERROR
1384 During a logon attempt, the user's security context accumulated too many security IDs.  ERROR_TOO_MANY_CONTEXT_IDS
1385 Logon failure: the user has not been granted the requested logon type at this computer.  ERROR_LOGON_TYPE_NOT_GRANTED
1386 A cross-encrypted password is necessary to change a user password.  ERROR_NT_CROSS_ENCRYPTION_REQUIRED
1387 A new member could not be added to a local group because the member does not exist.  ERROR_NO_SUCH_MEMBER
1388 A new member could not be added to a local group because the member has the wrong account type.  ERROR_INVALID_MEMBER
1389 Too many security IDs have been specified.  ERROR_TOO_MANY_SIDS
1390 A cross-encrypted password is necessary to change this user password.  ERROR_LM_CROSS_ENCRYPTION_REQUIRED
1391 Indicates an ACL contains no inheritable components.  ERROR_NO_INHERITANCE
1392 The file or directory is corrupted and unreadable.  ERROR_FILE_CORRUPT
1393 The disk structure is corrupted and unreadable.  ERROR_DISK_CORRUPT
1394 There is no user session key for the specified logon session.  ERROR_NO_USER_SESSION_KEY
1395 The service being accessed is licensed for a particular number of connections. No more connections can be made to the service at this time because there are already as many connections as the service can accept.  ERROR_LICENSE_QUOTA_EXCEEDED
1400 Invalid window handle.  ERROR_INVALID_WINDOW_HANDLE
1401 Invalid menu handle.  ERROR_INVALID_MENU_HANDLE
1402 Invalid cursor handle.  ERROR_INVALID_CURSOR_HANDLE
1403 Invalid accelerator table handle.  ERROR_INVALID_ACCEL_HANDLE
1404 Invalid hook handle.  ERROR_INVALID_HOOK_HANDLE
1405 Invalid handle to a multiple-window position structure.  ERROR_INVALID_DWP_HANDLE
1406 Cannot create a top-level child window.  ERROR_TLW_WITH_WSCHILD
1407 Cannot find window class.  ERROR_CANNOT_FIND_WND_CLASS
1408 Invalid window; it belongs to other thread.  ERROR_WINDOW_OF_OTHER_THREAD
1409 Hot key is already registered.  ERROR_HOTKEY_ALREADY_REGISTERED
1410 Class already exists.  ERROR_CLASS_ALREADY_EXISTS
1411 Class does not exist.  ERROR_CLASS_DOES_NOT_EXIST
1412 Class still has open windows.  ERROR_CLASS_HAS_WINDOWS
1413 Invalid index.  ERROR_INVALID_INDEX
1414 Invalid icon handle.  ERROR_INVALID_ICON_HANDLE
1415 Using private DIALOG window words.  ERROR_PRIVATE_DIALOG_INDEX
1416 The list box identifier was not found.  ERROR_LISTBOX_ID_NOT_FOUND
1417 No wildcards were found.  ERROR_NO_WILDCARD_CHARACTERS
1418 Thread does not have a clipboard open.  ERROR_CLIPBOARD_NOT_OPEN
1419 Hot key is not registered.  ERROR_HOTKEY_NOT_REGISTERED
1420 The window is not a valid dialog window.  ERROR_WINDOW_NOT_DIALOG
1421 Control ID not found.  ERROR_CONTROL_ID_NOT_FOUND
1422 Invalid message for a combo box because it does not have an edit control.  ERROR_INVALID_COMBOBOX_MESSAGE
1423 The window is not a combo box.  ERROR_WINDOW_NOT_COMBOBOX
1424 Height must be less than 256.  ERROR_INVALID_EDIT_HEIGHT
1425 Invalid device context (DC) handle.  ERROR_DC_NOT_FOUND
1426 Invalid hook procedure type.  ERROR_INVALID_HOOK_FILTER
1427 Invalid hook procedure.  ERROR_INVALID_FILTER_PROC
1428 Cannot set nonlocal hook without a module handle.  ERROR_HOOK_NEEDS_HMOD
1429 This hook procedure can only be set globally.  ERROR_GLOBAL_ONLY_HOOK
1430 The journal hook procedure is already installed.  ERROR_JOURNAL_HOOK_SET
1431 The hook procedure is not installed.  ERROR_HOOK_NOT_INSTALLED
1432 Invalid message for single-selection list box.  ERROR_INVALID_LB_MESSAGE
1433 LB_SETCOUNT sent to non-lazy list box.  ERROR_SETCOUNT_ON_BAD_LB
1434 This list box does not support tab stops.  ERROR_LB_WITHOUT_TABSTOPS
1435 Cannot destroy object created by another thread.  ERROR_DESTROY_OBJECT_OF_OTHER_THREAD
1436 Child windows cannot have menus.  ERROR_CHILD_WINDOW_MENU
1437 The window does not have a system menu.  ERROR_NO_SYSTEM_MENU
1438 Invalid message box style.  ERROR_INVALID_MSGBOX_STYLE
1439 Invalid system-wide (SPI_*) parameter.  ERROR_INVALID_SPI_VALUE
1440 Screen already locked.  ERROR_SCREEN_ALREADY_LOCKED
1441 All handles to windows in a multiple-window position structure must have the same parent.  ERROR_HWNDS_HAVE_DIFF_PARENT
1442 The window is not a child window.  ERROR_NOT_CHILD_WINDOW
1443 Invalid GW_* command.  ERROR_INVALID_GW_COMMAND
1444 Invalid thread identifier.  ERROR_INVALID_THREAD_ID
1445 Cannot process a message from a window that is not a multiple document interface (MDI) window.  ERROR_NON_MDICHILD_WINDOW
1446 Popup menu already active.  ERROR_POPUP_ALREADY_ACTIVE
1447 The window does not have scroll bars.  ERROR_NO_SCROLLBARS
1448 Scroll bar range cannot be greater than 0x7FFF.  ERROR_INVALID_SCROLLBAR_RANGE
1449 Cannot show or remove the window in the way specified.  ERROR_INVALID_SHOWWIN_COMMAND
1450 Insufficient system resources exist to complete the requested service.  ERROR_NO_SYSTEM_RESOURCES
1451 Insufficient system resources exist to complete the requested service.  ERROR_NONPAGED_SYSTEM_RESOURCES
1452 Insufficient system resources exist to complete the requested service.  ERROR_PAGED_SYSTEM_RESOURCES
1453 Insufficient quota to complete the requested service.  ERROR_WORKING_SET_QUOTA
1454 Insufficient quota to complete the requested service.  ERROR_PAGEFILE_QUOTA
1455 The paging file is too small for this operation to complete.  ERROR_COMMITMENT_LIMIT
1456 A menu item was not found.  ERROR_MENU_ITEM_NOT_FOUND
1457 Invalid keyboard layout handle.  ERROR_INVALID_KEYBOARD_HANDLE
1458 Hook type not allowed.  ERROR_HOOK_TYPE_NOT_ALLOWED
1459 This operation requires an interactive window station.  ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
1460 This operation returned because the timeout period expired.  ERROR_TIMEOUT
1461 Invalid monitor handle.  ERROR_INVALID_MONITOR_HANDLE
1500 The event log file is corrupted.  ERROR_EVENTLOG_FILE_CORRUPT
1501 No event log file could be opened, so the event logging service did not start.  ERROR_EVENTLOG_CANT_START
1502 The event log file is full.  ERROR_LOG_FILE_FULL
1503 The event log file has changed between read operations.  ERROR_EVENTLOG_FILE_CHANGED
1601 Failure accessing install service.  ERROR_INSTALL_SERVICE
1602 The user canceled the installation.  ERROR_INSTALL_USEREXIT
1603 Fatal error during installation.  ERROR_INSTALL_FAILURE
1604 Installation suspended, incomplete.  ERROR_INSTALL_SUSPEND
1605 Product code not registered.  ERROR_UNKNOWN_PRODUCT
1606 Feature ID not registered.  ERROR_UNKNOWN_FEATURE
1607 Component ID not registered.  ERROR_UNKNOWN_COMPONENT
1608 Unknown property.  ERROR_UNKNOWN_PROPERTY
1609 Handle is in an invalid state.  ERROR_INVALID_HANDLE_STATE
1610 Configuration data corrupt.  ERROR_BAD_CONFIGURATION
1611 Language not available.  ERROR_INDEX_ABSENT
1612 Install source unavailable.  ERROR_INSTALL_SOURCE_ABSENT
1613 Database version unsupported.  ERROR_BAD_DATABASE_VERSION
1614 Product is uninstalled.  ERROR_PRODUCT_UNINSTALLED
1615 SQL query syntax invalid or unsupported.  ERROR_BAD_QUERY_SYNTAX
1616 Record field does not exist.  ERROR_INVALID_FIELD
1700 The string binding is invalid.  RPC_S_INVALID_STRING_BINDING
1701 The binding handle is not the correct type.  RPC_S_WRONG_KIND_OF_BINDING
1702 The binding handle is invalid.  RPC_S_INVALID_BINDING
1703 The RPC protocol sequence is not supported.  RPC_S_PROTSEQ_NOT_SUPPORTED
1704 The RPC protocol sequence is invalid.  RPC_S_INVALID_RPC_PROTSEQ
1705 The string universal unique identifier (UUID) is invalid.  RPC_S_INVALID_STRING_UUID
1706 The endpoint format is invalid.  RPC_S_INVALID_ENDPOINT_FORMAT
1707 The network address is invalid.  RPC_S_INVALID_NET_ADDR
1708 No endpoint was found.  RPC_S_NO_ENDPOINT_FOUND
1709 The timeout value is invalid.  RPC_S_INVALID_TIMEOUT
1710 The object universal unique identifier (UUID) was not found.  RPC_S_OBJECT_NOT_FOUND
1711 The object universal unique identifier (UUID) has already been registered.  RPC_S_ALREADY_REGISTERED
1712 The type universal unique identifier (UUID) has already been registered.  RPC_S_TYPE_ALREADY_REGISTERED
1713 The RPC server is already listening.  RPC_S_ALREADY_LISTENING
1714 No protocol sequences have been registered.  RPC_S_NO_PROTSEQS_REGISTERED
1715 The RPC server is not listening.  RPC_S_NOT_LISTENING
1716 The manager type is unknown.  RPC_S_UNKNOWN_MGR_TYPE
1717 The interface is unknown.  RPC_S_UNKNOWN_IF
1718 There are no bindings.  RPC_S_NO_BINDINGS
1719 There are no protocol sequences.  RPC_S_NO_PROTSEQS
1720 The endpoint cannot be created.  RPC_S_CANT_CREATE_ENDPOINT
1721 Not enough resources are available to complete this operation.  RPC_S_OUT_OF_RESOURCES
1722 The RPC server is unavailable.  RPC_S_SERVER_UNAVAILABLE
1723 The RPC server is too busy to complete this operation.  RPC_S_SERVER_TOO_BUSY
1724 The network options are invalid.  RPC_S_INVALID_NETWORK_OPTIONS
1725 There are no remote procedure calls active on this thread.  RPC_S_NO_CALL_ACTIVE
1726 The remote procedure call failed.  RPC_S_CALL_FAILED
1727 The remote procedure call failed and did not execute.  RPC_S_CALL_FAILED_DNE
1728 A remote procedure call (RPC) protocol error occurred.  RPC_S_PROTOCOL_ERROR
1730 The transfer syntax is not supported by the RPC server.  RPC_S_UNSUPPORTED_TRANS_SYN
1732 The universal unique identifier (UUID) type is not supported.  RPC_S_UNSUPPORTED_TYPE
1733 The tag is invalid.  RPC_S_INVALID_TAG
1734 The array bounds are invalid.  RPC_S_INVALID_BOUND
1735 The binding does not contain an entry name.  RPC_S_NO_ENTRY_NAME
1736 The name syntax is invalid.  RPC_S_INVALID_NAME_SYNTAX
1737 The name syntax is not supported.  RPC_S_UNSUPPORTED_NAME_SYNTAX
1739 No network address is available to use to construct a universal unique identifier (UUID).  RPC_S_UUID_NO_ADDRESS
1740 The endpoint is a duplicate.  RPC_S_DUPLICATE_ENDPOINT
1741 The authentication type is unknown.  RPC_S_UNKNOWN_AUTHN_TYPE
1742 The maximum number of calls is too small.  RPC_S_MAX_CALLS_TOO_SMALL
1743 The string is too long.  RPC_S_STRING_TOO_LONG
1744 The RPC protocol sequence was not found.  RPC_S_PROTSEQ_NOT_FOUND
1745 The procedure number is out of range.  RPC_S_PROCNUM_OUT_OF_RANGE
1746 The binding does not contain any authentication information.  RPC_S_BINDING_HAS_NO_AUTH
1747 The authentication service is unknown.  RPC_S_UNKNOWN_AUTHN_SERVICE
1748 The authentication level is unknown.  RPC_S_UNKNOWN_AUTHN_LEVEL
1749 The security context is invalid.  RPC_S_INVALID_AUTH_IDENTITY
1750 The authorization service is unknown.  RPC_S_UNKNOWN_AUTHZ_SERVICE
1751 The entry is invalid.  EPT_S_INVALID_ENTRY
1752 The server endpoint cannot perform the operation.  EPT_S_CANT_PERFORM_OP
1753 There are no more endpoints available from the endpoint mapper.  EPT_S_NOT_REGISTERED
1754 No interfaces have been exported.  RPC_S_NOTHING_TO_EXPORT
1755 The entry name is incomplete.  RPC_S_INCOMPLETE_NAME
1756 The version option is invalid.  RPC_S_INVALID_VERS_OPTION
1757 There are no more members.  RPC_S_NO_MORE_MEMBERS
1758 There is nothing to unexport.  RPC_S_NOT_ALL_OBJS_UNEXPORTED
1759 The interface was not found.  RPC_S_INTERFACE_NOT_FOUND
1760 The entry already exists.  RPC_S_ENTRY_ALREADY_EXISTS
1761 The entry is not found.  RPC_S_ENTRY_NOT_FOUND
1762 The name service is unavailable.  RPC_S_NAME_SERVICE_UNAVAILABLE
1763 The network address family is invalid.  RPC_S_INVALID_NAF_ID
1764 The requested operation is not supported.  RPC_S_CANNOT_SUPPORT
1765 No security context is available to allow impersonation.  RPC_S_NO_CONTEXT_AVAILABLE
1766 An internal error occurred in a remote procedure call (RPC).  RPC_S_INTERNAL_ERROR
1767 The RPC server attempted an integer division by zero.  RPC_S_ZERO_DIVIDE
1768 An addressing error occurred in the RPC server.  RPC_S_ADDRESS_ERROR
1769 A floating-point operation at the RPC server caused a division by zero.  RPC_S_FP_DIV_ZERO
1770 A floating-point underflow occurred at the RPC server.  RPC_S_FP_UNDERFLOW
1771 A floating-point overflow occurred at the RPC server.  RPC_S_FP_OVERFLOW
1772 The list of RPC servers available for the binding of auto handles has been exhausted.  RPC_X_NO_MORE_ENTRIES
1773 Unable to open the character translation table file.  RPC_X_SS_CHAR_TRANS_OPEN_FAIL
1774 The file containing the character translation table has fewer than bytes.  RPC_X_SS_CHAR_TRANS_SHORT_FILE
1775 A null context handle was passed from the client to the host during a remote procedure call.  RPC_X_SS_IN_NULL_CONTEXT
1777 The context handle changed during a remote procedure call.  RPC_X_SS_CONTEXT_DAMAGED
1778 The binding handles passed to a remote procedure call do not match.  RPC_X_SS_HANDLES_MISMATCH
1779 The stub is unable to get the remote procedure call handle.  RPC_X_SS_CANNOT_GET_CALL_HANDLE
1780 A null reference pointer was passed to the stub.  RPC_X_NULL_REF_POINTER
1781 The enumeration value is out of range.  RPC_X_ENUM_VALUE_OUT_OF_RANGE
1782 The byte count is too small.  RPC_X_BYTE_COUNT_TOO_SMALL
1783 The stub received bad data.  RPC_X_BAD_STUB_DATA
1784 The supplied user buffer is not valid for the requested operation.  ERROR_INVALID_USER_BUFFER
1785 The disk media is not recognized. It may not be formatted.  ERROR_UNRECOGNIZED_MEDIA
1786 The workstation does not have a trust secret.  ERROR_NO_TRUST_LSA_SECRET
1787 The SAM database on the Windows NT Server does not have a computer account for this workstation trust relationship.  ERROR_NO_TRUST_SAM_ACCOUNT
1788 The trust relationship between the primary domain and the trusted domain failed.  ERROR_TRUSTED_DOMAIN_FAILURE
1789 The trust relationship between this workstation and the primary domain failed.  ERROR_TRUSTED_RELATIONSHIP_FAILURE
1790 The network logon failed.  ERROR_TRUST_FAILURE
1791 A remote procedure call is already in progress for this thread.  RPC_S_CALL_IN_PROGRESS
1792 An attempt was made to logon, but the network logon service was not started.  ERROR_NETLOGON_NOT_STARTED
1793 The user's account has expired.  ERROR_ACCOUNT_EXPIRED
1794 The redirector is in use and cannot be unloaded.  ERROR_REDIRECTOR_HAS_OPEN_HANDLES
1795 The specified printer driver is already installed.  ERROR_PRINTER_DRIVER_ALREADY_INSTALLED
1796 The specified port is unknown.  ERROR_UNKNOWN_PORT
1797 The printer driver is unknown.  ERROR_UNKNOWN_PRINTER_DRIVER
1798 The print processor is unknown.  ERROR_UNKNOWN_PRINTPROCESSOR
1799 The specified separator file is invalid.  ERROR_INVALID_SEPARATOR_FILE
1800 The specified priority is invalid.  ERROR_INVALID_PRIORITY
1801 The printer name is invalid.  ERROR_INVALID_PRINTER_NAME
1802 The printer already exists.  ERROR_PRINTER_ALREADY_EXISTS
1803 The printer command is invalid.  ERROR_INVALID_PRINTER_COMMAND
1804 The specified datatype is invalid.  ERROR_INVALID_DATATYPE
1805 The environment specified is invalid.  ERROR_INVALID_ENVIRONMENT
1806 There are no more bindings.  RPC_S_NO_MORE_BINDINGS
1807 The account used is an interdomain trust account. Use your global user account or local user account to access this server.  ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT
1808 The account used is a computer account. Use your global user account or local user account to access this server.  ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT
1809 The account used is a server trust account. Use your global user account or local user account to access this server.  ERROR_NOLOGON_SERVER_TRUST_ACCOUNT
1810 The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain.  ERROR_DOMAIN_TRUST_INCONSISTENT
1811 The server is in use and cannot be unloaded.  ERROR_SERVER_HAS_OPEN_HANDLES
1812 The specified image file did not contain a resource section.  ERROR_RESOURCE_DATA_NOT_FOUND
1813 The specified resource type cannot be found in the image file.  ERROR_RESOURCE_TYPE_NOT_FOUND
1814 The specified resource name cannot be found in the image file.  ERROR_RESOURCE_NAME_NOT_FOUND
1815 The specified resource language ID cannot be found in the image file.  ERROR_RESOURCE_LANG_NOT_FOUND
1816 Not enough quota is available to process this command.  ERROR_NOT_ENOUGH_QUOTA
1817 No interfaces have been registered.  RPC_S_NO_INTERFACES
1818 The remote procedure call was cancelled.  RPC_S_CALL_CANCELLED
1819 The binding handle does not contain all required information.  RPC_S_BINDING_INCOMPLETE
1820 A communications failure occurred during a remote procedure call.  RPC_S_COMM_FAILURE
1821 The requested authentication level is not supported.  RPC_S_UNSUPPORTED_AUTHN_LEVEL
1822 No principal name registered.  RPC_S_NO_PRINC_NAME
1823 The error specified is not a valid Windows RPC error code.  RPC_S_NOT_RPC_ERROR
1824 A UUID that is valid only on this computer has been allocated.  RPC_S_UUID_LOCAL_ONLY
1825 A security package specific error occurred.  RPC_S_SEC_PKG_ERROR
1826 Thread is not canceled.  RPC_S_NOT_CANCELLED
1827 Invalid operation on the encoding/decoding handle.  RPC_X_INVALID_ES_ACTION
1828 Incompatible version of the serializing package.  RPC_X_WRONG_ES_VERSION
1829 Incompatible version of the RPC stub.  RPC_X_WRONG_STUB_VERSION
1830 The RPC pipe object is invalid or corrupted.  RPC_X_INVALID_PIPE_OBJECT
1831 An invalid operation was attempted on an RPC pipe object.  RPC_X_WRONG_PIPE_ORDER
1832 Unsupported RPC pipe version.  RPC_X_WRONG_PIPE_VERSION
1898 The group member was not found.  RPC_S_GROUP_MEMBER_NOT_FOUND
1899 The endpoint mapper database entry could not be created.  EPT_S_CANT_CREATE
1900 The object universal unique identifier (UUID) is the nil UUID.  RPC_S_INVALID_OBJECT
1901 The specified time is invalid.  ERROR_INVALID_TIME
1902 The specified form name is invalid.  ERROR_INVALID_FORM_NAME
1903 The specified form size is invalid.  ERROR_INVALID_FORM_SIZE
1904 The specified printer handle is already being waited on  ERROR_ALREADY_WAITING
1905 The specified printer has been deleted.  ERROR_PRINTER_DELETED
1906 The state of the printer is invalid.  ERROR_INVALID_PRINTER_STATE
1907 The user must change his password before he logs on the first time.  ERROR_PASSWORD_MUST_CHANGE
1908 Could not find the domain controller for this domain.  ERROR_DOMAIN_CONTROLLER_NOT_FOUND
1909 The referenced account is currently locked out and may not be logged on to.  ERROR_ACCOUNT_LOCKED_OUT
1910 The object exporter specified was not found.  OR_INVALID_OXID
1911 The object specified was not found.  OR_INVALID_OID
1912 The object resolver set specified was not found.  OR_INVALID_SET
1913 Some data remains to be sent in the request buffer.  RPC_S_SEND_INCOMPLETE
1914 Invalid asynchronous remote procedure call handle.  RPC_S_INVALID_ASYNC_HANDLE
1915 Invalid asynchronous RPC call handle for this operation.  RPC_S_INVALID_ASYNC_CALL
1916 The RPC pipe object has already been closed.  RPC_X_PIPE_CLOSED
1917 The RPC call completed before all pipes were processed.  RPC_X_PIPE_DISCIPLINE_ERROR
1918 No more data is available from the RPC pipe.  RPC_X_PIPE_EMPTY
1919 No site name is available for this machine.  ERROR_NO_SITENAME
1920 The file can not be accessed by the system.  ERROR_CANT_ACCESS_FILE
1921 The name of the file cannot be resolved by the system.  ERROR_CANT_RESOLVE_FILENAME
1922 The directory service evaluated group memberships locally.  ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY
1923 The specified directory service attribute or value does not exist.  ERROR_DS_NO_ATTRIBUTE_OR_VALUE
1924 The attribute syntax specified to the directory service is invalid.  ERROR_DS_INVALID_ATTRIBUTE_SYNTAX
1925 The attribute type specified to the directory service is not defined.  ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED
1926 The specified directory service attribute or value already exists.  ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS
1927 The directory service is busy.  ERROR_DS_BUSY
1928 The directory service is unavailable.  ERROR_DS_UNAVAILABLE
1929 The directory service was unable to allocate a relative identifier.  ERROR_DS_NO_RIDS_ALLOCATED
1930 The directory service has exhausted the pool of relative identifiers.  ERROR_DS_NO_MORE_RIDS
1931 The requested operation could not be performed because the directory service is not the master for that type of operation.  ERROR_DS_INCORRECT_ROLE_OWNER
1932 The directory service was unable to initialize the subsystem that allocates relative identifiers.  ERROR_DS_RIDMGR_INIT_ERROR
1933 The requested operation did not satisfy one or more constraints associated with the class of the object.  ERROR_DS_OBJ_CLASS_VIOLATION
1934 The directory service can perform the requested operation only on a leaf object.  ERROR_DS_CANT_ON_NON_LEAF
1935 The directory service cannot perform the requested operation on the RDN attribute of an object.  ERROR_DS_CANT_ON_RDN
1936 The directory service detected an attempt to modify the object class of an object.  ERROR_DS_CANT_MOD_OBJ_CLASS
1937 The requested cross domain move operation could not be performed.  ERROR_DS_CROSS_DOM_MOVE_ERROR
1938 Unable to contact the global catalog server.  ERROR_DS_GC_NOT_AVAILABLE
2000 The pixel format is invalid.  ERROR_INVALID_PIXEL_FORMAT
2001 The specified driver is invalid.  ERROR_BAD_DRIVER
2002 The window style or class attribute is invalid for this operation.  ERROR_INVALID_WINDOW_STYLE
2003 The requested metafile operation is not supported.  ERROR_METAFILE_NOT_SUPPORTED
2004 The requested transformation operation is not supported.  ERROR_TRANSFORM_NOT_SUPPORTED
2005 The requested clipping operation is not supported.  ERROR_CLIPPING_NOT_SUPPORTED
2108 The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified.  ERROR_CONNECTED_OTHER_PASSWORD
2202 The specified username is invalid.  ERROR_BAD_USERNAME
2250 This network connection does not exist.  ERROR_NOT_CONNECTED
2300 The specified color management module is invalid.  ERROR_INVALID_CMM
2301 The specified color profile is invalid.  ERROR_INVALID_PROFILE
2302 The specified tag was not found.  ERROR_TAG_NOT_FOUND
2303 A required tag is not present.  ERROR_TAG_NOT_PRESENT
2304 The specified tag is already present.  ERROR_DUPLICATE_TAG
2305 The specified color profile is not associated with any device.  ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE
2306 The specified color profile was not found.  ERROR_PROFILE_NOT_FOUND
2307 The specified color space is invalid.  ERROR_INVALID_COLORSPACE
2308 Image Color Management is not enabled.  ERROR_ICM_NOT_ENABLED
2309 There was an error while deleting the color transform.  ERROR_DELETING_ICM_XFORM
2310 The specified color transform is invalid.  ERROR_INVALID_TRANSFORM
2401 This network connection has files open or requests pending.  ERROR_OPEN_FILES
2402 Active connections still exist.  ERROR_ACTIVE_CONNECTIONS
2404 The device is in use by an active process and cannot be disconnected.  ERROR_DEVICE_IN_USE
3000 The specified print monitor is unknown.  ERROR_UNKNOWN_PRINT_MONITOR
3001 The specified printer driver is currently in use.  ERROR_PRINTER_DRIVER_IN_USE
3002 The spool file was not found.  ERROR_SPOOL_FILE_NOT_FOUND
3003 A StartDocPrinter call was not issued.  ERROR_SPL_NO_STARTDOC
3004 An AddJob call was not issued.  ERROR_SPL_NO_ADDJOB
3005 The specified print processor has already been installed.  ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED
3006 The specified print monitor has already been installed.  ERROR_PRINT_MONITOR_ALREADY_INSTALLED
3007 The specified print monitor does not have the required functions.  ERROR_INVALID_PRINT_MONITOR
3008 The specified print monitor is currently in use.  ERROR_PRINT_MONITOR_IN_USE
3009 The requested operation is not allowed when there are jobs queued to the printer.  ERROR_PRINTER_HAS_JOBS_QUEUED
3010 The requested operation is successful. Changes will not be effective until the system is rebooted.  ERROR_SUCCESS_REBOOT_REQUIRED
3011 The requested operation is successful. Changes will not be effective until the service is restarted.  ERROR_SUCCESS_RESTART_REQUIRED
4000 WINS encountered an error while processing the command.  ERROR_WINS_INTERNAL
4001 The local WINS can not be deleted.  ERROR_CAN_NOT_DEL_LOCAL_WINS
4002 The importation from the file failed.  ERROR_STATIC_INIT
4003 The backup failed. Was a full backup done before?  ERROR_INC_BACKUP
4004 The backup failed. Check the directory to which you are backing the database.  ERROR_FULL_BACKUP
4005 The name does not exist in the WINS database.  ERROR_REC_NON_EXISTENT
4006 Replication with a nonconfigured partner is not allowed.  ERROR_RPL_NOT_ALLOWED
4100 The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address.  ERROR_DHCP_ADDRESS_CONFLICT
4200 The GUID passed was not recognized as valid by a WMI data provider.  ERROR_WMI_GUID_NOT_FOUND
4201 The instance name passed was not recognized as valid by a WMI data provider.  ERROR_WMI_INSTANCE_NOT_FOUND
4202 The data item ID passed was not recognized as valid by a WMI data provider.  ERROR_WMI_ITEMID_NOT_FOUND
4203 The WMI request could not be completed and should be retried.  ERROR_WMI_TRY_AGAIN
4204 The WMI data provider could not be located.  ERROR_WMI_DP_NOT_FOUND
4205 The WMI data provider references an instance set that has not been registered.  ERROR_WMI_UNRESOLVED_INSTANCE_REF
4206 The WMI data block or event notification has already been enabled.  ERROR_WMI_ALREADY_ENABLED
4207 The WMI data block is no longer available.  ERROR_WMI_GUID_DISCONNECTED
4208 The WMI data service is not available.  ERROR_WMI_SERVER_UNAVAILABLE
4209 The WMI data provider failed to carry out the request.  ERROR_WMI_DP_FAILED
4210 The WMI MOF information is not valid.  ERROR_WMI_INVALID_MOF
4211 The WMI registration information is not valid.  ERROR_WMI_INVALID_REGINFO
4300 The media identifier does not represent a valid medium.  ERROR_INVALID_MEDIA
4301 The library identifier does not represent a valid library.  ERROR_INVALID_LIBRARY
4302 The media pool identifier does not represent a valid media pool.  ERROR_INVALID_MEDIA_POOL
4303 The drive and medium are not compatible or exist in different libraries.  ERROR_DRIVE_MEDIA_MISMATCH
4304 The medium currently exists in an offline library and must be online to perform this operation.  ERROR_MEDIA_OFFLINE
4305 The operation cannot be performed on an offline library.  ERROR_LIBRARY_OFFLINE
4306 The library, drive, or media pool is empty.  ERROR_EMPTY
4307 The library, drive, or media pool must be empty to perform this operation.  ERROR_NOT_EMPTY
4308 No media is currently available in this media pool or library.  ERROR_MEDIA_UNAVAILABLE
4309 A resource required for this operation is disabled.  ERROR_RESOURCE_DISABLED
4310 The media identifier does not represent a valid cleaner.  ERROR_INVALID_CLEANER
4311 The drive cannot be cleaned or does not support cleaning.  ERROR_UNABLE_TO_CLEAN
4312 The object identifier does not represent a valid object.  ERROR_OBJECT_NOT_FOUND
4313 Unable to read from or write to the database.  ERROR_DATABASE_FAILURE
4314 The database is full.  ERROR_DATABASE_FULL
4315 The medium is not compatible with the device or media pool.  ERROR_MEDIA_INCOMPATIBLE
4316 The resource required for this operation does not exist.  ERROR_RESOURCE_NOT_PRESENT
4317 The operation identifier is not valid.  ERROR_INVALID_OPERATION
4318 The media is not mounted or ready for use.  ERROR_MEDIA_NOT_AVAILABLE
4319 The device is not ready for use.  ERROR_DEVICE_NOT_AVAILABLE
4320 The operator or administrator has refused the request.  ERROR_REQUEST_REFUSED
4350 The remote storage service was not able to recall the file.  ERROR_FILE_OFFLINE
4351 The remote storage service is not operational at this time.  ERROR_REMOTE_STORAGE_NOT_ACTIVE
4352 The remote storage service encountered a media error.  ERROR_REMOTE_STORAGE_MEDIA_ERROR
4390 The file or directory is not a reparse point.  ERROR_NOT_A_REPARSE_POINT
4391 The reparse point attribute cannot be set because it conflicts with an existing attribute.  ERROR_REPARSE_ATTRIBUTE_CONFLICT
5001 The cluster resource cannot be moved to another group because other resources are dependent on it.  ERROR_DEPENDENT_RESOURCE_EXISTS
5002 The cluster resource dependency cannot be found.  ERROR_DEPENDENCY_NOT_FOUND
5003 The cluster resource cannot be made dependent on the specified resource because it is already dependent.  ERROR_DEPENDENCY_ALREADY_EXISTS
5004 The cluster resource is not online.  ERROR_RESOURCE_NOT_ONLINE
5005 A cluster node is not available for this operation.  ERROR_HOST_NODE_NOT_AVAILABLE
5006 The cluster resource is not available.  ERROR_RESOURCE_NOT_AVAILABLE
5007 The cluster resource could not be found.  ERROR_RESOURCE_NOT_FOUND
5008 The cluster is being shut down.  ERROR_SHUTDOWN_CLUSTER
5009 A cluster node cannot be evicted from the cluster while it is online.  ERROR_CANT_EVICT_ACTIVE_NODE
5010 The object already exists.  ERROR_OBJECT_ALREADY_EXISTS
5011 The object is already in the list.  ERROR_OBJECT_IN_LIST
5012 The cluster group is not available for any new requests.  ERROR_GROUP_NOT_AVAILABLE
5013 The cluster group could not be found.  ERROR_GROUP_NOT_FOUND
5014 The operation could not be completed because the cluster group is not online.  ERROR_GROUP_NOT_ONLINE
5015 The cluster node is not the owner of the resource.  ERROR_HOST_NODE_NOT_RESOURCE_OWNER
5016 The cluster node is not the owner of the group.  ERROR_HOST_NODE_NOT_GROUP_OWNER
5017 The cluster resource could not be created in the specified resource monitor.  ERROR_RESMON_CREATE_FAILED
5018 The cluster resource could not be brought online by the resource monitor.  ERROR_RESMON_ONLINE_FAILED
5019 The operation could not be completed because the cluster resource is online.  ERROR_RESOURCE_ONLINE
5020 The cluster resource could not be deleted or brought offline because it is the quorum resource.  ERROR_QUORUM_RESOURCE
5021 The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource.  ERROR_NOT_QUORUM_CAPABLE
5022 The cluster software is shutting down.  ERROR_CLUSTER_SHUTTING_DOWN
5023 The group or resource is not in the correct state to perform the requested operation.  ERROR_INVALID_STATE
5024 The properties were stored but not all changes will take effect until the next time the resource is brought online.  ERROR_RESOURCE_PROPERTIES_STORED
5025 The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class.  ERROR_NOT_QUORUM_CLASS
5026 The cluster resource could not be deleted since it is a core resource.  ERROR_CORE_RESOURCE
5027 The quorum resource failed to come online.  ERROR_QUORUM_RESOURCE_ONLINE_FAILED
5028 The quorum log could not be created or mounted successfully.  ERROR_QUORUMLOG_OPEN_FAILED
5029 The cluster log is corrupt.  ERROR_CLUSTERLOG_CORRUPT
5030 The record could not be written to the cluster log since it exceeds the maximum size.  ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE
5031 The cluster log exceeds its maximum size.  ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE
5032 No checkpoint record was found in the cluster log.  ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND
5033 The minimum required disk space needed for logging is not available.  ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE
6000 The specified file could not be encrypted.  ERROR_ENCRYPTION_FAILED
6001 The specified file could not be decrypted.  ERROR_DECRYPTION_FAILED
6002 The specified file is encrypted and the user does not have the ability to decrypt it.  ERROR_FILE_ENCRYPTED
6003 There is no encryption recovery policy configured for this system.  ERROR_NO_RECOVERY_POLICY
6004 The required encryption driver is not loaded for this system.  ERROR_NO_EFS
6005 The file was encrypted with a different encryption driver than is currently loaded.  ERROR_WRONG_EFS
6006 There are no EFS keys defined for the user.  ERROR_NO_USER_KEYS
6007 The specified file is not encrypted.  ERROR_FILE_NOT_ENCRYPTED
6008 The specified file is not in the defined EFS export format.  ERROR_NOT_EXPORT_FORMAT
6118 The list of servers for this workgroup is not currently available  ERROR_NO_BROWSER_SERVERS_FOUND


 

블로그 이미지

요다할아범

,

내가 수정 했던 소스
INT CALLBACK BrowseCallbackProc (HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
    switch (uMsg)
    {
        case BFFM_INITIALIZED:
            SendMessage (hWnd, BFFM_SETSELECTION, TRUE, lpData);
            break;
    }
    return 0;
}

void CPreferenceDlg::OnBtnPath()
{
 TCHAR tszDisplayName[MAX_PATH*10];
 GetCurrentDirectory(MAX_PATH*10, tszDisplayName);\
 LPITEMIDLIST pDirList;

 CString str = _T("백업 파일을 저장할 폴더를 선택하세요.");

 BROWSEINFO binfo;
 ZeroMemory(&binfo, sizeof(BROWSEINFO));
 binfo.hwndOwner = m_hWnd;
 binfo.pidlRoot = NULL;
 binfo.lpszTitle = str;
 //binfo.ulFlags = BIF_NONEWFOLDERBUTTON | BIF_RETURNONLYFSDIRS;//BIF_NONEWFOLDERBUTTON |
// 새폴더 만들기 버튼 생성위한 플래그
 binfo.ulFlags = 0x0040 | 0x0100 | BIF_EDITBOX | BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;

    binfo.lpfn = BrowseCallbackProc;
    binfo.lParam = (LPARAM) tszDisplayName;

 pDirList = SHBrowseForFolder(&binfo);
 if(pDirList != NULL)
 {
  if (!SHGetPathFromIDList(pDirList, tszDisplayName))
   return;
  CString strDirName(tszDisplayName);
  strDirName.TrimRight(_T("\\"));

  m_cEditPath.SetWindowText(strDirName);
 }
}

--------------------------------------------------------------------
아래는 웹에서 찾았던 것들

// 기본으로 열기
void CShell_003ADlg::OnButton1()
{
 BROWSEINFO bi;
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 bi.hwndOwner = this->GetSafeHwnd();
 LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
 TCHAR szPath[MAX_PATH] = {0};
 SHGetPathFromIDList(pidl, szPath);
 SetDlgItemText(IDC_STATIC_1, szPath);
}

// 기본으로 열기1
void CShell_003ADlg::OnButton2()
{
 BROWSEINFO bi;
 TCHAR szBuff[MAX_PATH] = {0};
 TCHAR szDisp[MAX_PATH] = {0};
 lstrcpy(szBuff, "Choose a folder : ");

 ZeroMemory(&bi, sizeof(BROWSEINFO));
 bi.hwndOwner = this->GetSafeHwnd();
 bi.lpszTitle = static_cast(szBuff);
 bi.pszDisplayName = static_cast(szDisp);

 LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
 
 TCHAR szPath[MAX_PATH] = {0};
 SHGetPathFromIDList(pidl, szPath);

 CString a = CString(bi.pszDisplayName).Right(1);
 if(a== _T(")"))
  SetDlgItemText(IDC_STATIC_2, bi.pszDisplayName);
 else
  SetDlgItemText(IDC_STATIC_2, szPath);
 SendDlgItemMessage(IDC_STATIC_ICON_1, STM_SETICON, reinterpret_cast(SHGetSystemIcon(bi.iImage)));
}

int CALLBACK BrowseCallbackProc(HWND hwnd, UINT msg, LPARAM l, LPARAM ld)
{
 switch(msg){
 case BFFM_SELCHANGED:{
  TCHAR pass[MAX_PATH] = {0};
  SHGetPathFromIDList(reinterpret_cast(l), pass);
  SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, reinterpret_cast(pass));
  }
 }
 return 0;
}

// 기본으로 열기 2
void CShell_003ADlg::OnButton3()
{
 BROWSEINFO bi;
 TCHAR szBuff[MAX_PATH] = {0};
 lstrcpy(szBuff, "Choose a folder : ");

 ZeroMemory(&bi, sizeof(BROWSEINFO));

 bi.hwndOwner = this->GetSafeHwnd();
 bi.lpszTitle = static_cast(szBuff);
 bi.ulFlags = static_cast(BIF_STATUSTEXT);
 bi.lpfn = BrowseCallbackProc;

 LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
 
 TCHAR szPath[MAX_PATH] = {0};
 SHGetPathFromIDList(pidl, szPath);
 SetDlgItemText(IDC_STATIC_3, szPath);
}

// 프린터 폴더 열기
void CShell_003ADlg::OnButton4()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_PRINTERS, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}
 
// 즐겨찾기 폴더 열기
void CShell_003ADlg::OnButton5()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

// 네트워크 폴더 열기
void CShell_003ADlg::OnButton6()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_NETWORK, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

// 휴지통 폴더 열기
void CShell_003ADlg::OnButton7()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_BITBUCKET, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

// 폰트 폴더 열기
void CShell_003ADlg::OnButton8()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_FONTS, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

// 제어판 폴더 열기
void CShell_003ADlg::OnButton9()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 
 ZeroMemory(&bi, sizeof(BROWSEINFO));
 SHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);

 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

HRESULT CShell_003ADlg::SHSetPathToPidl(LPCTSTR szPath, LPITEMIDLIST* ppidl)
{
 LPSHELLFOLDER pShellFolder = NULL;
 OLECHAR wszPath[MAX_PATH] = {0};
 ULONG nCharParsed = 0;

 HRESULT hr = SHGetDesktopFolder(&pShellFolder);
 if(FAILED(hr))
  return hr;

 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szPath, -1, wszPath, MAX_PATH);

 hr = pShellFolder->ParseDisplayName(NULL, NULL, wszPath, &nCharParsed, ppidl, NULL);
 pShellFolder->Release();
 return hr;
}

// 임의의 폴더를 루트로
void CShell_003ADlg::OnButton10()
{
 BROWSEINFO bi;
 LPITEMIDLIST pidl;
 CString tPath = _T("D:\\Program Files\\");

 ZeroMemory(&bi, sizeof(BROWSEINFO));
 if(FAILED(SHSetPathToPidl((LPCTSTR)tPath, &pidl)))
  return;
 bi.hwndOwner = this->GetSafeHwnd();
 bi.pidlRoot = pidl;
 bi.ulFlags = BIF_BROWSEINCLUDEFILES;

 SHBrowseForFolder(&bi);
}

블로그 이미지

요다할아범

,

출처 : 마이크로소프트

 

앞으로 몇 회에 걸쳐 C++의 중요한 기능들을 하나씩 살펴볼 생각이다. 실제로는 별로 쓰이지 않으면서 지식욕을 채우는 데만 도움이 되는 내용보다는 실무에 도움이 되고 일반적으로 받아들여지고 있는 내용을 중심으로 엮어갈 계획이다. 이번 주제는 필자가 평소에 전하고 싶어했던 ‘예외’로 결정했지만, 앞으로의 주제들은 최대한 독자 여러분의 의견을 반영하고 싶다.

이현창 | 포씨소프트에서 근무하는 필자는 화상 통신 및 e-러닝 관련 소프트웨어를 제작하고 있다. 2003년에는 3년간의 병역특례 근무를 마치고 아주대학교에서의 마지막 대학 생활을 멋지게 마무리하기 위해 열심히 준비중이다.

C++를 만든 Stroustrup은 그의 저서 ‘The Design and Evolution of C++’에서 예외는 반환 값을 대체하기 위한 것이 아니라 결함을 허용하는(fault-tolerance) 시스템을 만들 수 있도록 하기 위한 것이라고 말했다. 에러가 발생한 경우에도 올바르게 동작할 수 있는 프로그램을 만드는 것은 중요한 주제이며 예외는 그러한 일에 적당한 도구이다. 하지만 예외는 기존의 반환 값을 사용한 에러 처리를 훌륭하게 대체할 수 있는 도구이기도 하다.
우선 예외를 사용하지 않은 코드를 한 번 보자. 그리고는 이 코드에서 예외를 사용하도록 고쳐보자. 다이어트 광고에 나오는 두 장의 사진처럼 명백한 차이점을 볼 수 있도록 말이다. <리스트 1>에서는 반환 값을 사용해 에러 처리를 하고 있다. 이러한 방식은 몇 가지 문제점을 가지고 있는데, 먼저 예외를 사용하도록 고친 다음 <리스트 2>와 비교해 보는 것이 좋을 것 같다.
<리스트 2>를 보면 작업 코드는 try 블럭에 모였고 에러 처리 코드는 catch 블럭에 모였다. try 블럭을 보면 이 함수에서 하는 일이 무엇인지 쉽게 알아볼 수 있다. 반면에 <리스트 1>은 예외 처리 코드와 작업 코드가 섞여 있어 함수를 읽기 어렵게 만들고 있다. 그 다음으로 <리스트 2>에서는 여러 군데 중복되어 흩어져 있던 에러 처리 코드들이 하나로 통합됐다. 그렇기 때문에 Log()를 호출하는 대신 다른 일을 하고자 할 때도 수정 작업이 쉽게 이뤄질 것이다. 반면에 <리스트 1>에서는 여러 군데 흩어져 있는 에러 처리 코드를 일일이 수정해야 한다. 소프트웨어 개발에 있어 중복은 개발자가 언제나 피해야 할 것 중에 하나다.
작업 효율에 대해서도 한 번 생각해 보자. <리스트 1>처럼 무슨 일을 할 때마다 비교문을 둬 성공여부를 체크하는 것은 개발자에게 있어서 매우 피곤한 일이며 에러 처리 코드를 작성하는 데 많은 시간을 빼앗기도록 만든다. 예외를 올바르게 사용하면 개발자의 시간이 더 창조적인 일에 사용될 수 있을 것이다.
사실 <리스트 2>처럼 단순히 로그를 찍기 위해 예외를 잡는 것은 납득할 만한 설계가 아니다. 상위의 함수에서 예외 처리할 수 있는 경우에는 굳이 예외를 잡을 필요가 없다. 그런 경우에는 말 그대로 그냥 잡지 않으면 된다. 다음은 예외가 그냥 지나쳐 가도록 변경한 예제 코드다.

// sUserInfo 문자열을 분석해 USER_INFO 구조체를 채우는 함수
bool UserList::ParseUserInfo(MyString sUserInfo, USER_INFO& ui)
{
// ? 문자열 분석기를 구한다.
MyParser& parser = MyParser::GetParser(sUserInfo);

// ? 사용자 ID를 얻는다.
parser.Find ( “ID”, ui.userID );

// ? 사용자 이름을 얻는다.
parser.Find ( “Name”, ui.name );

// ? 사용자 나이를 얻는다.
parser.Find ( “Age”, ui.age );
}

<리스트 1>과 비교했을 때 명백한 차이점을 볼 수 있다. 보다 간결하고, 이해하기 쉽고, 유지 보수하기 쉬운 함수가 됐다. 앞의 코드는 기사에 맞게 작성된 것이긴 하지만 꾸며낸 상황은 아니다. 대부분의 함수에서는 예외를 던지거나 잡을 일이 없다(그리고 이것은 정말 중요한 특징이다). 에러가 발생한 곳에서는 예외를 던지면 되고, 예외가 필요한 곳에서만 예외를 받으면 된다.
언제 예외를 처리해야 하는지 잘 이해되지 않는다면 다음의 가이드라인이 도움이 될 것이다. 다음은 어떤 함수에서 예외를 처리해야 하는 지에 대한 간단한 가이드라인이다.

◆ 함수가 예외를 가지고 무엇을 해야 할 지 아는 경우
◆ 함수가 예외를 적당히 처리할 수 있고, 상위 함수가 예외를 가지고 무엇을 해야 할 지 모르는 경우
◆ 예외를 던지는 것이 프로그램을 비정상 종료시킬 가능성이 있는 경우
◆ 함수가 자신의 일을 계속 진행시킬 수 있는 경우
◆ 리소스를 해제할 필요가 있는 경우

결국은 논리적으로 생각해 알맞게 하는 것이 정답일 것이다. 프로그램 전체적인 관점에서 고려한다면 다음과 같은 가이드라인이 도움이 될 것이다.

◆ 보통의 저수준 함수에서는 예상할 수 있는 예외만을 처리한다.
◆ 그 밖의 예외는 고수준 함수에서 처리한다.
◆ 정말 중요한 저수준 함수에서는 예상할 수 없는 예외도 처리한다. 그리고 적당한 예외를 사용해 외부에 다시 던져준다.

앞서 저수준 함수란 엔진이나 라이브러리 같이 낮은 계층에 속하는 함수에 해당하고, 고수준 함수란 라이브러리를 사용하는 높은 계층의 함수에 해당한다.

예외에 안전하게 설계하기
다음은 예외로 인해 리소스의 유실이 발생할 수 있는 경우에 대한 예제이며 아주 흔한 것이다.

void Func()
{
// 객체의 생성
MyObj* obj = new MyObj();

// 메모리 블럭을 가지고 무엇인가 한다. 실패한 경우 예외를 발생시킨다.
MayThrowException(obj);

// 메모리 해제
delete obj;
}

만약 MayThrowException() 함수에서 예외가 발생하게 된다면 앞서 obj에 할당된 메모리가 해제될 기회를 놓치게 될 것이다. 실제로 프로그램 전반적으로 예외를 사용하고 있다면 이런 상황에 놓일 가능성이 크다. 이런 상황에 대한 일반적인 해결책은 스택을 이용하는 것이다. 다음은 리소스 유실을 막기 위해 클래스를 도입한 예제 코드다.

// 리소스 유실을 막기 위한 클래스
class AvoidLeak
{
public:
AvoidLeak(MyObj* p) : _p(p) {} // 포인터 보관
~AvoidLeak() {delete _p;} // 보관된 포인터 해제
private:
MyObj* _p;
};

void Func()
{
// 객체의 생성
MyObj* obj = new MyObj();

// 리소스 유실 방지용 객체 생성
AvoidLeak al(obj);

// 메모리 블럭을 가지고 무엇인가 한다. 실패한 경우 예외를 발생시킨다.
MayThrowException(obj);

// 메모리를 수동으로 해제할 필요가 없다
}
AvoidLeak 클래스의 소멸자에서는 보관된 포인터를 해제한다. 함수가 정상적으로 종료하는 경우나 예외가 발생해 종료하는 경우 모두 지역 변수의 소멸자는 반드시 호출되도록 정해져 있다. 그렇기 때문에 MayThrowException() 함수에서 예외가 발생하는 경우라도 AvoidLeak 클래스의 소멸자는 올바르게 호출되고 메모리 블럭도 올바르게 해제된다.
예외를 사용해 에러 처리를 한다면 예외에 안전하도록 설계하는 데 신경써야 한다. 간단하게는 <리스트 3>처럼 예외가 발생하는 경우라도 리소스 유실이 일어나지 않도록 설계해야 한다. 더 나아가 예외가 발생하는 경우라도 객체가 올바른 상태를 유지할 수 있도록 설계하는 것이 중요하다. 예를 들어 A라는 작업이 실제로는 a1 - a2 - a3라는 작업으로 이뤄진다고 가정해 보자. 작업 a2가 수행되는 과정에서 에러가 발생했다면 a1의 작업은 올바르게 복구(rollback)될 수 있도록 설계돼야 한다.
<리스트 3>은 내부적으로 필요한 리소스를 초기화하는 함수다. 이 함수에서는 예외가 발생할 수 있는 곳이 여러 군데 있는데, new 연산자에서 메모리 할당을 실패하는 경우에도 예외가 발생할 수 있고 Commit() 내에서 실패하는 경우에도 예외가 발생할 수 있다.
만약에 이 함수가 실행되고 리소스 ?번을 초기화하는 과정에서 예외가 발생한다면 어떻게 될까? LargeObject 객체는 일부만 초기화되어 있는 올바르지 않은 상태가 될 것이고 이는 여러 경우에 문제를 발생시킬 것이다. <리스트 4>는 이러한 문제에 대한 일반적인 해결책이다.
auto_ptr은 <리스트 4>에 나오는 AvoidLeak과 같은 클래스로서 예외가 발생하는 경우에도 리소스가 올바르게 해제될 수 있도록 하는 역할을 한다(auto_ptr에 대한 자세한 설명은 박스 기사에서 볼 수 있다). 그리고 MyResource를 LargeObject 객체의 멤버 변수에 보관하는 대신 지역 변수에 보관했기 때문에 예외가 발생하는 경우라도 LargeObject 객체의 내부 상태는 올바르게 유지된다. 모든 작업이 성공적으로 완료된 후에야 LargeObject 객체의 내부 상태가 변경된다. 이러한 패턴을 다음과 같이 요약해 볼 수 있다.

짾 예외가 발생할 만한 작업은 지역 변수를 사용해 진행한다.
짿 안전한 방법만을 사용해 클래스의 내부 상태를 변경한다.

예외에 관한 이런 저런 이야기
생성자에서 예외 발생
모두가 알고 있듯 생성자는 반환 값을 가지고 있지 않다. 그렇기 때문에 생성자에서 발생한 에러를 알리기 위해 예외를 사용하는 것은 아주 좋은 생각이다. 그러나 그것이 의도적이든 의도적이지 않든 간에 생성자에서 예외가 발생하는 경우에는 다음과 같은 몇 가지 규칙을 알아둬야 한다.

짾 생성자에서 예외가 발생한 경우 객체는 생성되지 않는다 : 객체의 생존 기간은 생성자의 끝(닫는 괄호)에서부터 소멸자의 시작(여는 괄호)까지이다. 생성자에서 예외가 발생한 경우에는 생성자의 끝에 도달하지 못한 것이고 결국 생성되지 못한 것이 된다. 그렇기 때문에 객체의 소멸자는 호출되지 않는다. 소멸자가 호출되지 않기 때문에 생성자에서 할당한 리소스가 올바르게 제거되지 않을 수 있다는 점을 기억해야 한다. 생성자에서 예외가 발생할 가능성이 있는 경우에는 catch문을 두어 리소스를 깨끗이 정리하고 다시 예외를 던져야 한다.

짿 생성자에서 예외가 발생한 경우 이미 생성된 멤버들은 어떻게 처리될까 : 생성자에서 예외가 발생한 경우 어떤 멤버는 이미 생성되었고, 어떤 멤버는 아직 생성되지 않았을 수 있다. 예를 들어 이미 생성된 멤버가 메모리를 할당받았다면 이 메모리는 어떻게 해제할 수 있을까? 다행히도 우리가 신경써줘야 하는 부분은 없다. 이미 생성된 멤버의 경우에는 올바르게 소멸자가 호출되는 것을 확인해 볼 수 있다(<리스트 5>).

Member 클래스는 두 번째 멤버 객체를 생성할 때 생성자에서 예외를 던지도록 제작된 클래스다. 그렇기 때문에 Container 클래스의 생성자에서 두 번째 멤버 객체인 m2를 생성할 때 예외가 발생될 것이다. <리스트 5>의 결과에서 볼 수 있듯 완전하게 생성된 m1은 올바르게 소멸자가 호출됐다. m2는 자신의 생성자에서 예외가 발생했기 때문에 생성되지 못했다. m3는 생성자조차 호출되지 못했다.
new[] 연산자를 사용해 객체의 배열을 생성하는 경우에도 같은 원칙이 적용된다. 객체의 배열을 생성하는 도중에 예외가 발생한다면 이미 생성된 객체가 있을 수 있고, 아직 생성되지 않은 객체가 있을 수 있다. 이 경우에도 이미 생성된 객체에 대해서는 소멸자가 올바르게 호출되는 것을 확인할 수 있다.

쨁 생성자의 초기화 리스트에서 발생하는 예외는 어떻게 잡을까 : 생성자의 초기화 리스트에서는 부모 클래스의 생성자나 멤버 생성자를 직접 호출할 수 있으며 생성자의 본문 밖에 위치한다. 초기화 리스트에서 예외가 발생하는 경우에는 어떻게 잡을 수 있을까? <리스트 6>은 생성자의 초기화 리스트에서 발생하는 예외를 잡는 방법을 보여준다.

필자에게도 그다지 익숙하지 않은 문법이지만 초기화 리스트에서 발생하는 예외를 잡을 필요가 있을 때는 유용하게 사용할 수 있을 것이다. 한 가지 아쉬운 것은 비주얼 C++ 6.0에서는 이와 같은 문법을 지원하지 않는다는 점이다. 그러나 다음 버전인 비주얼 C++.NET에서는 사용 가능하다.

소멸자에서 예외 발생
스택을 정리하는 과정에서 예외가 발생하면 응용 프로그램이 비정상적으로 종료될 수 있기 때문에 소멸자에서는 절대로 예외가 발생해서는 안 된다. 소멸자에서 예외를 발생시킬 수 있는 함수를 호출하는 경우에는 반드시 catch로 잡아주도록 하자. 또한 delete나 delete[]를 오버로드한 경우 역시 절대로 예외가 발생하지 않도록 주의해 제작해야 한다.

Win32 구조적 예외 처리
Win32 구조적 예외 처리(Structured Exception Handling, 이하 SEH)는 윈도우 운영체제 수준에서 구현되어 있는 예외 처리 기능이다. 여기서의 예외는 C++의 예외와는 다른 것이며, 잘못된 메모리 참조나 스택 오버플로우와 같은 시스템 수준의 예외를 말한다. 우선 SEH를 사용해 잘못된 메모리 참조 예외를 잡는 방법을 살펴보자.

void Func()
{
__try
{
// 잘못된 주소 참조 오류를 발생시킨다.
char* p = NULL;
*p = ‘A’;
}
__except ( EXCEPTION_ACCESS_VIOLATION == GetExceptionCode()
? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH )
{
// Access violation
}
}

SEH는 C++의 try, catch와는 달리 __try, __except 키워드를 사용한다. GetExceptionCode()는 예외의 종류를 알려주는 함수이고, 이 예제에서는 잘못된 메모리 참조인지 비교하고 있다. 잘못된 메모리 참조인 경우에는 EXCEPTION_EXCUTE_HANDLER 값을 반환함으로써 __except 블럭이 실행되도록 하고, 잘못된 메모리 참조가 아닌 경우에는 EXCEPTION_CONTINUE_SEARCH 값을 반환해 다른 __except 블럭을 찾아보도록 하고 있다.
SEH는 시스템에서 발생하는 예외를 잡을 수 있을 만큼 강력하지만, C++ 객체가 선언된 함수에서는 함께 사용할 수 없다(좀더 자세히 말해 함수 종료시 호출돼야 할 소멸자가 있는 함수를 말한다). 다행히도 SEH 예외를 C++ 예외처럼 다룰 수 있는 방법이 있는데, 이 방법을 사용하면 같은 함수 안에서도 SEH와 C++ 예외를 함께 사용할 수 있을 뿐더러 일관된 예외 처리 방식을 사용할 수 있어서 좋다. 다음은 SEH 예외를 C++ 예외로 만든 예제다.

#include “stdafx.h”
#include
#include

// SEH 예외는 이 예외 클래스로 던져진다.
class CSEHException
{
public:
CSEHException(UINT excode, PEXCEPTION_POINTERS exp)
{
// SEH 예외와 관련된 코드를 저장한다.
m_exceptionCode = excode;
m_exceptionPointer = *exp;
}

int GetExceptionCode() {return m_exceptionCode;}

UINT m_exceptionCode; // 예외 코드
EXCEPTION_POINTERS m_exceptionPointer; // 부가 정보
};

// SEH를 C++ 예외로 변경하기 위한 함수(시스템에 의해 호출된다)
void _cdecl SEH2CppException(UINT excode, PEXCEPTION_POINTERS exp)
{
throw CSEHException(excode, exp);
}

void main()
{
// SEH 변경 함수를 등록한다.
_set_se_translator(&SEH2CppException);

try
{
// 잘못된 주소 참조 예외를 발생시킨다.
int* i = NULL;
*i = 123;
}
catch( CSEHException& e)
{
switch(e.GetExceptionCode() )
{
case EXCEPTION_ACCESS_VIOLATION:
// 여기가 실행된다.
break;
}
}
}

SEH 예외를 C++ 예외로 만드는 방법은 아주 간단하다. 시스템은 SEH 예외가 발생할 때마다 정해진 함수를 호출하도록 되어 있는데, _set_se_translator()를 사용하면 우리가 작성한 함수를 호출하도록 만들 수 있다. 그리고 우리가 작성한 함수 안에서는 C++ 예외를 던지면 된다.
앞 예제에서는 SEH 에외가 발생한 경우 SEH2CppException()을 호출하도록 지정했으며, SEH2CppException() 안에서는 CSEHException 객체를 예외로 던지는 것을 확인할 수 있다. 또한, main() 함수를 보면 잘못된 메모리 참조 예외가 CSEHException로 던져지는 것을 확인할 수 있다. CSEHException을 사용하는 것이 얼마나 편리한지 보여주기 위해 이 기능을 사용하지 않은 경우와 사용하는 경우를 비교해 보았다(<리스트 7, 8>).
누가 보아도 <리스트 8>의 경우가 훨씬 이해하기 쉽다. 게다가 더욱 안전하다. 포인터가 NULL이 아닌 경우라도 얼마든지 잘못된 주소를 가리키고 있을 수 있다는 사실을 명심하자! 이런 경우에 <리스트 7>은 심각한 문제를 일으키게 되지만 <리스트 8>은 안전하게 예외를 잡아낼 수 있다. 그렇다고 해서 <리스트 8>이 성능 상의 문제를 가지고 있는 것은 아니다. 예외가 빈번히 일어나는 것이 아니라는 가정에서 <리스트 8>은 비슷하거나 더 빠르게 수행된다.

기사에 대한 많은 조언을 당부하며
이번 호에는 많은 전문가들을 통해 밝혀지고 알려진 올바른 예외 사용법에 대해 알아봤다. 안타깝게도 지면이 부족한 관계로 몇 가지 중요한 정보를 전달하지 못했는데, 다음과 같은 것들이다. 이런 부분은 참고 서적을 통해 충분한 지식을 습득할 수 있을 것이라고 생각한다.

◆ new 연산자에서 할당에 실패한 경우의 올바른 처리 방법
◆ 프로젝트에 사용할 기반 예외 클래스를 작성하는 방법
◆ 예외에 안전한 클래스를 작성하는 방법에 대한 보다 깊은 지식

이번 기사를 작성하면서 가장 어려운 부분은 어떤 내용이 실무 개발자들에게 도움이 될지에 대한 정보가 부족했다는 점이다. 이번 기사에 대한 질책이나 다음 호에 대한 조언, 희망 사항을 들을 수 있다면 좀더 좋은 기사를 쓰는 데 도움이 될 것이다.


[ auto_ptr 클래스 ]
AvoidLeak은 MyObj*에 대해서만 사용할 수 있지만, 템플릿을 사용하면 쉽게 여러 가지 타입을 담을 수 있는 클래스로 만들 수 있다. 실제로 C++ 표준 라이브러리에는 auto_ptr 클래스가 이러한 용도로 제공된다.
하지만 auto_ptr은 배열에 대해 사용할 수 없으며, 소유권 이전 방식의 복사 기능을 제공하기 때문에 STL 컨테이너에 보관할 수 없다. http://boost.org에서는 이러한 문제점을 해결한 scoped_array이나 shared_ptr과 같은 클래스를 제공한다. 자세한 정보는 해당 사이트에서 얻을 수 있다.

[ 컴파일 옵션의 사용 ]
<리스트 8>을 컴파일하기 위해서는 컴파일 옵션으로 /EHa를 주어야 한다. 그렇지 않은 경우 비주얼 C++.NET에서는 다음과 같은 경고 메시지를 출력한다.
warning C4535: calling _set_se_translator() requires /EHa
the command line options /EHc and /GX are insufficient

다음은 예외와 관련된 컴파일 옵션이다.
/EHa 비동기 모드
/EHs 동기 모드
/GX (/EHsc) 동기 모드. 끝에 붙은 c는 extern “C” 함수는 예외를 발생시키지 않음을 의미

비동기 모드는 함수 또는 함수에서 호출하는 자식 함수에 throw문이 없어도 예외가 발생할 수 있다고 가정한다. SEH 예외는 throw문이 없어도 언제든지 발생할 수 있기 때문에 비동기 모드로 컴파일해야 한다.

블로그 이미지

요다할아범

,

사례1)

warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss


닷넷에서 한글로 주석을 달면 나올 수 있는 워닝이라고 한다...

그래서인지 구글에서 검색해보면 이 워닝으로 귀찮아하는 외국인을 찾을 수 없다ㅎㅎ


#pragma warning(disable:4819) 로 무시해주거나~

주석을 영어로 달면 해결될듯?? <- 이방법은 안해봤으나 앞으로는 이렇게 해야겠다고 맘먹는중??ㅎㅎ


사례2)


warning C4819: 현재 코드 페이지(949)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형식으로 저장하십시오


d3d9types.h 에 보면..


1801번째 줄에서 볼수 있는 구조체 이다.

( Ctrl + G 를 누르면 한방에 갈 수 있다는 것은 알고 있죠?! 마우스 휠 비비지 말자.. 남들 보면 오해한다.. -0-? 뭘?! )


typedef struct _D3DDEVINFO_VCACHE {
    DWORD   Pattern;                    /* bit pattern, return value must be FOUR_CC(멌? 멇? 멌? 멖? */
    DWORD   OptMethod;                  /* optimization method 0 means longest strips, 1 means vertex cache based */
    DWORD   CacheSize;                  /* cache size to optimize for  (only required if type is 1) */
    DWORD   MagicNumber;                /* used to determine when to restart strips (only required if type is 1)*/
} D3DDEVINFO_VCACHE, *LPD3DDEVINFO_VCACHE;


주석문중에 깨진 글자가 보일 것이다.


과감히 지워주자... 이제 더이상의 찜찜한 기분은 느낄 필요가 없다..



VS.NET 2003 혹은 2005로 컴파일을 하다보면


warning C4819: 현재 코드 페이지(949)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형식으로 저장하십시오.


이런 형태의 warning 메세지를 확인할 수 있습니다. warning 이기는 하지만 그래서 상당히 눈에 거슬리는 부분이 아닐 수 없습니다.

그래서 이번에 그 원인과 해결방법을 알아 보고자 합니다.



[원인]

ANSI로 인코딩된 소스코드를 VS.NET 2005 (한글판)에서 빌드하면서 발생하는 문제로 일본판의 경우에도 비슷한 문제가 발생하였고 영문판 VS.NET 2005에서는 발생하지 않는 것으로 알려졌습니다.

MS에서도 이를 버그로 인정하고 다음 버전에서 수정한다고 합니다.



[해결방안1]

#pragma warning(disable: 4819)

이 문장을 상단에 위치시켜서 해당 warning이 표시되지 않게 한다.



[해결방안2]

VS.NET 2005의 경우

'프로젝트->속성->구성속성->C/C++->고급->특정 경고 사용 안함'

항목에 4819와 같이 무시하고 싶은 경고 메세지 번호를 넣는다.



[해결방안3]

세번째로는 warning이 발생하는 파일을 새롭게 유니코드 형태로 저장하는 방법입니다.


VS.NET 2005의 경우

'파일->저장 고급 옵션'

"유니코드 - 코드페이지 1200" 형태로 저장을 선택하시면 됩니다.


메모장 등 기타 편집기를 이용하셔도 됩니다.



현재 전반적으로 사용하는 방법이 위에 3가지 정도 인듯 합니다.

저의 경우 이 warning이 DXSDK에서 발생해서 당황했었던... ^^

처음엔 #pragma 형태로 했었는데 해결방안2 형태로 하니까 편하더군요.. ^^

블로그 이미지

요다할아범

,

비쥬얼 스튜디오 2005에서 컴파일 하다 보면 위의 warning이 뜨는것을 볼 수 있다.

몇가지 경우가 있는듯 한데

대표적으로 예전의 문자열 관련 CRT 함수를 쓰면 나타난다.

위 warning의 의미는 "VS2005에서 이전 문자열 관련 CRT함수의 안전성을 강화하기 위하여

"_s"가 붙는 함수를 다시 만들었기 때문에 될 수 있으면 이전에 사용하던 함수는 사용하지 마라" 정도가 되겠다.


예) strcpy  -> strcpy_s


안전성이라고 해봐야 특별한것은 없고 메모리 관련 에러가 나면 확실하게 에러를 표시해 주는 기능 정도인거 같다 (이전 함수들은 메모리 버퍼의 크기에 대한 보장을 못함). 그래도 메모리 관련 에러가 나면 그 결과가 엉뚱한 데서 나타날 수가 있으므로 여간 찾기 어려운 것이 아닌데 이런 사소한것 부터 조심스럽게 쓰면 좀 더 안전하게 코딩할 수 있지 않을까 생각이 든다.

그래서 요즘 드는 생각들이 C 함수 보다는 C++이 제공해주는 (엄밀하게 말한다면

C++ 로 만든 표준 라이브러리)클래스를 보다 폭넓게 사용하는것이 좋겠다라는 생각이 든다.

STL에서 제공해주는 스트링 클래스나 여러 컨테이너를 사용한다면 직접 문자열을 다룬다거나

new delete를 사용하는 빈도가 줄어들터이니...


java가 부러운점이 있다면

필요로하는 거의모든 라이브러리를 표준차원에서 제공해준다는것이다.

C++ 같은경우 간단한 문법(사실 문법자체도 어렵거니와)과 STL을 뺀다면

표준이랄께 없기 때문이다.

투정이 좀 길었는데

처음으로 돌아가서

만약 이전에 짜놓았던 코드를 고치기 힘들면 복잡하게 생각할꺼 없고

stdafx.h 파일의 최 상단에

#define _CRT_SECURE_NO_DEPRECATE

한줄 넣어버리면 그만이다...

블로그 이미지

요다할아범

,