21 #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)    26 #define DIRECTINPUT_VERSION 0x800    34 #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP    40 #define XAUDIO2_E_INVALID_CALL          0x88960001    41 #define XAUDIO2_E_XMA_DECODER_ERROR     0x88960002    42 #define XAUDIO2_E_XAPO_CREATION_FAILED  0x88960003    43 #define XAUDIO2_E_DEVICE_INVALIDATED    0x88960004    45 #define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, 0x897, 0x01)    47 #define DXUTERR_NODIRECT3D              MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0901)    48 #define DXUTERR_NOCOMPATIBLEDEVICES     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0902)    49 #define DXUTERR_MEDIANOTFOUND           MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0903)    50 #define DXUTERR_NONZEROREFCOUNT         MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0904)    51 #define DXUTERR_CREATINGDEVICE          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0905)    52 #define DXUTERR_RESETTINGDEVICE         MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0906)    53 #define DXUTERR_CREATINGDEVICEOBJECTS   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0907)    54 #define DXUTERR_RESETTINGDEVICEOBJECTS  MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0908)    55 #define DXUTERR_INCORRECTVERSION        MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0909)    56 #define DXUTERR_DEVICEREMOVED           MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x090A)    59 #define BUFFER_SIZE 3000    61 #pragma warning( disable : 6001 6221 )    64 #define  CHK_ERR(hrchk, strOut) \    68 #define  CHK_ERRA(hrchk) \    72 #define HRESULT_FROM_WIN32b(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))    74 #define  CHK_ERR_WIN32A(hrchk) \    75         case HRESULT_FROM_WIN32b(hrchk): \    79 #define  CHK_ERR_WIN32_ONLY(hrchk, strOut) \    80         case HRESULT_FROM_WIN32b(hrchk): \   108         CHK_ERRA(CO_E_INIT_SHARED_ALLOCATOR)
   109         CHK_ERRA(CO_E_INIT_MEMORY_ALLOCATOR)
   112         CHK_ERRA(CO_E_INIT_TLS_SET_CHANNEL_CONTROL)
   113         CHK_ERRA(CO_E_INIT_TLS_CHANNEL_CONTROL)
   114         CHK_ERRA(CO_E_INIT_UNACCEPTED_USER_ALLOCATOR)
   115         CHK_ERRA(CO_E_INIT_SCM_MUTEX_EXISTS)
   116         CHK_ERRA(CO_E_INIT_SCM_FILE_MAPPING_EXISTS)
   117         CHK_ERRA(CO_E_INIT_SCM_MAP_VIEW_OF_FILE)
   118         CHK_ERRA(CO_E_INIT_SCM_EXEC_FAILURE)
   119         CHK_ERRA(CO_E_INIT_ONLY_SINGLE_THREADED)
   122         CHK_ERRA(CO_E_WRONG_SERVER_IDENTITY)
   125         CHK_ERRA(CO_E_CREATEPROCESS_FAILURE)
   126         CHK_ERRA(CO_E_RUNAS_CREATEPROCESS_FAILURE)
   128         CHK_ERRA(CO_E_LAUNCH_PERMSSION_DENIED)
   129         CHK_ERRA(CO_E_START_SERVICE_FAILURE)
   130         CHK_ERRA(CO_E_REMOTE_COMMUNICATION_FAILURE)
   175         CHK_ERRA(DRAGDROP_E_ALREADYREGISTERED)
   219         CHK_ERRA(CS_E_OBJECT_ALREADY_EXISTS)
   257         CHK_ERRA(CONVERT10_E_OLESTREAM_BITMAP_TO_DIB)
   259         CHK_ERRA(CONVERT10_E_STG_NO_STD_STREAM)
   260         CHK_ERRA(CONVERT10_E_STG_DIB_TO_BITMAP)
   281         CHK_ERRA(MK_E_INTERMEDIATEINTERFACENOTSUPPORTED)
   311         CHK_ERRA(DRAGDROP_S_USEDEFAULTCURSORS)
   316         CHK_ERRA(CACHE_S_SOMECACHES_NOTUPDATED)
   318         CHK_ERRA(OLEOBJ_S_CANNOT_DOVERB_NOW)
   326         CHK_ERRA(MK_S_MONIKERALREADYREGISTERED)
   364         CHK_ERRA(TYPE_E_QUALIFIEDNAMEDISALLOWED)
   371         CHK_ERRA(TYPE_E_DLLFUNCTIONNOTFOUND)
   381         CHK_ERRA(TYPE_E_INCONSISTENTPROPFUNCS)
   392         CHK_ERRA(STG_E_DISKISWRITEPROTECTED)
   406         CHK_ERRA(STG_E_UNIMPLEMENTEDFUNCTION)
   433         CHK_ERRA(RPC_E_CANTCALLOUT_INASYNCCALL)
   434         CHK_ERRA(RPC_E_CANTCALLOUT_INEXTERNALCALL)
   435         CHK_ERRA(RPC_E_CONNECTION_TERMINATED)
   440         CHK_ERRA(RPC_E_CLIENT_CANTMARSHAL_DATA)
   441         CHK_ERRA(RPC_E_CLIENT_CANTUNMARSHAL_DATA)
   442         CHK_ERRA(RPC_E_SERVER_CANTMARSHAL_DATA)
   443         CHK_ERRA(RPC_E_SERVER_CANTUNMARSHAL_DATA)
   450         CHK_ERRA(RPC_E_ATTEMPTED_MULTITHREAD)
   458         CHK_ERRA(RPC_E_SERVERCALL_RETRYLATER)
   461         CHK_ERRA(RPC_E_CANTCALLOUT_ININPUTSYNCCALL)
   474         CHK_ERRA(RPC_E_NO_GOOD_SECURITY_PACKAGES)
   485         CHK_ERRA(CO_E_FAILEDTOOPENTHREADTOKEN)
   487         CHK_ERRA(CO_E_TRUSTEEDOESNTMATCHCLIENT)
   488         CHK_ERRA(CO_E_FAILEDTOQUERYCLIENTBLANKET)
   492         CHK_ERRA(CO_E_WRONGTRUSTEENAMESYNTAX)
   507         CHK_ERRA(CO_E_INCOMPATIBLESTREAMVERSION)
   508         CHK_ERRA(CO_E_FAILEDTOOPENPROCESSTOKEN)
   546         CHK_ERRA(NTE_TOKEN_KEYSET_STORAGE_FULL)
   551         CHK_ERRA(CRYPT_E_UNEXPECTED_ENCODING)
   557         CHK_ERRA(CRYPT_E_RECIPIENT_NOT_FOUND)
   559         CHK_ERRA(CRYPT_E_ISSUER_SERIALNUMBER)
   561         CHK_ERRA(CRYPT_E_ATTRIBUTES_MISSING)
   562         CHK_ERRA(CRYPT_E_STREAM_MSG_NOT_READY)
   563         CHK_ERRA(CRYPT_E_STREAM_INSUFFICIENT_DATA)
   573         CHK_ERRA(CRYPT_E_UNEXPECTED_MSG_TYPE)
   581         CHK_ERRA(CRYPT_E_NO_REVOCATION_CHECK)
   582         CHK_ERRA(CRYPT_E_REVOCATION_OFFLINE)
   583         CHK_ERRA(CRYPT_E_NOT_IN_REVOCATION_DATABASE)
   584         CHK_ERRA(CRYPT_E_INVALID_NUMERIC_STRING)
   585         CHK_ERRA(CRYPT_E_INVALID_PRINTABLE_STRING)
   586         CHK_ERRA(CRYPT_E_INVALID_IA5_STRING)
   587         CHK_ERRA(CRYPT_E_INVALID_X500_STRING)
   591         CHK_ERRA(CRYPT_E_NO_VERIFY_USAGE_DLL)
   592         CHK_ERRA(CRYPT_E_NO_VERIFY_USAGE_CHECK)
   593         CHK_ERRA(CRYPT_E_VERIFY_USAGE_OFFLINE)
   609         CHK_ERRA(OSS_INDEFINITE_NOT_SUPPORTED)
   615         CHK_ERRA(OSS_ACCESS_SERIALIZATION_ERROR)
   620         CHK_ERRA(OSS_CANT_OPEN_TRACE_WINDOW)
   624         CHK_ERRA(OSS_TRACE_FILE_ALREADY_OPEN)
   631         CHK_ERRA(OSS_CONSTRAINT_DLL_NOT_LINKED)
   632         CHK_ERRA(OSS_COMPARATOR_DLL_NOT_LINKED)
   633         CHK_ERRA(OSS_COMPARATOR_CODE_NOT_LINKED)
   634         CHK_ERRA(OSS_MEM_MGR_DLL_NOT_LINKED)
   643         CHK_ERRA(CERTSRV_E_BAD_REQUESTSUBJECT)
   645         CHK_ERRA(CERTSRV_E_BAD_REQUESTSTATUS)
   647         CHK_ERRA(CERTSRV_E_INVALID_CA_CERTIFICATE)
   648         CHK_ERRA(CERTSRV_E_UNSUPPORTED_CERT_TYPE)
   657         CHK_ERRA(TRUST_E_FINANCIAL_CRITERIA)
   661         CHK_ERRA(TRUST_E_SUBJECT_FORM_UNKNOWN)
   662         CHK_ERRA(TRUST_E_SUBJECT_NOT_TRUSTED)
   672         CHK_ERRA(CERT_E_VALIDITYPERIODNESTING)
   687         CHK_ERRA(SPAPI_E_EXPECTED_SECTION_NAME)
   688         CHK_ERRA(SPAPI_E_BAD_SECTION_NAME_LINE)
   689         CHK_ERRA(SPAPI_E_SECTION_NAME_TOO_LONG)
   695         CHK_ERRA(SPAPI_E_NO_ASSOCIATED_CLASS)
   698         CHK_ERRA(SPAPI_E_NO_DRIVER_SELECTED)
   699         CHK_ERRA(SPAPI_E_KEY_DOES_NOT_EXIST)
   700         CHK_ERRA(SPAPI_E_INVALID_DEVINST_NAME)
   702         CHK_ERRA(SPAPI_E_DEVINST_ALREADY_EXISTS)
   703         CHK_ERRA(SPAPI_E_DEVINFO_NOT_REGISTERED)
   704         CHK_ERRA(SPAPI_E_INVALID_REG_PROPERTY)
   707         CHK_ERRA(SPAPI_E_CANT_LOAD_CLASS_ICON)
   708         CHK_ERRA(SPAPI_E_INVALID_CLASS_INSTALLER)
   712         CHK_ERRA(SPAPI_E_NO_DEVICE_SELECTED)
   713         CHK_ERRA(SPAPI_E_DEVINFO_LIST_LOCKED)
   714         CHK_ERRA(SPAPI_E_DEVINFO_DATA_LOCKED)
   716         CHK_ERRA(SPAPI_E_NO_CLASSINSTALL_PARAMS)
   718         CHK_ERRA(SPAPI_E_BAD_SERVICE_INSTALLSECT)
   719         CHK_ERRA(SPAPI_E_NO_CLASS_DRIVER_LIST)
   720         CHK_ERRA(SPAPI_E_NO_ASSOCIATED_SERVICE)
   721         CHK_ERRA(SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE)
   722         CHK_ERRA(SPAPI_E_DEVICE_INTERFACE_ACTIVE)
   723         CHK_ERRA(SPAPI_E_DEVICE_INTERFACE_REMOVED)
   724         CHK_ERRA(SPAPI_E_BAD_INTERFACE_INSTALLSECT)
   725         CHK_ERRA(SPAPI_E_NO_SUCH_INTERFACE_CLASS)
   726         CHK_ERRA(SPAPI_E_INVALID_REFERENCE_STRING)
   727         CHK_ERRA(SPAPI_E_INVALID_MACHINENAME)
   728         CHK_ERRA(SPAPI_E_REMOTE_COMM_FAILURE)
   729         CHK_ERRA(SPAPI_E_MACHINE_UNAVAILABLE)
   730         CHK_ERRA(SPAPI_E_NO_CONFIGMGR_SERVICES)
   731         CHK_ERRA(SPAPI_E_INVALID_PROPPAGE_PROVIDER)
   732         CHK_ERRA(SPAPI_E_NO_SUCH_DEVICE_INTERFACE)
   733         CHK_ERRA(SPAPI_E_DI_POSTPROCESSING_REQUIRED)
   734         CHK_ERRA(SPAPI_E_INVALID_COINSTALLER)
   737         CHK_ERRA(SPAPI_E_INVALID_INF_LOGCONFIG)
   739         CHK_ERRA(SPAPI_E_INVALID_FILTER_DRIVER)
   740         CHK_ERRA(SPAPI_E_NON_WINDOWS_NT_DRIVER)
   741         CHK_ERRA(SPAPI_E_NON_WINDOWS_DRIVER)
   742         CHK_ERRA(SPAPI_E_NO_CATALOG_FOR_OEM_INF)
   743         CHK_ERRA(SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE)
   744         CHK_ERRA(SPAPI_E_ERROR_NOT_INSTALLED)
   753         CHK_ERRA(SCARD_E_INSUFFICIENT_BUFFER)
   768         CHK_ERRA(SCARD_E_READER_UNAVAILABLE)
   771         CHK_ERRA(SCARD_E_READER_UNSUPPORTED)
   779         CHK_ERRA(SCARD_E_UNSUPPORTED_FEATURE)
   789         CHK_ERRA(SCARD_E_NO_SUCH_CERTIFICATE)
   790         CHK_ERRA(SCARD_E_CERTIFICATE_UNAVAILABLE)
   791         CHK_ERRA(SCARD_E_NO_READERS_AVAILABLE)
   798         CHK_ERRA(SCARD_W_SECURITY_VIOLATION)
   955         CHK_ERRA(ERROR_RING2SEG_MUST_BE_MOVABLE)
   956         CHK_ERRA(ERROR_RELOC_CHAIN_XEEDS_SEGLIM)
  2098         CHK_ERRA(CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT)
  2105         CHK_ERRA(CO_E_NO_SECCTX_IN_ACTIVATE)
  2110         CHK_ERRA(REGDB_E_BADTHREADINGMODEL)
  2145         CHK_ERRA(CO_E_ACTIVATIONFAILED_EVENTLOGGED)
  2146         CHK_ERRA(CO_E_ACTIVATIONFAILED_CATALOGERROR)
  2147         CHK_ERRA(CO_E_ACTIVATIONFAILED_TIMEOUT)
  2148         CHK_ERRA(CO_E_INITIALIZATIONFAILED)
  2151         CHK_ERRA(CO_E_THREADINGMODEL_CHANGED)
  2163         CHK_ERRA(SCHED_S_TASK_NO_MORE_RUNS)
  2164         CHK_ERRA(SCHED_S_TASK_NOT_SCHEDULED)
  2166         CHK_ERRA(SCHED_S_TASK_NO_VALID_TRIGGERS)
  2168         CHK_ERRA(SCHED_E_TRIGGER_NOT_FOUND)
  2171         CHK_ERRA(SCHED_E_SERVICE_NOT_INSTALLED)
  2174         CHK_ERRA(SCHED_E_ACCOUNT_INFORMATION_NOT_SET)
  2175         CHK_ERRA(SCHED_E_ACCOUNT_NAME_NOT_FOUND)
  2176         CHK_ERRA(SCHED_E_ACCOUNT_DBASE_CORRUPT)
  2177         CHK_ERRA(SCHED_E_NO_SECURITY_SERVICES)
  2178         CHK_ERRA(SCHED_E_UNKNOWN_OBJECT_VERSION)
  2179         CHK_ERRA(SCHED_E_UNSUPPORTED_ACCOUNT_OPTION)
  2180         CHK_ERRA(SCHED_E_SERVICE_NOT_RUNNING)
  2182         CHK_ERRA(STG_E_STATUS_COPY_PROTECTION_FAILURE)
  2183         CHK_ERRA(STG_E_CSS_AUTHENTICATION_FAILURE)
  2184         CHK_ERRA(STG_E_CSS_KEY_NOT_PRESENT)
  2185         CHK_ERRA(STG_E_CSS_KEY_NOT_ESTABLISHED)
  2186         CHK_ERRA(STG_E_CSS_SCRAMBLED_SECTOR)
  2187         CHK_ERRA(STG_E_CSS_REGION_MISMATCH)
  2194         CHK_ERRA(SEC_E_INSUFFICIENT_MEMORY)
  2196         CHK_ERRA(SEC_E_UNSUPPORTED_FUNCTION)
  2207         CHK_ERRA(SEC_E_UNKNOWN_CREDENTIALS)
  2211         CHK_ERRA(SEC_E_NO_AUTHENTICATING_AUTHORITY)
  2214         CHK_ERRA(SEC_I_COMPLETE_AND_CONTINUE)
  2220         CHK_ERRA(SEC_E_INCOMPLETE_CREDENTIALS)
  2222         CHK_ERRA(SEC_I_INCOMPLETE_CREDENTIALS)
  2234         CHK_ERRA(SEC_E_SECURITY_QOS_FAILED)
  2235         CHK_ERRA(SEC_E_UNFINISHED_CONTEXT_DELETED)
  2238         CHK_ERRA(SEC_E_WRONG_CREDENTIAL_HANDLE)
  2239         CHK_ERRA(SEC_E_CRYPTO_SYSTEM_INVALID)
  2240         CHK_ERRA(SEC_E_MAX_REFERRALS_EXCEEDED)
  2242         CHK_ERRA(SEC_E_STRONG_CRYPTO_NOT_SUPPORTED)
  2243         CHK_ERRA(SEC_E_TOO_MANY_PRINCIPALS)
  2245         CHK_ERRA(SEC_E_PKINIT_NAME_MISMATCH)
  2246         CHK_ERRA(SEC_E_SMARTCARD_LOGON_REQUIRED)
  2247         CHK_ERRA(SEC_E_SHUTDOWN_IN_PROGRESS)
  2248         CHK_ERRA(SEC_E_KDC_INVALID_REQUEST)
  2249         CHK_ERRA(SEC_E_KDC_UNABLE_TO_REFER)
  2251         CHK_ERRA(SEC_E_UNSUPPORTED_PREAUTH)
  2252         CHK_ERRA(SEC_E_DELEGATION_REQUIRED)
  2258         CHK_ERRA(SEC_E_SMARTCARD_CERT_REVOKED)
  2259         CHK_ERRA(SEC_E_ISSUING_CA_UNTRUSTED)
  2260         CHK_ERRA(SEC_E_REVOCATION_OFFLINE_C)
  2261         CHK_ERRA(SEC_E_PKINIT_CLIENT_FAILURE)
  2262         CHK_ERRA(SEC_E_SMARTCARD_CERT_EXPIRED)
  2265         CHK_ERRA(CRYPT_I_NEW_PROTECTION_REQUIRED)
  2266         CHK_ERRA(CRYPT_E_MISSING_PUBKEY_PARA)
  2286         CHK_ERRA(CERTSRV_E_SERVER_SUSPENDED)
  2287         CHK_ERRA(CERTSRV_E_ENCODING_LENGTH)
  2289         CHK_ERRA(CERTSRV_E_RESTRICTEDOFFICER)
  2290         CHK_ERRA(CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED)
  2292         CHK_ERRA(CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL)
  2293         CHK_ERRA(CERTSRV_E_NO_CAADMIN_DEFINED)
  2294         CHK_ERRA(CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE)
  2296         CHK_ERRA(CERTSRV_E_ALIGNMENT_FAULT)
  2298         CHK_ERRA(CERTSRV_E_TEMPLATE_DENIED)
  2300         CHK_ERRA(CERTSRV_E_TEMPLATE_CONFLICT)
  2301         CHK_ERRA(CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED)
  2302         CHK_ERRA(CERTSRV_E_ARCHIVED_KEY_REQUIRED)
  2304         CHK_ERRA(CERTSRV_E_BAD_RENEWAL_SUBJECT)
  2305         CHK_ERRA(CERTSRV_E_BAD_TEMPLATE_VERSION)
  2306         CHK_ERRA(CERTSRV_E_TEMPLATE_POLICY_REQUIRED)
  2307         CHK_ERRA(CERTSRV_E_SIGNATURE_POLICY_REQUIRED)
  2308         CHK_ERRA(CERTSRV_E_SIGNATURE_COUNT)
  2309         CHK_ERRA(CERTSRV_E_SIGNATURE_REJECTED)
  2310         CHK_ERRA(CERTSRV_E_ISSUANCE_POLICY_REQUIRED)
  2311         CHK_ERRA(CERTSRV_E_SUBJECT_UPN_REQUIRED)
  2312         CHK_ERRA(CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED)
  2313         CHK_ERRA(CERTSRV_E_SUBJECT_DNS_REQUIRED)
  2314         CHK_ERRA(CERTSRV_E_ARCHIVED_KEY_UNEXPECTED)
  2319         CHK_ERRA(XENROLL_E_KEY_NOT_EXPORTABLE)
  2320         CHK_ERRA(XENROLL_E_CANNOT_ADD_ROOT_CERT)
  2321         CHK_ERRA(XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND)
  2322         CHK_ERRA(XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH)
  2323         CHK_ERRA(XENROLL_E_RESPONSE_KA_HASH_MISMATCH)
  2324         CHK_ERRA(XENROLL_E_KEYSPEC_SMIME_MISMATCH)
  2328         CHK_ERRA(MSSIPOTF_E_BAD_MAGICNUMBER)
  2329         CHK_ERRA(MSSIPOTF_E_BAD_OFFSET_TABLE)
  2330         CHK_ERRA(MSSIPOTF_E_TABLE_TAGORDER)
  2331         CHK_ERRA(MSSIPOTF_E_TABLE_LONGWORD)
  2332         CHK_ERRA(MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT)
  2333         CHK_ERRA(MSSIPOTF_E_TABLES_OVERLAP)
  2334         CHK_ERRA(MSSIPOTF_E_TABLE_PADBYTES)
  2336         CHK_ERRA(MSSIPOTF_E_TABLE_CHECKSUM)
  2339         CHK_ERRA(MSSIPOTF_E_FAILED_HINTS_CHECK)
  2344         CHK_ERRA(MSSIPOTF_E_DSIG_STRUCTURE)
  2347         CHK_ERRA(TRUST_E_EXPLICIT_DISTRUST)
  2352         CHK_ERRA(SPAPI_E_CANT_REMOVE_DEVINST)
  2356         CHK_ERRA(SPAPI_E_SET_SYSTEM_RESTORE_POINT)
  2357         CHK_ERRA(SPAPI_E_INCORRECTLY_COPIED_INF)
  2360         CHK_ERRA(SCARD_W_CARD_NOT_AUTHENTICATED)
  2364         CHK_ERRA(COMADMIN_E_ALREADYINSTALLED)
  2365         CHK_ERRA(COMADMIN_E_APP_FILE_WRITEFAIL)
  2366         CHK_ERRA(COMADMIN_E_APP_FILE_READFAIL)
  2367         CHK_ERRA(COMADMIN_E_APP_FILE_VERSION)
  2369         CHK_ERRA(COMADMIN_E_APPLICATIONEXISTS)
  2373         CHK_ERRA(COMADMIN_E_INVALIDUSERIDS)
  2374         CHK_ERRA(COMADMIN_E_NOREGISTRYCLSID)
  2375         CHK_ERRA(COMADMIN_E_BADREGISTRYPROGID)
  2376         CHK_ERRA(COMADMIN_E_AUTHENTICATIONLEVEL)
  2377         CHK_ERRA(COMADMIN_E_USERPASSWDNOTVALID)
  2378         CHK_ERRA(COMADMIN_E_CLSIDORIIDMISMATCH)
  2379         CHK_ERRA(COMADMIN_E_REMOTEINTERFACE)
  2380         CHK_ERRA(COMADMIN_E_DLLREGISTERSERVER)
  2383         CHK_ERRA(COMADMIN_E_BADREGISTRYLIBID)
  2384         CHK_ERRA(COMADMIN_E_APPDIRNOTFOUND)
  2385         CHK_ERRA(COMADMIN_E_REGISTRARFAILED)
  2386         CHK_ERRA(COMADMIN_E_COMPFILE_DOESNOTEXIST)
  2387         CHK_ERRA(COMADMIN_E_COMPFILE_LOADDLLFAIL)
  2388         CHK_ERRA(COMADMIN_E_COMPFILE_GETCLASSOBJ)
  2389         CHK_ERRA(COMADMIN_E_COMPFILE_CLASSNOTAVAIL)
  2390         CHK_ERRA(COMADMIN_E_COMPFILE_BADTLB)
  2391         CHK_ERRA(COMADMIN_E_COMPFILE_NOTINSTALLABLE)
  2395         CHK_ERRA(COMADMIN_E_COMP_MOVE_LOCKED)
  2396         CHK_ERRA(COMADMIN_E_COMP_MOVE_BAD_DEST)
  2399         CHK_ERRA(COMADMIN_E_COMPFILE_NOREGISTRAR)
  2400         CHK_ERRA(COMADMIN_E_COREQCOMPINSTALLED)
  2401         CHK_ERRA(COMADMIN_E_SERVICENOTINSTALLED)
  2402         CHK_ERRA(COMADMIN_E_PROPERTYSAVEFAILED)
  2404         CHK_ERRA(COMADMIN_E_COMPONENTEXISTS)
  2405         CHK_ERRA(COMADMIN_E_REGFILE_CORRUPT)
  2406         CHK_ERRA(COMADMIN_E_PROPERTY_OVERFLOW)
  2408         CHK_ERRA(COMADMIN_E_OBJECTNOTPOOLABLE)
  2409         CHK_ERRA(COMADMIN_E_APPLID_MATCHES_CLSID)
  2410         CHK_ERRA(COMADMIN_E_ROLE_DOES_NOT_EXIST)
  2411         CHK_ERRA(COMADMIN_E_START_APP_NEEDS_COMPONENTS)
  2412         CHK_ERRA(COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM)
  2413         CHK_ERRA(COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY)
  2414         CHK_ERRA(COMADMIN_E_CAN_NOT_START_APP)
  2415         CHK_ERRA(COMADMIN_E_CAN_NOT_EXPORT_SYS_APP)
  2416         CHK_ERRA(COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT)
  2417         CHK_ERRA(COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER)
  2418         CHK_ERRA(COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE)
  2419         CHK_ERRA(COMADMIN_E_BASE_PARTITION_ONLY)
  2420         CHK_ERRA(COMADMIN_E_START_APP_DISABLED)
  2421         CHK_ERRA(COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME)
  2422         CHK_ERRA(COMADMIN_E_CAT_INVALID_PARTITION_NAME)
  2423         CHK_ERRA(COMADMIN_E_CAT_PARTITION_IN_USE)
  2424         CHK_ERRA(COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES)
  2425         CHK_ERRA(COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED)
  2426         CHK_ERRA(COMADMIN_E_AMBIGUOUS_APPLICATION_NAME)
  2427         CHK_ERRA(COMADMIN_E_AMBIGUOUS_PARTITION_NAME)
  2428         CHK_ERRA(COMADMIN_E_REGDB_NOTINITIALIZED)
  2430         CHK_ERRA(COMADMIN_E_REGDB_SYSTEMERR)
  2431         CHK_ERRA(COMADMIN_E_REGDB_ALREADYRUNNING)
  2432         CHK_ERRA(COMADMIN_E_MIG_VERSIONNOTSUPPORTED)
  2433         CHK_ERRA(COMADMIN_E_MIG_SCHEMANOTFOUND)
  2434         CHK_ERRA(COMADMIN_E_CAT_BITNESSMISMATCH)
  2435         CHK_ERRA(COMADMIN_E_CAT_UNACCEPTABLEBITNESS)
  2436         CHK_ERRA(COMADMIN_E_CAT_WRONGAPPBITNESS)
  2437         CHK_ERRA(COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED)
  2438         CHK_ERRA(COMADMIN_E_CAT_SERVERFAULT)
  2439         CHK_ERRA(COMQC_E_APPLICATION_NOT_QUEUED)
  2440         CHK_ERRA(COMQC_E_NO_QUEUEABLE_INTERFACES)
  2441         CHK_ERRA(COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE)
  2442         CHK_ERRA(COMQC_E_NO_IPERSISTSTREAM)
  2445         CHK_ERRA(COMQC_E_UNTRUSTED_ENQUEUER)
  2446         CHK_ERRA(MSDTC_E_DUPLICATE_RESOURCE)
  2447         CHK_ERRA(COMADMIN_E_OBJECT_PARENT_MISSING)
  2448         CHK_ERRA(COMADMIN_E_OBJECT_DOES_NOT_EXIST)
  2449         CHK_ERRA(COMADMIN_E_APP_NOT_RUNNING)
  2450         CHK_ERRA(COMADMIN_E_INVALID_PARTITION)
  2451         CHK_ERRA(COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE)
  2453         CHK_ERRA(COMADMIN_E_CANTRECYCLELIBRARYAPPS)
  2454         CHK_ERRA(COMADMIN_E_CANTRECYCLESERVICEAPPS)
  2455         CHK_ERRA(COMADMIN_E_PROCESSALREADYRECYCLED)
  2456         CHK_ERRA(COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED)
  2457         CHK_ERRA(COMADMIN_E_CANTMAKEINPROCSERVICE)
  2458         CHK_ERRA(COMADMIN_E_PROGIDINUSEBYCLSID)
  2459         CHK_ERRA(COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET)
  2460         CHK_ERRA(COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED)
  2461         CHK_ERRA(COMADMIN_E_PARTITION_ACCESSDENIED)
  2462         CHK_ERRA(COMADMIN_E_PARTITION_MSI_ONLY)
  2463         CHK_ERRA(COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT)
  2464         CHK_ERRA(COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS)
  2465         CHK_ERRA(COMADMIN_E_COMP_MOVE_SOURCE)
  2466         CHK_ERRA(COMADMIN_E_COMP_MOVE_DEST)
  2467         CHK_ERRA(COMADMIN_E_COMP_MOVE_PRIVATE)
  2468         CHK_ERRA(COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET)
  2469         CHK_ERRA(COMADMIN_E_CANNOT_ALIAS_EVENTCLASS)
  2470         CHK_ERRA(COMADMIN_E_PRIVATE_ACCESSDENIED)
  2472         CHK_ERRA(COMADMIN_E_REGISTRY_ACCESSDENIED)
  2680         CHK_ERR_WIN32A(ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE)
  2697         CHK_ERR_WIN32A(ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER)
  2772         CHK_ERR_WIN32A(ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR)
  2840         CHK_ERR_WIN32A(ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE)
  2841         CHK_ERR_WIN32A(ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE)
  2842         CHK_ERR_WIN32A(ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT)
  2902         CHK_ERR_WIN32A(ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME)
  3006         CHK_ERR_WIN32A(ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY)
  3012 #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)  3018         CHK_ERRA(DDERR_CANNOTATTACHSURFACE)
  3019         CHK_ERRA(DDERR_CANNOTDETACHSURFACE)
  3024         CHK_ERRA(DDERR_INCOMPATIBLEPRIMARY)
  3039         CHK_ERRA(DDERR_NOCOOPERATIVELEVELSET)
  3042         CHK_ERRA(DDERR_NODIRECTDRAWSUPPORT)
  3064         CHK_ERRA(DDERR_OVERLAYCOLORKEYONLYONEACTIVE)
  3067         CHK_ERRA(DDERR_SURFACEALREADYATTACHED)
  3068         CHK_ERRA(DDERR_SURFACEALREADYDEPENDENT)
  3081         CHK_ERRA(DDERR_VERTICALBLANKINPROGRESS)
  3083         CHK_ERRA(DDERR_DDSCAPSCOMPLEXREQUIRED)
  3085         CHK_ERRA(DDERR_INVALIDDIRECTDRAWGUID)
  3086         CHK_ERRA(DDERR_DIRECTDRAWALREADYCREATED)
  3088         CHK_ERRA(DDERR_PRIMARYSURFACEALREADYEXISTS)
  3105         CHK_ERRA(DDERR_EXCLUSIVEMODEALREADYSET)
  3120         CHK_ERRA(DDERR_NOTONMIPMAPSUBLEVEL)
  3132         CHK_ERRA(DDERR_NOMONITORINFORMATION)
  3134         CHK_ERRA(DDERR_DEVICEDOESNTOWNSURFACE)
  3152         CHK_ERR(DIERR_INSUFFICIENTPRIVS, 
"DIERR_INSUFFICIENTPRIVS & VFW_E_INVALIDMEDIATYPE")
  3153         CHK_ERR(DIERR_DEVICEFULL, 
"DIERR_DEVICEFULL & VFW_E_INVALIDSUBTYPE & DMO_E_INVALIDSTREAMINDEX")
  3154         CHK_ERR(DIERR_MOREDATA, 
"DIERR_MOREDATA & VFW_E_NEED_OWNER & DMO_E_INVALIDTYPE")
  3155         CHK_ERR(DIERR_NOTDOWNLOADED, 
"DIERR_NOTDOWNLOADED & VFW_E_ENUM_OUT_OF_SYNC & DMO_E_TYPE_NOT_SET")
  3156         CHK_ERR(DIERR_HASEFFECTS, 
"DIERR_HASEFFECTS & VFW_E_ALREADY_CONNECTED & DMO_E_NOTACCEPTING")
  3157         CHK_ERR(DIERR_NOTEXCLUSIVEACQUIRED, 
"DIERR_NOTEXCLUSIVEACQUIRED & VFW_E_FILTER_ACTIVE & DMO_E_TYPE_NOT_ACCEPTED")
  3158         CHK_ERR(DIERR_INCOMPLETEEFFECT, 
"DIERR_INCOMPLETEEFFECT & VFW_E_NO_TYPES & DMO_E_NO_MORE_ITEMS")
  3159         CHK_ERR(DIERR_NOTBUFFERED, 
"DIERR_NOTBUFFERED & VFW_E_NO_ACCEPTABLE_TYPES")
  3160         CHK_ERR(DIERR_EFFECTPLAYING, 
"DIERR_EFFECTPLAYING & VFW_E_INVALID_DIRECTION")
  3161         CHK_ERR(DIERR_UNPLUGGED, 
"DIERR_UNPLUGGED & VFW_E_NOT_CONNECTED")
  3162         CHK_ERR(DIERR_REPORTFULL, 
"DIERR_REPORTFULL & VFW_E_NO_ALLOCATOR")
  3163         CHK_ERR(DIERR_MAPFILEFAIL, 
"DIERR_MAPFILEFAIL & VFW_E_RUNTIME_ERROR")
  3193         CHK_ERR(DIERR_DRIVERFIRST+1, 
"DIERR_DRIVERFIRST+1")
  3194         CHK_ERR(DIERR_DRIVERFIRST+2, 
"DIERR_DRIVERFIRST+2")
  3195         CHK_ERR(DIERR_DRIVERFIRST+3, 
"DIERR_DRIVERFIRST+3")
  3196         CHK_ERR(DIERR_DRIVERFIRST+4, 
"DIERR_DRIVERFIRST+4")
  3197         CHK_ERR(DIERR_DRIVERFIRST+5, 
"DIERR_DRIVERFIRST+5")
  3199         CHK_ERR(DIERR_INVALIDCLASSINSTALLER, 
"DIERR_INVALIDCLASSINSTALLER")
  3200         CHK_ERR(DIERR_CANCELLED, 
"DIERR_CANCELLED & MS_E_SAMPLEALLOC")
  3207         CHK_ERRA(D3DERR_WRONGTEXTUREFORMAT)
  3208         CHK_ERRA(D3DERR_UNSUPPORTEDCOLOROPERATION)
  3209         CHK_ERRA(D3DERR_UNSUPPORTEDCOLORARG)
  3210         CHK_ERRA(D3DERR_UNSUPPORTEDALPHAOPERATION)
  3211         CHK_ERRA(D3DERR_UNSUPPORTEDALPHAARG)
  3213         CHK_ERRA(D3DERR_CONFLICTINGTEXTUREFILTER)
  3214         CHK_ERRA(D3DERR_UNSUPPORTEDFACTORVALUE)
  3215         CHK_ERRA(D3DERR_CONFLICTINGRENDERSTATE)
  3216         CHK_ERRA(D3DERR_UNSUPPORTEDTEXTUREFILTER)
  3217         CHK_ERRA(D3DERR_CONFLICTINGTEXTUREPALETTE)
  3218         CHK_ERRA(D3DERR_DRIVERINTERNALERROR)
  3234             CHK_ERRA(S_RESIDENT_IN_SHARED_MEMORY)
  3240         CHK_ERRA(D3DERR_UNSUPPORTEDOVERLAY)
  3241         CHK_ERRA(D3DERR_UNSUPPORTEDOVERLAYFORMAT)
  3242         CHK_ERRA(D3DERR_CANNOTPROTECTCONTENT)
  3244         CHK_ERRA(D3DERR_PRESENT_STATISTICS_DISJOINT)
  3276 #endif // !WINAPI_FAMILY || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP  3281         CHK_ERRA(D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS)
  3282         CHK_ERRA(D3D10_ERROR_FILE_NOT_FOUND)
  3289         CHK_ERRA(DXGI_STATUS_NO_REDIRECTION)
  3290         CHK_ERRA(DXGI_STATUS_NO_DESKTOP_ACCESS)
  3291         CHK_ERRA(DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE)
  3293         CHK_ERRA(DXGI_STATUS_MODE_CHANGE_IN_PROGRESS)
  3298         CHK_ERRA(DXGI_ERROR_DEVICE_REMOVED)
  3301         CHK_ERRA(DXGI_ERROR_WAS_STILL_DRAWING)
  3302         CHK_ERRA(DXGI_ERROR_FRAME_STATISTICS_DISJOINT)
  3303         CHK_ERRA(DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE)
  3304         CHK_ERRA(DXGI_ERROR_DRIVER_INTERNAL_ERROR)
  3306         CHK_ERRA(DXGI_ERROR_NOT_CURRENTLY_AVAILABLE)
  3307         CHK_ERRA(DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED)
  3308         CHK_ERRA(DXGI_ERROR_REMOTE_OUTOFMEMORY)
  3313         CHK_ERRA(D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS)
  3314         CHK_ERRA(D3D11_ERROR_FILE_NOT_FOUND)
  3315         CHK_ERRA(D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS)
  3316         CHK_ERRA(D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD)
  3318 #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP  3327         CHK_ERRA(D2DERR_UNSUPPORTED_OPERATION)
  3329         CHK_ERRA(D2DERR_SCREEN_ACCESS_DENIED)
  3330         CHK_ERRA(D2DERR_DISPLAY_STATE_INVALID)
  3333         CHK_ERRA(D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED)
  3335         CHK_ERRA(D2DERR_NO_HARDWARE_DEVICE)
  3337         CHK_ERRA(D2DERR_TOO_MANY_SHADER_ELEMENTS)
  3338         CHK_ERRA(D2DERR_SHADER_COMPILE_FAILED)
  3339         CHK_ERRA(D2DERR_MAX_TEXTURE_SIZE_EXCEEDED)
  3340         CHK_ERRA(D2DERR_UNSUPPORTED_VERSION)
  3343         CHK_ERRA(D2DERR_LAYER_ALREADY_IN_USE)
  3344         CHK_ERRA(D2DERR_POP_CALL_DID_NOT_MATCH_PUSH)
  3346         CHK_ERRA(D2DERR_PUSH_POP_UNBALANCED)
  3347         CHK_ERRA(D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT)
  3348         CHK_ERRA(D2DERR_INCOMPATIBLE_BRUSH_TYPES)
  3350         CHK_ERRA(D2DERR_TARGET_NOT_GDI_COMPATIBLE)
  3351         CHK_ERRA(D2DERR_TEXT_EFFECT_IS_WRONG_TYPE)
  3352         CHK_ERRA(D2DERR_TEXT_RENDERER_NOT_RELEASED)
  3363         CHK_ERRA(DWRITE_E_FONTCOLLECTIONOBSOLETE)
  3364         CHK_ERRA(DWRITE_E_ALREADYREGISTERED)
  3370         CHK_ERRA(WINCODEC_ERR_VALUEOUTOFRANGE)
  3371         CHK_ERRA(WINCODEC_ERR_UNKNOWNIMAGEFORMAT)
  3372         CHK_ERRA(WINCODEC_ERR_UNSUPPORTEDVERSION)
  3373         CHK_ERRA(WINCODEC_ERR_NOTINITIALIZED)
  3374         CHK_ERRA(WINCODEC_ERR_ALREADYLOCKED)
  3375         CHK_ERRA(WINCODEC_ERR_PROPERTYNOTFOUND)
  3376         CHK_ERRA(WINCODEC_ERR_PROPERTYNOTSUPPORTED)
  3377         CHK_ERRA(WINCODEC_ERR_PROPERTYSIZE)
  3378         CHK_ERRA(WINCODEC_ERR_CODECPRESENT)
  3379         CHK_ERRA(WINCODEC_ERR_CODECNOTHUMBNAIL)
  3380         CHK_ERRA(WINCODEC_ERR_PALETTEUNAVAILABLE)
  3381         CHK_ERRA(WINCODEC_ERR_CODECTOOMANYSCANLINES)
  3382         CHK_ERRA(WINCODEC_ERR_INTERNALERROR)
  3383         CHK_ERRA(WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS)
  3384         CHK_ERRA(WINCODEC_ERR_COMPONENTNOTFOUND)
  3385         CHK_ERRA(WINCODEC_ERR_IMAGESIZEOUTOFRANGE)
  3386         CHK_ERRA(WINCODEC_ERR_TOOMUCHMETADATA)
  3389         CHK_ERRA(WINCODEC_ERR_FRAMEMISSING)
  3390         CHK_ERRA(WINCODEC_ERR_BADMETADATAHEADER)
  3391         CHK_ERRA(WINCODEC_ERR_BADSTREAMDATA)
  3394         CHK_ERRA(WINCODEC_ERR_STREAMNOTAVAILABLE)
  3395         CHK_ERRA(WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT)
  3396         CHK_ERRA(WINCODEC_ERR_UNSUPPORTEDOPERATION)
  3397         CHK_ERRA(WINCODEC_ERR_INVALIDREGISTRATION)
  3398         CHK_ERRA(WINCODEC_ERR_COMPONENTINITIALIZEFAILURE)
  3399         CHK_ERRA(WINCODEC_ERR_INSUFFICIENTBUFFER)
  3400         CHK_ERRA(WINCODEC_ERR_DUPLICATEMETADATAPRESENT)
  3401         CHK_ERRA(WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE)
  3402         CHK_ERRA(WINCODEC_ERR_UNEXPECTEDSIZE)
  3403         CHK_ERRA(WINCODEC_ERR_INVALIDQUERYREQUEST)
  3404         CHK_ERRA(WINCODEC_ERR_UNEXPECTEDMETADATATYPE)
  3405         CHK_ERRA(WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT)
  3406         CHK_ERRA(WINCODEC_ERR_INVALIDQUERYCHARACTER)
  3408         CHK_ERRA(WINCODEC_ERR_INVALIDPROGRESSIVELEVEL)
  3410 #endif // !WINAPI_FAMILY || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP  3446 #undef HRESULT_FROM_WIN32b  3447 #undef CHK_ERR_WIN32A  3448 #undef CHK_ERR_WIN32_ONLY  3450 #define  CHK_ERRA(hrchk) \  3452              wcscpy_s( desc, count, L#hrchk );  3454 #define  CHK_ERR(hrchk, strOut) \  3456              wcscpy_s( desc, count, L##strOut );  3468     UINT icount = 
