dxerr.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 633 行 · 第 1/5 页

C
633
字号
/*

	dxerr.c - DirectX 8 & 9 Error Functions

	Written by Filip Navara <xnavara@volny.cz>

	This library is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

	NOTE: Do not use this file directly!

*/

#include <windows.h>

#ifndef DXERROR
#define DXERROR(v,n,d) {v, TEXT(n), TEXT(d)},
#define DXERRORLAST(v,n,d) {v, TEXT(n), TEXT(d)}
#endif
#ifndef DXERROR8
#define DXERROR8(v,n,d)
#define DXERROR8LAST(v,n,d)
#endif
#ifndef DXERROR9
#define DXERROR9(v,n,d)
#define DXERROR9LAST(v,n,d)
#endif

typedef struct {
	unsigned long Value;
	TCHAR *Name;
	TCHAR *Description;
} Error;

static Error Errors[] = {
	DXERROR(0, "S_OK", "The function completed successfully")
	DXERROR(0x1, "S_FALSE", "Call successful, but returned FALSE")
	DXERROR(0x2, "DXERROR_FILE_NOT_FOUND", "The system cannot find the file specified.")
	DXERROR(0x3, "DXERROR_PATH_NOT_FOUND", "The system cannot find the path specified.")
	DXERROR(0x4, "DXERROR_TOO_MANY_OPEN_FILES", "The system cannot open the file.")
	DXERROR(0x5, "DXERROR_ACCESS_DENIED", "Access is denied.")
	DXERROR(0x6, "DXERROR_INVALID_HANDLE", "The handle is invalid.")
	DXERROR(0x8, "DXERROR_NOT_ENOUGH_MEMORY", "Not enough storage is available to process this command.")
	DXERROR(0x9, "DXERROR_INVALID_BLOCK", "The storage control block address is invalid.")
	DXERROR(0xa, "DXERROR_BAD_ENVIRONMENT", "The environment is incorrect.")
	DXERROR(0xb, "DXERROR_BAD_FORMAT", "An attempt was made to load a program with an incorrect format.")
	DXERROR(0xe, "DXERROR_OUTOFMEMORY", "The system cannot find the drive specified.")
	DXERROR9(0x40003, "Unknown", "End of stream. Sample not updated.")
	DXERROR(0x40103, "VFW_S_NO_MORE_ITEMS", "The end of the list has been reached.")
	DXERROR(0x4022d, "VFW_S_DUPLICATE_NAME", "An attempt to add a filter with a duplicate name succeeded with a modified name.")
	DXERROR(0x40237, "VFW_S_STATE_INTERMEDIATE", "The state transition has not completed.")
	DXERROR(0x40242, "VFW_S_PARTIAL_RENDER", "Some of the streams in this movie are in an unsupported format.")
	DXERROR(0x40245, "VFW_S_SOME_DATA_IGNORED", "The file contained some property settings that were not used.")
	DXERROR(0x40246, "VFW_S_CONNECTIONS_DEFERRED", "Some connections have failed and have been deferred.")
	DXERROR(0x40250, "VFW_S_RESOURCE_NOT_NEEDED", "The resource specified is no longer needed.")
	DXERROR(0x40254, "VFW_S_MEDIA_TYPE_IGNORED", "A connection could not be made with the media type in the persistent graph, but has been made with a negotiated media type.")
	DXERROR(0x40257, "VFW_S_VIDEO_NOT_RENDERED", "Cannot play back the video stream: no suitable decompressor could be found.")
	DXERROR(0x40258, "VFW_S_AUDIO_NOT_RENDERED", "Cannot play back the audio stream: no audio hardware is available.")
	DXERROR(0x4025a, "VFW_S_RPZA", "Cannot play back the video stream: format 'RPZA' is not supported.")
	DXERROR(0x40260, "VFW_S_ESTIMATED", "The value returned had to be estimated.  It's accuracy can not be guaranteed.")
	DXERROR(0x40263, "VFW_S_RESERVED", "This success code is reserved for internal purposes within ActiveMovie.")
	DXERROR(0x40267, "VFW_S_STREAM_OFF", "The stream has been turned off.")
	DXERROR(0x40268, "VFW_S_CANT_CUE", "The graph can't be cued because of lack of or corrupt data.")
	DXERROR(0x40270, "VFW_S_NO_STOP_TIME", "The stop time for the sample was not set.")
	DXERROR(0x4027e, "VFW_S_NOPREVIEWPIN", "There was no preview pin available, so the capture pin output is being split to provide both capture and preview.")
	DXERROR(0x40280, "VFW_S_DVD_NON_ONE_SEQUENTIAL", "The current title was not a sequential set of chapters (PGC) and the returned timing information might not be continuous.")
	DXERROR(0x4028c, "VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE", "The audio stream did not contain sufficient information to determine the contents of each channel.")
	DXERROR(0x4028d, "VFW_S_DVD_NOT_ACCURATE", "The seek into the movie was not frame accurate.")
	DXERROR9(0x150005, "DV_FULLDUPLEX", "Full duplex")
	DXERROR9(0x15000a, "DV_HALFDUPLEX", "Half duplex")
	DXERROR9(0x150010, "DV_PENDING", "Pending")
	DXERROR9(0x876086f, "D3DOK_NOAUTOGEN", "The call succeeded but there won't be any mipmaps generated")
	DXERROR(0x878000a, "DS_NO_VIRTUALIZATION", "The call succeeded, but we had to substitute the 3D algorithm")
	DXERROR8(0x8780014, "DS_INCOMPLETE", "The call succeeded, but not all of the optional effects were obtained.")
	DXERROR(0x8781091, "DMUS_S_PARTIALLOAD", "The object could only load partially. This can happen if some components are not registered properly, such as embedded tracks and tools. This can also happen if some content is missing. For example, if a segment uses a DLS collection that is not in the loader's current search directory.")
	DXERROR(0x8781092, "DMUS_S_PARTIALDOWNLOAD", "Return value from IDirectMusicBand::Download() which indicates that some of the instruments safely downloaded, but others failed. This usually occurs when some instruments are on PChannels not supported by the performance or port.")
	DXERROR(0x8781200, "DMUS_S_REQUEUE", "Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should cue the PMsg again automatically.")
	DXERROR(0x8781201, "DMUS_S_FREE", "Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should free the PMsg automatically.")
	DXERROR(0x8781202, "DMUS_S_END", "Return value from IDirectMusicTrack::Play() which indicates to the segment that the track has no more data after mtEnd.")
	DXERROR(0x8781210, "DMUS_S_STRING_TRUNCATED", "Returned string has been truncated to fit the buffer size.")
	DXERROR(0x8781211, "DMUS_S_LAST_TOOL", "Returned from IDirectMusicGraph::StampPMsg() this indicates that the PMsg is already stamped with the last tool in the graph. The returned PMsg's tool pointer is now NULL.")
	DXERROR(0x8781212, "DMUS_S_OVER_CHORD", "Returned from IDirectMusicPerformance::MusicToMIDI() this indicates  that no note has been calculated because the music value has the note  at a position higher than the top note of the chord. This applies only to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates that the caller should not do anything with the note. It is not meant to be played against this chord.")
	DXERROR(0x8781213, "DMUS_S_UP_OCTAVE", "Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is below 0,  so it has been bumped up one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.")
	DXERROR(0x8781214, "DMUS_S_DOWN_OCTAVE", "Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is above 127, so it has been bumped down one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.")
	DXERROR(0x8781215, "DMUS_S_NOBUFFERCONTROL", "Although the audio output from the port will be routed to the same device as the given DirectSound buffer, buffer controls such as pan and volume will not affect the output.")
	DXERROR(0x8781216, "DMUS_S_GARBAGE_COLLECTED", "The requested operation was not performed because during CollectGarbage the loader determined that the object had been released.")
	DXERROR(0x8000000a, "E_PENDING", "The data necessary to complete this operation is not yet available.")
	DXERROR(0x80004001, "E_NOTIMPL", "The function called is not supported at this time")
	DXERROR(0x80004002, "E_NOINTERFACE", "The requested COM interface is not available")
	DXERROR(0x80004003, "E_POINTER", "Invalid pointer")
	DXERROR(0x80004004, "E_ABORT", "Operation aborted")
	DXERROR(0x80004005, "E_FAIL", "An undetermined error occurred")
	DXERROR(0x8000ffff, "E_UNEXPECTED", "Catastrophic failure")
	DXERROR8(0x80040110, "CLASS_E_NOAGGREGATION", "This object does not support aggregation")
	DXERROR9(0x80040110, "CLASSFACTORY_E_FIRST", "This object does not support aggregation")
	DXERROR(0x80040154, "REGDB_E_CLASSNOTREG", "Class not registered")
	DXERROR(0x800401f0, "CO_E_NOTINITIALIZED", "CoInitialize has not been called.")
	DXERROR(0x800401f1, "CO_E_ALREADYINITIALIZED", "CoInitialize has already been called.")
	DXERROR(0x80040200, "DIERR_INSUFFICIENTPRIVS & VFW_E_INVALIDMEDIATYPE", "Unable to IDirectInputJoyConfig_Acquire because the user does not have sufficient privileges to change the joystick configuration. & An invalid media type was specified")
	DXERROR8(0x80040201, "DIERR_DEVICEFULL & VFW_E_INVALIDSUBTYPE", "The device is full. & An invalid media subtype was specified.")
	DXERROR8(0x80040202, "DIERR_MOREDATA & VFW_E_NEED_OWNER", "Not all the requested information fit into the buffer. & This object can only be created as an aggregated object.")
	DXERROR8(0x80040203, "DIERR_NOTDOWNLOADED & VFW_E_ENUM_OUT_OF_SYNC", "The effect is not downloaded. & The enumerator has become invalid.")
	DXERROR8(0x80040204, "DIERR_HASEFFECTS & VFW_E_ALREADY_CONNECTED", "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.")
	DXERROR8(0x80040205, "DIERR_NOTEXCLUSIVEACQUIRED & VFW_E_FILTER_ACTIVE", "The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode. & This operation cannot be performed because the filter is active.")
	DXERROR8(0x80040206, "DIERR_INCOMPLETEEFFECT & VFW_E_NO_TYPES", "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.")
	DXERROR9(0x80040201, "DIERR_DEVICEFULL & VFW_E_INVALIDSUBTYPE & DMO_E_INVALIDSTREAMINDEX", "The device is full. & An invalid media subtype was specified.")
	DXERROR9(0x80040202, "DIERR_MOREDATA & VFW_E_NEED_OWNER & DMO_E_INVALIDTYPE", "Not all the requested information fit into the buffer. & This object can only be created as an aggregated object.")
	DXERROR9(0x80040203, "DIERR_NOTDOWNLOADED & VFW_E_ENUM_OUT_OF_SYNC & DMO_E_TYPE_NOT_SET", "The effect is not downloaded. & The enumerator has become invalid.")
	DXERROR9(0x80040204, "DIERR_HASEFFECTS & VFW_E_ALREADY_CONNECTED & DMO_E_NOTACCEPTING", "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.")
	DXERROR9(0x80040205, "DIERR_NOTEXCLUSIVEACQUIRED & VFW_E_FILTER_ACTIVE & DMO_E_TYPE_NOT_ACCEPTED", "The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode. & This operation cannot be performed because the filter is active.")
	DXERROR9(0x80040206, "DIERR_INCOMPLETEEFFECT & VFW_E_NO_TYPES & DMO_E_NO_MORE_ITEMS", "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.")
	DXERROR(0x80040207, "DIERR_NOTBUFFERED & VFW_E_NO_ACCEPTABLE_TYPES", "Attempted to read buffered device data from a device that is not buffered. & There is no common media type between these pins.")
	DXERROR(0x80040208, "DIERR_EFFECTPLAYING & VFW_E_INVALID_DIRECTION", "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.")
	DXERROR(0x80040209, "DIERR_UNPLUGGED & VFW_E_NOT_CONNECTED", "The operation could not be completed because the device is not plugged in. & The operation cannot be performed because the pins are not connected.")
	DXERROR(0x8004020a, "DIERR_REPORTFULL & VFW_E_NO_ALLOCATOR", "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.")
	DXERROR(0x8004020b, "DIERR_MAPFILEFAIL & VFW_E_RUNTIME_DXERROR", "A mapper file function failed because reading or writing the user or IHV settings file failed. & A run-time error occurred.")
	DXERROR(0x8004020c, "VFW_E_BUFFER_NOTSET", "No buffer space has been set")
	DXERROR(0x8004020d, "VFW_E_BUFFER_OVERFLOW", "The buffer is not big enough.")
	DXERROR(0x8004020e, "VFW_E_BADALIGN", "An invalid alignment was specified.")
	DXERROR(0x8004020f, "VFW_E_ALREADY_COMMITTED", "Cannot change allocated memory while the filter is active.")
	DXERROR(0x80040210, "VFW_E_BUFFERS_OUTSTANDING", "One or more buffers are still active.")
	DXERROR(0x80040211, "VFW_E_NOT_COMMITTED", "Cannot allocate a sample when the allocator is not active.")
	DXERROR(0x80040212, "VFW_E_SIZENOTSET", "Cannot allocate memory because no size has been set.")
	DXERROR(0x80040213, "VFW_E_NO_CLOCK", "Cannot lock for synchronization because no clock has been defined.")
	DXERROR(0x80040214, "VFW_E_NO_SINK", "Quality messages could not be sent because no quality sink has been defined.")
	DXERROR(0x80040215, "VFW_E_NO_INTERFACE", "A required interface has not been implemented.")

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?