ReactOS 0.4.17-dev-966-gf06eace
errors.h File Reference
#include <vfwmsgs.h>
Include dependency graph for errors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AMOVIEAPI
 
#define VFW_FIRST_CODE   0x200
 
#define MAX_ERROR_TEXT_LEN   160
 
#define AMGetErrorText   WINELIB_NAME_AW(AMGetErrorText)
 

Typedefs

typedef BOOL(WINAPI * AMGETERRORTEXTPROCA) (HRESULT, char *, DWORD)
 
typedef BOOL(WINAPI * AMGETERRORTEXTPROCW) (HRESULT, WCHAR *, DWORD)
 

Functions

DWORD WINAPI AMGetErrorTextA (HRESULT, LPSTR, DWORD)
 
DWORD WINAPI AMGetErrorTextW (HRESULT, LPWSTR, DWORD)
 

Macro Definition Documentation

◆ AMGetErrorText

#define AMGetErrorText   WINELIB_NAME_AW(AMGetErrorText)

Definition at line 39 of file errors.h.

◆ AMOVIEAPI

#define AMOVIEAPI

Definition at line 26 of file errors.h.

◆ MAX_ERROR_TEXT_LEN

#define MAX_ERROR_TEXT_LEN   160

Definition at line 29 of file errors.h.

◆ VFW_FIRST_CODE

#define VFW_FIRST_CODE   0x200

Definition at line 28 of file errors.h.

Typedef Documentation

◆ AMGETERRORTEXTPROCA

typedef BOOL(WINAPI * AMGETERRORTEXTPROCA) (HRESULT, char *, DWORD)

Definition at line 33 of file errors.h.

◆ AMGETERRORTEXTPROCW

typedef BOOL(WINAPI * AMGETERRORTEXTPROCW) (HRESULT, WCHAR *, DWORD)

Definition at line 34 of file errors.h.

Function Documentation

◆ AMGetErrorTextA()

DWORD WINAPI AMGetErrorTextA ( HRESULT  hr,
LPSTR  buffer,
DWORD  maxlen 
)

Definition at line 699 of file main.c.

700{
701 DWORD res;
703
704 TRACE("hr %#lx, buffer %p, maxlen %lu.\n", hr, buffer, maxlen);
705
706 if (!buffer)
707 return 0;
708
710 if (!res)
711 return 0;
712
713 res = WideCharToMultiByte(CP_ACP, 0, errorW, -1, NULL, 0, 0, 0);
714 if (res > maxlen || !res)
715 return 0;
716 return WideCharToMultiByte(CP_ACP, 0, errorW, -1, buffer, maxlen, 0, 0) - 1;
717}
#define ARRAY_SIZE(A)
Definition: main.h:20
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen)
Definition: main.c:722
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MAX_ERROR_TEXT_LEN
Definition: errors.h:29
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
static const WCHAR errorW[]
Definition: htmlevent.c:61
short WCHAR
Definition: pedump.c:58
#define TRACE(s)
Definition: solgame.cpp:4

◆ AMGetErrorTextW()

DWORD WINAPI AMGetErrorTextW ( HRESULT  hr,
LPWSTR  buffer,
DWORD  maxlen 
)

Definition at line 722 of file main.c.

723{
724 unsigned int len;
726
727 TRACE("hr %#lx, buffer %p, maxlen %lu.\n", hr, buffer, maxlen);
728
729 if (!buffer) return 0;
730 swprintf(error, ARRAY_SIZE(error), L"Error: 0x%lx", hr);
731 if ((len = wcslen(error)) >= maxlen)
732 return 0;
734 return len;
735}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define swprintf
Definition: precomp.h:40
#define L(x)
Definition: resources.c:13
GLenum GLsizei len
Definition: glext.h:6722
#define error(str)
Definition: mkdosfs.c:1605
wcscpy

Referenced by AMGetErrorTextA().