static_cast<UINT
>( std::min<size_t>( count, 32767 ) );
  3470     DWORD result = FormatMessageW( FORMAT_MESSAGE_FROM_SYSTEM, 
nullptr, hr, 
  3471                                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), desc, icount, 
nullptr );
  3480 #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)  3485         CHK_ERR(DDERR_ALREADYINITIALIZED, 
"This object is already initialized")
  3486         CHK_ERR(DDERR_CANNOTATTACHSURFACE, 
"This surface can not be attached to the requested surface.")
  3487         CHK_ERR(DDERR_CANNOTDETACHSURFACE, 
"This surface can not be detached from the requested surface.")
  3488         CHK_ERR(DDERR_CURRENTLYNOTAVAIL, 
"Support is currently not available.")
  3489         CHK_ERR(DDERR_EXCEPTION, 
"An exception was encountered while performing the requested operation")
  3491         CHK_ERR(DDERR_HEIGHTALIGN, 
"Height of rectangle provided is not a multiple of reqd alignment")
  3492         CHK_ERR(DDERR_INCOMPATIBLEPRIMARY, 
"Unable to match primary surface creation request with existing primary surface.")
  3493         CHK_ERR(DDERR_INVALIDCAPS, 
"One or more of the caps bits passed to the callback are incorrect.")
  3494         CHK_ERR(DDERR_INVALIDCLIPLIST, 
"DirectDraw does not support provided Cliplist.")
  3495         CHK_ERR(DDERR_INVALIDMODE, 
"DirectDraw does not support the requested mode")
  3496         CHK_ERR(DDERR_INVALIDOBJECT, 
"DirectDraw received a pointer that was an invalid DIRECTDRAW object.")
  3498         CHK_ERR(DDERR_INVALIDPIXELFORMAT, 
"pixel format was invalid as specified")
  3499         CHK_ERR(DDERR_INVALIDRECT, 
"Rectangle provided was invalid.")
  3500         CHK_ERR(DDERR_LOCKEDSURFACES, 
"Operation could not be carried out because one or more surfaces are locked")
  3501         CHK_ERR(DDERR_NO3D, 
"There is no 3D present.")
  3502         CHK_ERR(DDERR_NOALPHAHW, 
"Operation could not be carried out because there is no alpha accleration hardware present or available.")
  3503         CHK_ERR(DDERR_NOSTEREOHARDWARE, 
"Operation could not be carried out because there is no stereo hardware present or available.")
  3504         CHK_ERR(DDERR_NOSURFACELEFT, 
"Operation could not be carried out because there is no hardware present which supports stereo surfaces")
  3505         CHK_ERR(DDERR_NOCLIPLIST, 
"no clip list available")
  3506         CHK_ERR(DDERR_NOCOLORCONVHW, 
"Operation could not be carried out because there is no color conversion hardware present or available.")
  3507         CHK_ERR(DDERR_NOCOOPERATIVELEVELSET, 
"Create function called without DirectDraw object method SetCooperativeLevel being called.")
  3508         CHK_ERR(DDERR_NOCOLORKEY, 
"Surface doesn't currently have a color key")
  3509         CHK_ERR(DDERR_NOCOLORKEYHW, 
"Operation could not be carried out because there is no hardware support of the dest color key.")
  3510         CHK_ERR(DDERR_NODIRECTDRAWSUPPORT, 
"No DirectDraw support possible with current display driver")
  3511         CHK_ERR(DDERR_NOEXCLUSIVEMODE, 
"Operation requires the application to have exclusive mode but the application does not have exclusive mode.")
  3512         CHK_ERR(DDERR_NOFLIPHW, 
"Flipping visible surfaces is not supported.")
  3513         CHK_ERR(DDERR_NOGDI, 
"There is no GDI present.")
  3514         CHK_ERR(DDERR_NOMIRRORHW, 
"Operation could not be carried out because there is no hardware present or available.")
  3515         CHK_ERR(DDERR_NOTFOUND, 
"Requested item was not found")
  3516         CHK_ERR(DDERR_NOOVERLAYHW, 
"Operation could not be carried out because there is no overlay hardware present or available.")
  3517         CHK_ERR(DDERR_OVERLAPPINGRECTS, 
"Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.")
  3518         CHK_ERR(DDERR_NORASTEROPHW, 
"Operation could not be carried out because there is no appropriate raster op hardware present or available.")
  3519         CHK_ERR(DDERR_NOROTATIONHW, 
"Operation could not be carried out because there is no rotation hardware present or available.")
  3520         CHK_ERR(DDERR_NOSTRETCHHW, 
"Operation could not be carried out because there is no hardware support for stretching")
  3521         CHK_ERR(DDERR_NOT4BITCOLOR, 
"DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.")
  3522         CHK_ERR(DDERR_NOT4BITCOLORINDEX, 
"DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.")
  3523         CHK_ERR(DDERR_NOT8BITCOLOR, 
"DirectDraw Surface is not in 8 bit color mode and the requested operation requires 8 bit color.")
  3524         CHK_ERR(DDERR_NOTEXTUREHW, 
"Operation could not be carried out because there is no texture mapping hardware present or available.")
  3525         CHK_ERR(DDERR_NOVSYNCHW, 
"Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.")
  3526         CHK_ERR(DDERR_NOZBUFFERHW, 
"Operation could not be carried out because there is no hardware support for zbuffer blting.")
  3527         CHK_ERR(DDERR_NOZOVERLAYHW, 
"Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.")
  3528         CHK_ERR(DDERR_OUTOFCAPS, 
"The hardware needed for the requested operation has already been allocated.")
  3531         CHK_ERR(DDERR_OVERLAYCANTCLIP, 
"hardware does not support clipped overlays")
  3532         CHK_ERR(DDERR_OVERLAYCOLORKEYONLYONEACTIVE, 
"Can only have ony color key active at one time for overlays")
  3533         CHK_ERR(DDERR_PALETTEBUSY, 
"Access to this palette is being refused because the palette is already locked by another thread.")
  3534         CHK_ERR(DDERR_COLORKEYNOTSET, 
"No src color key specified for this operation.")
  3535         CHK_ERR(DDERR_SURFACEALREADYATTACHED, 
"This surface is already attached to the surface it is being attached to.")
  3536         CHK_ERR(DDERR_SURFACEALREADYDEPENDENT, 
"This surface is already a dependency of the surface it is being made a dependency of.")
  3537         CHK_ERR(DDERR_SURFACEBUSY, 
"Access to this surface is being refused because the surface is already locked by another thread.")
  3538         CHK_ERR(DDERR_CANTLOCKSURFACE, 
"Access to this surface is being refused because no driver exists which can supply a pointer to the surface. This is most likely to happen when attempting to lock the primary surface when no DCI provider is present. Will also happen on attempts to lock an optimized surface.")
  3539         CHK_ERR(DDERR_SURFACEISOBSCURED, 
"Access to Surface refused because Surface is obscured.")
  3540         CHK_ERR(DDERR_SURFACELOST, 
"Access to this surface is being refused because the surface is gone. The DIRECTDRAWSURFACE object representing this surface should have Restore called on it.")
  3541         CHK_ERR(DDERR_SURFACENOTATTACHED, 
"The requested surface is not attached.")
  3542         CHK_ERR(DDERR_TOOBIGHEIGHT, 
"Height requested by DirectDraw is too large.")
  3543         CHK_ERR(DDERR_TOOBIGSIZE, 
"Size requested by DirectDraw is too large --  The individual height and width are OK.")
  3544         CHK_ERR(DDERR_TOOBIGWIDTH, 
"Width requested by DirectDraw is too large.")
  3546         CHK_ERR(DDERR_UNSUPPORTEDFORMAT, 
"Pixel format requested is unsupported by DirectDraw")
  3547         CHK_ERR(DDERR_UNSUPPORTEDMASK, 
"Bitmask in the pixel format requested is unsupported by DirectDraw")
  3548         CHK_ERR(DDERR_INVALIDSTREAM, 
"The specified stream contains invalid data")
  3549         CHK_ERR(DDERR_VERTICALBLANKINPROGRESS, 
"vertical blank is in progress")
  3550         CHK_ERR(DDERR_WASSTILLDRAWING, 
"Was still drawing")
  3551         CHK_ERR(DDERR_DDSCAPSCOMPLEXREQUIRED, 
"The specified surface type requires specification of the COMPLEX flag")
  3552         CHK_ERR(DDERR_XALIGN, 
"Rectangle provided was not horizontally aligned on reqd. boundary")
  3553         CHK_ERR(DDERR_INVALIDDIRECTDRAWGUID, 
"The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.")
  3554         CHK_ERR(DDERR_DIRECTDRAWALREADYCREATED, 
"A DirectDraw object representing this driver has already been created for this process.")
  3555         CHK_ERR(DDERR_NODIRECTDRAWHW, 
"A hardware only DirectDraw object creation was attempted but the driver did not support any hardware.")
  3556         CHK_ERR(DDERR_PRIMARYSURFACEALREADYEXISTS, 
"this process already has created a primary surface")
  3557         CHK_ERR(DDERR_NOEMULATION, 
"software emulation not available.")
  3558         CHK_ERR(DDERR_REGIONTOOSMALL, 
"region passed to Clipper::GetClipList is too small.")
  3559         CHK_ERR(DDERR_CLIPPERISUSINGHWND, 
"an attempt was made to set a clip list for a clipper objec that is already monitoring an hwnd.")
  3560         CHK_ERR(DDERR_NOCLIPPERATTACHED, 
"No clipper object attached to surface object")
  3561         CHK_ERR(DDERR_NOHWND, 
"Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.")
  3562         CHK_ERR(DDERR_HWNDSUBCLASSED, 
"HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.")
  3563         CHK_ERR(DDERR_HWNDALREADYSET, 
"The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.")
  3564         CHK_ERR(DDERR_NOPALETTEATTACHED, 
"No palette object attached to this surface.")
  3565         CHK_ERR(DDERR_NOPALETTEHW, 
"No hardware support for 16 or 256 color palettes.")
  3566         CHK_ERR(DDERR_BLTFASTCANTCLIP, 
"If a clipper object is attached to the source surface passed into a BltFast call.")
  3567         CHK_ERR(DDERR_NOBLTHW, 
"No blter.")
  3568         CHK_ERR(DDERR_NODDROPSHW, 
"No DirectDraw ROP hardware.")
  3569         CHK_ERR(DDERR_OVERLAYNOTVISIBLE, 
"returned when GetOverlayPosition is called on a hidden overlay")
  3570         CHK_ERR(DDERR_NOOVERLAYDEST, 
"returned when GetOverlayPosition is called on a overlay that UpdateOverlay has never been called on to establish a destionation.")
  3571         CHK_ERR(DDERR_INVALIDPOSITION, 
"returned when the position of the overlay on the destionation is no longer legal for that destionation.")
  3572         CHK_ERR(DDERR_NOTAOVERLAYSURFACE, 
"returned when an overlay member is called for a non-overlay surface")
  3573         CHK_ERR(DDERR_EXCLUSIVEMODEALREADYSET, 
"An attempt was made to set the cooperative level when it was already set to exclusive.")
  3574         CHK_ERR(DDERR_NOTFLIPPABLE, 
"An attempt has been made to flip a surface that is not flippable.")
  3575         CHK_ERR(DDERR_CANTDUPLICATE, 
"Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.")
  3576         CHK_ERR(DDERR_NOTLOCKED, 
"Surface was not locked.  An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.")
  3577         CHK_ERR(DDERR_CANTCREATEDC, 
"Windows can not create any more DCs, or a DC was requested for a paltte-indexed surface when the surface had no palette AND the display mode was not palette-indexed (in this case DirectDraw cannot select a proper palette into the DC)")
  3578         CHK_ERR(DDERR_NODC, 
"No DC was ever created for this surface.")
  3579         CHK_ERR(DDERR_WRONGMODE, 
"This surface can not be restored because it was created in a different mode.")
  3580         CHK_ERR(DDERR_IMPLICITLYCREATED, 
"This surface can not be restored because it is an implicitly created surface.")
  3581         CHK_ERR(DDERR_NOTPALETTIZED, 
"The surface being used is not a palette-based surface")
  3582         CHK_ERR(DDERR_UNSUPPORTEDMODE, 
"The display is currently in an unsupported mode")
  3583         CHK_ERR(DDERR_NOMIPMAPHW, 
"Operation could not be carried out because there is no mip-map texture mapping hardware present or available.")
  3584         CHK_ERR(DDERR_INVALIDSURFACETYPE, 
"The requested action could not be performed because the surface was of the wrong type.")
  3585         CHK_ERR(DDERR_NOOPTIMIZEHW, 
"Device does not support optimized surfaces, therefore no video memory optimized surfaces")
  3586         CHK_ERR(DDERR_NOTLOADED, 
"Surface is an optimized surface, but has not yet been allocated any memory")
  3587         CHK_ERR(DDERR_NOFOCUSWINDOW, 
"Attempt was made to create or set a device window without first setting the focus window")
  3588         CHK_ERR(DDERR_NOTONMIPMAPSUBLEVEL, 
"Attempt was made to set a palette on a mipmap sublevel")
  3589         CHK_ERR(DDERR_DCALREADYCREATED, 
"A DC has already been returned for this surface. Only one DC can be retrieved per surface.")
  3590         CHK_ERR(DDERR_NONONLOCALVIDMEM, 
"An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.")
  3591         CHK_ERR(DDERR_CANTPAGELOCK, 
"The attempt to page lock a surface failed.")
  3592         CHK_ERR(DDERR_CANTPAGEUNLOCK, 
"The attempt to page unlock a surface failed.")
  3593         CHK_ERR(DDERR_NOTPAGELOCKED, 
"An attempt was made to page unlock a surface with no outstanding page locks.")
  3594         CHK_ERR(DDERR_MOREDATA, 
"There is more data available than the specified buffer size could hold")
  3595         CHK_ERR(DDERR_EXPIRED, 
"The data has expired and is therefore no longer valid.")
  3596         CHK_ERR(DDERR_TESTFINISHED, 
"The mode test has finished executing.")
  3597         CHK_ERR(DDERR_NEWMODE, 
"The mode test has switched to a new mode.")
  3598         CHK_ERR(DDERR_D3DNOTINITIALIZED, 
"D3D has not yet been initialized.")
  3599         CHK_ERR(DDERR_VIDEONOTACTIVE, 
"The video port is not active")
  3600         CHK_ERR(DDERR_NOMONITORINFORMATION, 
"The monitor does not have EDID data.")
  3601         CHK_ERR(DDERR_NODRIVERSUPPORT, 
"The driver does not enumerate display mode refresh rates.")
  3602         CHK_ERR(DDERR_DEVICEDOESNTOWNSURFACE, 
"Surfaces created by one direct draw device cannot be used directly by another direct draw device.")
  3621         CHK_ERR(DIERR_OLDDIRECTINPUTVERSION, 
"The application requires a newer version of DirectInput.")
  3624         CHK_ERR(DIERR_BETADIRECTINPUTVERSION, 
"The application was written for an unsupported prerelease version of DirectInput.")
  3625         CHK_ERR(DIERR_BADDRIVERVER, 
"The object could not be created due to an incompatible driver version or mismatched or incomplete driver components.")
  3634         CHK_ERR(DIERR_NOTINITIALIZED, 
"This object has not been initialized")
  3635         CHK_ERR(DIERR_ALREADYINITIALIZED, 
"This object is already initialized")
  3638         CHK_ERR(DIERR_INPUTLOST, 
"Access to the device has been lost.  It must be re-acquired.")
  3639         CHK_ERR(DIERR_ACQUIRED, 
"The operation cannot be performed while the device is acquired.")
  3640         CHK_ERR(DIERR_NOTACQUIRED, 
"The operation cannot be performed unless the device is acquired.")
  3643         CHK_ERR(DIERR_INSUFFICIENTPRIVS, 
"Unable to IDirectInputJoyConfig_Acquire because the user does not have sufficient privileges to change the joystick configuration. & An invalid media type was specified")
  3644         CHK_ERR(DIERR_DEVICEFULL, 
"The device is full. & An invalid media subtype was specified.")
  3645         CHK_ERR(DIERR_MOREDATA, 
"Not all the requested information fit into the buffer. & This object can only be created as an aggregated object.")
  3646         CHK_ERR(DIERR_NOTDOWNLOADED, 
"The effect is not downloaded. & The enumerator has become invalid.")
  3647         CHK_ERR(DIERR_HASEFFECTS, 
"The device cannot be reinitialized because there are still effects attached to it. & At least one of the pins involved in the operation is already connected.")
  3648         CHK_ERR(DIERR_NOTEXCLUSIVEACQUIRED, 
"The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode. & This operation cannot be performed because the filter is active.")
  3649         CHK_ERR(DIERR_INCOMPLETEEFFECT, 
"The effect could not be downloaded because essential information is missing.  For example, no axes have been associated with the effect, or no type-specific information has been created. & One of the specified pins supports no media types.")
  3650         CHK_ERR(DIERR_NOTBUFFERED, 
"Attempted to read buffered device data from a device that is not buffered. & There is no common media type between these pins.")
  3651         CHK_ERR(DIERR_EFFECTPLAYING, 
"An attempt was made to modify parameters of an effect while it is playing.  Not all hardware devices support altering the parameters of an effect while it is playing. & Two pins of the same direction cannot be connected together.")
  3652         CHK_ERR(DIERR_UNPLUGGED, 
"The operation could not be completed because the device is not plugged in. & The operation cannot be performed because the pins are not connected.")
  3653         CHK_ERR(DIERR_REPORTFULL, 
"SendDeviceData failed because more information was requested to be sent than can be sent to the device.  Some devices have restrictions on how much data can be sent to them.  (For example, there might be a limit on the number of buttons that can be pressed at once.) & No sample buffer allocator is available.")
  3654         CHK_ERR(DIERR_MAPFILEFAIL, 
"A mapper file function failed because reading or writing the user or IHV settings file failed. & A run-time error occurred.")
  3659         CHK_ERR(DIERR_NOMOREITEMS, 
"No more items.")
  3660         CHK_ERR(DIERR_DRIVERFIRST, 
"Device driver-specific codes. Unless the specific driver has been precisely identified, no meaning should be attributed to these values other than that the driver originated the error.")
  3661         CHK_ERR(DIERR_DRIVERFIRST+1, 
"DIERR_DRIVERFIRST+1")
  3662         CHK_ERR(DIERR_DRIVERFIRST+2, 
"DIERR_DRIVERFIRST+2")
  3663         CHK_ERR(DIERR_DRIVERFIRST+3, 
"DIERR_DRIVERFIRST+3")
  3664         CHK_ERR(DIERR_DRIVERFIRST+4, 
"DIERR_DRIVERFIRST+4")
  3665         CHK_ERR(DIERR_DRIVERFIRST+5, 
"DIERR_DRIVERFIRST+5")
  3666         CHK_ERR(DIERR_DRIVERLAST, 
"Device installer errors.")
  3667         CHK_ERR(DIERR_INVALIDCLASSINSTALLER, 
"Registry entry or DLL for class installer invalid or class installer not found.")
  3668         CHK_ERR(DIERR_CANCELLED, 
"The user cancelled the install operation. & The stream already has allocated samples and the surface doesn't match the sample format.")
  3669         CHK_ERR(DIERR_BADINF, 
"The INF file for the selected device could not be found or is invalid or is damaged. & The specified purpose ID can't be used for the call.")
  3675         CHK_ERR(D3DERR_WRONGTEXTUREFORMAT, 
"Wrong texture format")
  3676         CHK_ERR(D3DERR_UNSUPPORTEDCOLOROPERATION, 
"Unsupported color operation")
  3677         CHK_ERR(D3DERR_UNSUPPORTEDCOLORARG, 
"Unsupported color arg")
  3678         CHK_ERR(D3DERR_UNSUPPORTEDALPHAOPERATION, 
"Unsupported alpha operation")
  3679         CHK_ERR(D3DERR_UNSUPPORTEDALPHAARG, 
"Unsupported alpha arg")
  3680         CHK_ERR(D3DERR_TOOMANYOPERATIONS, 
"Too many operations")
  3681         CHK_ERR(D3DERR_CONFLICTINGTEXTUREFILTER, 
"Conflicting texture filter")
  3682         CHK_ERR(D3DERR_UNSUPPORTEDFACTORVALUE, 
"Unsupported factor value")
  3683         CHK_ERR(D3DERR_CONFLICTINGRENDERSTATE, 
"Conflicting render state")
  3684         CHK_ERR(D3DERR_UNSUPPORTEDTEXTUREFILTER, 
"Unsupported texture filter")
  3685         CHK_ERR(D3DERR_CONFLICTINGTEXTUREPALETTE, 
"Conflicting texture palette")
  3686         CHK_ERR(D3DERR_DRIVERINTERNALERROR, 
"Driver internal error")
  3687         CHK_ERR(D3DERR_NOTFOUND, 
"Not found")
  3688         CHK_ERR(D3DERR_MOREDATA, 
"More data")
  3689         CHK_ERR(D3DERR_DEVICELOST, 
"Device lost")
  3690         CHK_ERR(D3DERR_DEVICENOTRESET, 
"Device not reset")
  3691         CHK_ERR(D3DERR_NOTAVAILABLE, 
"Not available")
  3692         CHK_ERR(D3DERR_OUTOFVIDEOMEMORY, 
"Out of video memory")
  3693         CHK_ERR(D3DERR_INVALIDDEVICE, 
"Invalid device")
  3694         CHK_ERR(D3DERR_INVALIDCALL, 
"Invalid call")
  3695         CHK_ERR(D3DERR_DRIVERINVALIDCALL, 
"Driver invalid call")
  3697         CHK_ERR(D3DOK_NOAUTOGEN, 
"The call succeeded but there won't be any mipmaps generated")
  3700             CHK_ERR(D3DERR_DEVICEREMOVED, 
"Hardware device was removed")
  3701             CHK_ERR(S_NOT_RESIDENT, 
"Resource not resident in memory")
  3702             CHK_ERR(S_RESIDENT_IN_SHARED_MEMORY, 
"Resource resident in shared memory")
  3703             CHK_ERR(S_PRESENT_MODE_CHANGED, 
"Desktop display mode has changed")
  3704             CHK_ERR(S_PRESENT_OCCLUDED, 
"Client window is occluded (minimized or other fullscreen)")
  3705             CHK_ERR(D3DERR_DEVICEHUNG, 
"Hardware adapter reset by OS")
  3708         CHK_ERR(D3DERR_UNSUPPORTEDOVERLAY, 
"Overlay is not supported" )
  3709         CHK_ERR(D3DERR_UNSUPPORTEDOVERLAYFORMAT, 
"Overlay format is not supported" )
  3710         CHK_ERR(D3DERR_CANNOTPROTECTCONTENT, 
"Contect protection not available" )
  3711         CHK_ERR(D3DERR_UNSUPPORTEDCRYPTO, 
"Unsupported cryptographic system" )
  3712         CHK_ERR(D3DERR_PRESENT_STATISTICS_DISJOINT, 
"Presentation statistics are disjoint" )
  3719         CHK_ERR(DS_NO_VIRTUALIZATION, 
"The call succeeded, but we had to substitute the 3D algorithm")
  3720         CHK_ERR(DSERR_ALLOCATED, 
"The call failed because resources (such as a priority level) were already being used by another caller")
  3721         CHK_ERR(DSERR_CONTROLUNAVAIL, 
"The control (vol, pan, etc.) requested by the caller is not available")
  3723         CHK_ERR(DSERR_INVALIDCALL, 
"This call is not valid for the current state of this object")
  3725         CHK_ERR(DSERR_PRIOLEVELNEEDED, 
"The caller does not have the priority level required for the function to succeed")
  3727         CHK_ERR(DSERR_BADFORMAT, 
"The specified WAVE format is not supported")
  3729         CHK_ERR(DSERR_NODRIVER, 
"No sound driver is available for use")
  3730         CHK_ERR(DSERR_ALREADYINITIALIZED, 
"This object is already initialized")
  3732         CHK_ERR(DSERR_BUFFERLOST, 
"The buffer memory has been lost, and must be restored")
  3733         CHK_ERR(DSERR_OTHERAPPHASPRIO, 
"Another app has a higher priority level, preventing this call from succeeding")
  3734         CHK_ERR(DSERR_UNINITIALIZED, 
"This object has not been initialized")
  3737         CHK_ERR(DSERR_BUFFERTOOSMALL, 
"Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds")
  3738         CHK_ERR(DSERR_DS8_REQUIRED, 
"Attempt to use DirectSound 8 functionality on an older DirectSound object")
  3739         CHK_ERR(DSERR_SENDLOOP, 
"A circular loop of send effects was detected")
  3740         CHK_ERR(DSERR_BADSENDBUFFERGUID, 
"The GUID specified in an audiopath file does not match a valid MIXIN buffer")
  3741         CHK_ERR(DSERR_OBJECTNOTFOUND, 
"The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)")
  3743         CHK_ERR(DSERR_FXUNAVAILABLE, 
"Requested effects are not available")
  3745 #endif // !WINAPI_FAMILY || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP  3750         CHK_ERR(D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS, 
