エラーコード
Windowsでは、さまざまなエラーコードが定義されています。これらのコードは、アプリケーションやドライバーがエラーを報告するために使用されます。以下に、覚えておくと役立つ一般的なエラーコードの種類とその説明を示します。
エラー検索ツール
エラーコードを検索するツールとして、Microsoft公式のMicrosoft エラー ルックアップ ツールがあります。このツールを使用すると、エラーコードを入力してその一般的な意味や対処方法を確認できます。
コマンドプロンプト
C:\Tools>Err_6.4.5.exe c000021a
# for hex 0xc000021a / decimal -1073741286
STATUS_SYSTEM_PROCESS_TERMINATED ntstatus.h
# {Fatal System Error}
# The %hs system process terminated unexpectedly with a
# status of 0x%08x (0x%08x 0x%08x).
# The system has been shut down.
# as an HRESULT: Severity: FAILURE (1), FACILITY_NULL (0x0), Code 0x21a
# for hex 0x21a / decimal 538
ERROR_ABIOS_ERROR winerror.h
# An error occurred in the ABIOS subsystem.
# 2 matches found for "c000021a"
本記事執筆時点では、/?
オプションで確認する限りこのツールは以下のヘッダーファイルに定義されているエラーコードを検索できるようです。
activprof.h activscp.h adoint.h adserr.h
asferr.h audioclient.h audioenginebaseapo.h bitsmsg.h
bthdef.h bugcodes.h cderr.h cdosyserr.h
cfgmgr32.h cierror.h corerror.h corsym.h
ctffunc.h d3d.h d3d9.h d3d9helper.h
d3dx10.h d3dx10core.h d3dx9.h d3dx9xof.h
daogetrw.h dbdaoerr.h dciddi.h ddeml.h
ddraw.h dhcpssdk.h difxapi.h dinput.h
dinputd.h dlnaerror.h dmerror.h drt.h
dsound.h dxfile.h eaphosterror.h ehstormsg.h
esent.h fherrors.h filterr.h fltdefs.h
hidpi.h iiscnfg.h imapi2error.h imapi2fserror.h
imapierror.h ime.h intshcut.h ipexport.h
iscsierr.h iscsilog.h jscript9diag.h legacyErrorCodes.h
lmerr.h lmerrlog.h lmsvc.h lpmapi.h
lzexpand.h mciavi.h mdmregistration.h mdmsg.h
mediaerr.h mferror.h mmstream.h mobsync.h
mpeg2error.h mprerror.h mq.h mqoai.h
msctf.h msdrmerror.h msime.h msiquery.h
msopc.h mswmdm.h msxml2.h nb30.h
ndattrib.h netcfgx.h netevent.h netmon.h
netsh.h nserror.h ntdddisk.h ntdsapi.h
ntdsbmsg.h ntiologc.h ntstatus.h odbcinst.h
ole.h olectl.h oledberr.h oledlg.h
p2p.h patchapi.h patchwiz.h pbdaerrors.h
pdhmsg.h photoacquire.h portabledevice.h qossp.h
raserror.h rdcentraldb.h reconcil.h routprot.h
rtcerr.h sberrors.h scesvc.h schannel.h
setupapi.h shellapi.h sherrors.h shimgdata.h
shobjidl_core.h slerror.h snmp.h spatialaudioclient.h
spatialaudiometadata.h sperror.h stierr.h synchronizationerrors.h
tapi.h tapi3err.h tcerror.h textserv.h
textstor.h thumbcache.h tpcerror.h txdtc.h
upnp.h upnphost.h urlmon.h usb.h
usp10.h vdserr.h vfw.h vfwmsgs.h
vsserror.h wbemcli.h wcmerrors.h wcntypes.h
wdfstatus.h wdscpmsg.h wdsmcerr.h wdstptmgmtmsg.h
werapi.h wiadef.h winbio_err.h wincrypt.h
windowsplayready.h windowssearcherrors.h winerror.h winfax.h
winhttp.h wininet.h winioctl.h winldap.h
winsnmp.h winsock2.h winspool.h wpc.h
wsbapperror.h wsmerror.h wuerror.h xapo.h
xaudio2.h xmllite.h xpsdigitalsignature.h xpsobjectmodel.h
xpsobjectmodel_1.h
There are currently 25259 return codes registered from 173 sources.
また、/outputtoJS
オプションを使用すると、JSONファイルとしてエラーコードの情報を出力することができます。JSONファイルは非常にシンプルな構造でしたので、検索できるようにしてWebサイト上で動作するようにしたものをこちらに置いています。(err_6.4.5.exeはローカライズされていないツールなので、上記サイトのJSONには手元でFormatMessage関数を実行した結果もマージしており、厳密には使用している元データは同じではありません。)
Win32 Error Code
名前 | 値 | 説明 |
---|---|---|
ERROR_SUCCESS | 0x00000000 | 成功 |
ERROR_INVALID_FUNCTION | 0x00000001 | 無効な関数です。 |
ERROR_FILE_NOT_FOUND | 0x00000002 | 指定されたファイルが見つかりません。 |
ERROR_PATH_NOT_FOUND | 0x00000003 | 指定されたパスが見つかりません。 |
ERROR_ACCESS_DENIED | 0x00000005 | アクセスが拒否されました。 |
ERROR_INVALID_HANDLE | 0x00000006 | 無効なハンドルです。 |
ERROR_NOT_ENOUGH_MEMORY | 0x00000008 | メモリが不足しています。 |
ERROR_OUTOFMEMORY | 0x0000000E | メモリ不足です。 |
ERROR_SHARING_VIOLATION | 0x00000020 | 共有違反が発生しました。 |
ERROR_NOT_SUPPORTED | 0x00000032 | サポートされていない操作です。 |
ERROR_INVALID_PARAMETER | 0x00000057 | 無効なパラメーターです。 |
ERROR_ALREADY_EXISTS | 0x000000B7 | 指定されたファイルまたはディレクトリはすでに存在します。 |
完全な一覧はこちら。
HRESULT
名前 | 値 | 説明 |
---|---|---|
S_OK | 0x00000000 | 成功 |
E_FAIL | 0x80004005 | 一般的な失敗 |
E_INVALIDARG | 0x80070057 | 無効な引数 |
E_OUTOFMEMORY | 0x8007000E | メモリ不足 |
E_NOTIMPL | 0x80004001 | 実装されていません |
E_NOINTERFACE | 0x80004002 | インターフェイスがサポートされていません |
E_POINTER | 0x80004003 | 無効なポインター |
E_HANDLE | 0x80070006 | 無効なハンドル |
E_ABORT | 0x80004004 | 操作が中止されました |
E_ACCESSDENIED | 0x80070005 | アクセスが拒否されました |
E_UNEXPECTED | 0x8000FFFF | 予期しないエラー |
RPC_E_TOO_LATE | 0x80010119 | |
RPC_E_THREAD_NOT_INIT | 0x8001010F | スレッドが初期化されていません |
RPC_E_SERVERCALL_RETRYLATER | 0x8001010A | サーバー呼び出しを後で再試行してください |
RPC_E_SERVERCALL_REJECTED | 0x8001010B | サーバー呼び出しが拒否されました |
完全な一覧はこちら。
NTSTATUS
名前 | 値 | 説明 |
---|---|---|
STATUS_SUCCESS | 0x00000000 | 成功 |
STATUS_ACCESS_VIOLATION | 0xC0000005 | The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s. |
STATUS_ILLIGAL_INSTRUCTION | 0xC000001D | {EXCEPTION} Illegal Instruction An attempt was made to execute an illegal instruction. |
STATUS_SHARING_VIOLATION | 0xC0000043 | A file cannot be opened because the share access flags are incompatible. |
STATUS_STACK_OVERFLOW | 0xC00000FD | A new guard page for the stack cannot be created. |
STATUS_HEAP_CORRUPTION | 0xC0000374 | A heap has been corrupted. |
STATUS_STACK_BUFFER_OVERRUN | 0xC0000409 | The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application. |
完全な一覧はこちら。
Windows Installer Error Code
完全な一覧はこちら。
msiexec.exe Error Code
名前 | 値 | 説明 |
---|---|---|
ERROR_SUCCESS | 0x00000000 | 操作は成功しました。 |
ERROR_INSTALL_SERVICE_FAILURE | 1601 | Windowsインストーラーサービスにアクセスできませんでした。 |
ERROR_INSTALL_USEREXIT | 1602 | ユーザーがインストールを中止しました。 |
ERROR_INSTALL_ALREADY_RUNNING | 1618 | 別のインストールがすでに実行中です。 |
ERROR_SUCCESS_REBOOT_INITIATED | 1641 | インストーラーが再起動を開始しました。このメッセージは成功を示します。 |
ERROR_SUCCESS_REBOOT_REQUIRED | 3010 | インストールは成功しましたが、再起動が必要です。 |
完全な一覧はこちら。
Windows Update Error Code
完全な一覧はこちら。
WinSock エラーコード
完全な一覧はこちら。