"There are too many unique state objects.")
  3751         CHK_ERR(D3D10_ERROR_FILE_NOT_FOUND, 
"File not found")
  3756         CHK_ERR(DXGI_STATUS_OCCLUDED, 
"The target window or output has been occluded. The application should suspend rendering operations if possible.")
  3757         CHK_ERR(DXGI_STATUS_CLIPPED, 
"Target window is clipped.")
  3758         CHK_ERR(DXGI_STATUS_NO_REDIRECTION, 
"")
  3759         CHK_ERR(DXGI_STATUS_NO_DESKTOP_ACCESS, 
"No access to desktop.")
  3760         CHK_ERR(DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE, 
"")
  3761         CHK_ERR(DXGI_STATUS_MODE_CHANGED, 
"Display mode has changed")
  3762         CHK_ERR(DXGI_STATUS_MODE_CHANGE_IN_PROGRESS, 
"Display mode is changing")
  3763         CHK_ERR(DXGI_ERROR_INVALID_CALL, 
"The application has made an erroneous API call that it had enough information to avoid. This error is intended to denote that the application should be altered to avoid the error. Use of the debug version of the DXGI.DLL will provide run-time debug output with further information.")
  3764         CHK_ERR(DXGI_ERROR_NOT_FOUND, 
"The item requested was not found. For GetPrivateData calls, this means that the specified GUID had not been previously associated with the object.")
  3765         CHK_ERR(DXGI_ERROR_MORE_DATA, 
"The specified size of the destination buffer is too small to hold the requested data.")
  3766         CHK_ERR(DXGI_ERROR_UNSUPPORTED, 
"Unsupported.")
  3767         CHK_ERR(DXGI_ERROR_DEVICE_REMOVED, 
"Hardware device removed.")
  3768         CHK_ERR(DXGI_ERROR_DEVICE_HUNG, 
"Device hung due to badly formed commands.")
  3769         CHK_ERR(DXGI_ERROR_DEVICE_RESET, 
"Device reset due to a badly formed commant.")
  3770         CHK_ERR(DXGI_ERROR_WAS_STILL_DRAWING, 
"Was still drawing.")
  3771         CHK_ERR(DXGI_ERROR_FRAME_STATISTICS_DISJOINT, 
"The requested functionality is not supported by the device or the driver.")
  3772         CHK_ERR(DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE, 
"The requested functionality is not supported by the device or the driver.")
  3773         CHK_ERR(DXGI_ERROR_DRIVER_INTERNAL_ERROR, 
"An internal driver error occurred.")
  3774         CHK_ERR(DXGI_ERROR_NONEXCLUSIVE, 
"The application attempted to perform an operation on an DXGI output that is only legal after the output has been claimed for exclusive owenership.")
  3775         CHK_ERR(DXGI_ERROR_NOT_CURRENTLY_AVAILABLE, 
"The requested functionality is not supported by the device or the driver.")
  3776         CHK_ERR(DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED, 
"Remote desktop client disconnected.")
  3777         CHK_ERR(DXGI_ERROR_REMOTE_OUTOFMEMORY, 
"Remote desktop client is out of memory.")
  3782         CHK_ERR(D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS, 
"There are too many unique state objects.")
  3783         CHK_ERR(D3D11_ERROR_FILE_NOT_FOUND, 
"File not found")
  3784         CHK_ERR(D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS, 
"Therea are too many unique view objects.")
  3785         CHK_ERR(D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, 
"Deferred context requires Map-Discard usage pattern")
  3787 #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP  3794         CHK_ERR(D2DERR_WRONG_STATE, 
"The object was not in the correct state to process the method.")
  3795         CHK_ERR(D2DERR_NOT_INITIALIZED, 
"The object has not yet been initialized.")
  3796         CHK_ERR(D2DERR_UNSUPPORTED_OPERATION, 
"The requested opertion is not supported.")
  3797         CHK_ERR(D2DERR_SCANNER_FAILED, 
"The geomery scanner failed to process the data.")
  3798         CHK_ERR(D2DERR_SCREEN_ACCESS_DENIED, 
"D2D could not access the screen.")
  3799         CHK_ERR(D2DERR_DISPLAY_STATE_INVALID, 
"A valid display state could not be determined.")
  3800         CHK_ERR(D2DERR_ZERO_VECTOR, 
"The supplied vector is zero.")
  3801         CHK_ERR(D2DERR_INTERNAL_ERROR, 
"An internal error (D2D bug) occurred. On checked builds, we would assert.")
  3802         CHK_ERR(D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED, 
"The display format we need to render is not supported by the hardware device.")
  3803         CHK_ERR(D2DERR_INVALID_CALL, 
"A call to this method is invalid.")
  3804         CHK_ERR(D2DERR_NO_HARDWARE_DEVICE, 
"No HW rendering device is available for this operation.")
  3805         CHK_ERR(D2DERR_RECREATE_TARGET, 
"here has been a presentation error that may be recoverable. The caller needs to recreate, rerender the entire frame, and reattempt present.")
  3806         CHK_ERR(D2DERR_TOO_MANY_SHADER_ELEMENTS, 
"Shader construction failed because it was too complex.")
  3807         CHK_ERR(D2DERR_SHADER_COMPILE_FAILED, 
"Shader compilation failed.")
  3808         CHK_ERR(D2DERR_MAX_TEXTURE_SIZE_EXCEEDED, 
"Requested DX surface size exceeded maximum texture size.")
  3809         CHK_ERR(D2DERR_UNSUPPORTED_VERSION, 
"The requested D2D version is not supported.")
  3810         CHK_ERR(D2DERR_BAD_NUMBER, 
"Invalid number.")
  3811         CHK_ERR(D2DERR_WRONG_FACTORY, 
"Objects used together must be created from the same factory instance.")
  3812         CHK_ERR(D2DERR_LAYER_ALREADY_IN_USE, 
"A layer resource can only be in use once at any point in time.")
  3813         CHK_ERR(D2DERR_POP_CALL_DID_NOT_MATCH_PUSH, 
"The pop call did not match the corresponding push call")
  3815         CHK_ERR(D2DERR_PUSH_POP_UNBALANCED, 
"The push and pop calls were unbalanced")
  3816         CHK_ERR(D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT, 
"Attempt to copy from a render target while a layer or clip rect is applied")
  3817         CHK_ERR(D2DERR_INCOMPATIBLE_BRUSH_TYPES, 
"The brush types are incompatible for the call.")
  3818         CHK_ERR(D2DERR_WIN32_ERROR, 
"An unknown win32 failure occurred.")
  3819         CHK_ERR(D2DERR_TARGET_NOT_GDI_COMPATIBLE, 
"The render target is not compatible with GDI")
  3820         CHK_ERR(D2DERR_TEXT_EFFECT_IS_WRONG_TYPE, 
"A text client drawing effect object is of the wrong type")
  3821         CHK_ERR(D2DERR_TEXT_RENDERER_NOT_RELEASED, 
"The application is holding a reference to the IDWriteTextRenderer interface after the corresponding DrawText or DrawTextLayout call has returned. The IDWriteTextRenderer instance will be zombied.")
  3827         CHK_ERR(DWRITE_E_FILEFORMAT, 
"Indicates an error in an input file such as a font file.")
  3828         CHK_ERR(DWRITE_E_UNEXPECTED, 
"Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from.")
  3829         CHK_ERR(DWRITE_E_NOFONT, 
"Indicates the specified font does not exist.")
  3830         CHK_ERR(DWRITE_E_FILENOTFOUND, 
"A font file could not be opened because the file, directory, network location, drive, or other storage location does not exist or is unavailable.")
  3831         CHK_ERR(DWRITE_E_FILEACCESS, 
"A font file exists but could not be opened due to access denied, sharing violation, or similar error.")
  3832         CHK_ERR(DWRITE_E_FONTCOLLECTIONOBSOLETE, 
"A font collection is obsolete due to changes in the system.")
  3833         CHK_ERR(DWRITE_E_ALREADYREGISTERED, 
"The given interface is already registered.")
  3838         CHK_ERR(WINCODEC_ERR_WRONGSTATE, 
"WIC object in incorrect state.")
  3839         CHK_ERR(WINCODEC_ERR_VALUEOUTOFRANGE, 
"WIC Value out of range.")
  3840         CHK_ERR(WINCODEC_ERR_UNKNOWNIMAGEFORMAT, 
"Encountered unexpected value or setting in WIC image format.")
  3841         CHK_ERR(WINCODEC_ERR_UNSUPPORTEDVERSION, 
"Unsupported WINCODEC_SD_VERSION passed to WIC factory.")
  3842         CHK_ERR(WINCODEC_ERR_NOTINITIALIZED, 
"WIC component not initialized.")
  3843         CHK_ERR(WINCODEC_ERR_ALREADYLOCKED, 
"WIC bitmap object already locked.")
  3844         CHK_ERR(WINCODEC_ERR_PROPERTYNOTFOUND, 
"WIC property not found.")
  3845         CHK_ERR(WINCODEC_ERR_PROPERTYNOTSUPPORTED, 
"WIC property not supported.")
  3846         CHK_ERR(WINCODEC_ERR_PROPERTYSIZE, 
"Invalid property size")
  3847         CHK_ERRA(WINCODEC_ERR_CODECPRESENT) 
  3848         CHK_ERRA(WINCODEC_ERR_CODECNOTHUMBNAIL) 
  3849         CHK_ERR(WINCODEC_ERR_PALETTEUNAVAILABLE, 
"Required palette data not available.")
  3850         CHK_ERR(WINCODEC_ERR_CODECTOOMANYSCANLINES, 
"More scanlines requested than are available in WIC bitmap.")
  3851         CHK_ERR(WINCODEC_ERR_INTERNALERROR, 
"Unexpected internal error in WIC.")
  3852         CHK_ERR(WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS, 
"Source WIC rectangle does not match bitmap dimensions.")
  3853         CHK_ERR(WINCODEC_ERR_COMPONENTNOTFOUND, 
"WIC component not found.")
  3854         CHK_ERR(WINCODEC_ERR_IMAGESIZEOUTOFRANGE, 
"Image size beyond expected boundaries for WIC codec." )
  3855         CHK_ERR(WINCODEC_ERR_TOOMUCHMETADATA, 
"Image metadata size beyond expected boundaries for WIC codec.")
  3856         CHK_ERR(WINCODEC_ERR_BADIMAGE, 
"WIC image is corrupted.")
  3857         CHK_ERR(WINCODEC_ERR_BADHEADER, 
"Invalid header found in WIC image.")
  3858         CHK_ERR(WINCODEC_ERR_FRAMEMISSING, 
"Expected bitmap frame data not found in WIC image." )
  3859         CHK_ERR(WINCODEC_ERR_BADMETADATAHEADER, 
"Invalid metadata header found in WIC image.")
  3860         CHK_ERR(WINCODEC_ERR_BADSTREAMDATA, 
"Invalid stream data found in WIC image.")
  3861         CHK_ERR(WINCODEC_ERR_STREAMWRITE, 
"WIC operation on write stream failed.")
  3862         CHK_ERR(WINCODEC_ERR_STREAMREAD, 
"WIC operation on read stream failed.")
  3863         CHK_ERR(WINCODEC_ERR_STREAMNOTAVAILABLE, 
"Required stream is not available." )
  3864         CHK_ERR(WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT, 
"The pixel format is not supported.")
  3865         CHK_ERR(WINCODEC_ERR_UNSUPPORTEDOPERATION, 
"This operation is not supported by WIC." )
  3866         CHK_ERR(WINCODEC_ERR_INVALIDREGISTRATION, 
"Error occurred reading WIC codec registry keys.")
  3867         CHK_ERR(WINCODEC_ERR_COMPONENTINITIALIZEFAILURE, 
"Failed initializing WIC codec.")
  3868         CHK_ERR(WINCODEC_ERR_INSUFFICIENTBUFFER, 
"Not enough buffer space available for WIC operation.")
  3869         CHK_ERR(WINCODEC_ERR_DUPLICATEMETADATAPRESENT, 
"Duplicate metadata detected in WIC image.")
  3870         CHK_ERR(WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE, 
"Unexpected property type in WIC image.")
  3871         CHK_ERR(WINCODEC_ERR_UNEXPECTEDSIZE, 
"Unexpected value size in WIC metadata.")
  3872         CHK_ERR(WINCODEC_ERR_INVALIDQUERYREQUEST, 
"Invalid metadata query.")
  3873         CHK_ERR(WINCODEC_ERR_UNEXPECTEDMETADATATYPE, 
"Unexpected metadata type encountered in WIC image.")
  3874         CHK_ERR(WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT, 
"Operation only valid on meatadata root.")
  3875         CHK_ERR(WINCODEC_ERR_INVALIDQUERYCHARACTER, 
"Invalid character in WIC metadata query.")
  3876         CHK_ERR(WINCODEC_ERR_WIN32ERROR, 
"General Win32 error encountered during WIC operation.")
  3877         CHK_ERR(WINCODEC_ERR_INVALIDPROGRESSIVELEVEL, 
"Invalid level for progressive WIC image decode.")
  3879 #endif // !WINAPI_FAMILY || WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP  3911 HRESULT WINAPI 
DXTraceW( _In_z_ 
const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr,
  3912                          _In_opt_ 
const WCHAR* strMsg, _In_ 
bool bPopMsgBox )
  3914     WCHAR strBufferLine[128];
  3915     WCHAR strBufferError[256];
  3918     swprintf_s( strBufferLine, 128, L
"%lu", dwLine );
  3921        swprintf_s( strBuffer, 
BUFFER_SIZE, L
"%ls(%ls): ", strFile, strBufferLine );
  3922        OutputDebugStringW( strBuffer );
  3925     size_t nMsgLen = (strMsg) ? wcsnlen_s( strMsg, 1024 ) : 0;
  3928         OutputDebugStringW( strMsg );
  3929         OutputDebugStringW( L
" " );
  3933     swprintf_s( strBuffer, 
BUFFER_SIZE, L
"hr=%ls", strBufferError );
  3934     OutputDebugStringW( strBuffer );
  3936     OutputDebugStringW( L
"\n" );
  3938 #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)  3941         WCHAR strBufferFile[MAX_PATH];
  3942         wcscpy_s( strBufferFile, MAX_PATH, L
"" );
  3944             wcscpy_s( strBufferFile, MAX_PATH, strFile );
  3946         WCHAR strBufferMsg[1024];
  3947         wcscpy_s( strBufferMsg, 1024, L
"" );
  3949             swprintf_s( strBufferMsg, 1024, L
"Calling: %ls\n", strMsg );
  3951         swprintf_s( strBuffer, 
BUFFER_SIZE, L
"File: %ls\nLine: %ls\nError Code: %ls\n%lsDo you want to debug the application?",
  3952                     strBufferFile, strBufferLine, strBufferError, strBufferMsg );
  3954         int nResult = MessageBoxW( GetForegroundWindow(), strBuffer, L
"Unexpected error encountered", MB_YESNO | MB_ICONERROR );
  3955         if( nResult == IDYES )
  3959     UNREFERENCED_PARAMETER(bPopMsgBox);
 HRESULT WINAPI DXTraceW(_In_z_ const WCHAR *strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR *strMsg, _In_ bool bPopMsgBox)
 
#define XAUDIO2_E_XAPO_CREATION_FAILED
 
#define DXUTERR_NOCOMPATIBLEDEVICES
 
#define XAUDIO2_E_INVALID_CALL
 
void WINAPI DXGetErrorDescriptionW(_In_ HRESULT hr, _Out_cap_(count) WCHAR *desc, _In_ size_t count)
 
#define DXUTERR_CREATINGDEVICEOBJECTS
 
#define CHK_ERR(hrchk, strOut)
 
#define DXUTERR_RESETTINGDEVICE
 
#define CHK_ERR_WIN32_ONLY(hrchk, strOut)
 
#define CHK_ERR_WIN32A(hrchk)
 
#define DXUTERR_DEVICEREMOVED
 
#define DXUTERR_NODIRECT3D
 
#define DXUTERR_NONZEROREFCOUNT
 
#define DXUTERR_RESETTINGDEVICEOBJECTS
 
#define XAUDIO2_E_XMA_DECODER_ERROR
 
#define XAUDIO2_E_DEVICE_INVALIDATED
 
#define DXUTERR_INCORRECTVERSION
 
#define DXUTERR_CREATINGDEVICE
 
#define XAPO_E_FORMAT_UNSUPPORTED
 
const WCHAR *WINAPI DXGetErrorStringW(_In_ HRESULT hr)
 
#define DXUTERR_MEDIANOTFOUND