xref: /reactos/dll/directx/d3d9/d3d9_helpers.h (revision 40462c92)
1 /*
2  * COPYRIGHT:       See COPYING in the top level directory
3  * PROJECT:         ReactOS ReactX
4  * FILE:            dll/directx/d3d9/d3d9_helpers.h
5  * PURPOSE:         d3d9.dll helper functions
6  * PROGRAMERS:      Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se>
7  */
8 #ifndef _D3D9_HELPERS_H_
9 #define _D3D9_HELPERS_H_
10 
11 #include "d3d9_common.h"
12 #include "d3d9_private.h"
13 
14 
15 /* Reads a registry value if it's of the correct value type */
16 BOOL ReadRegistryValue(IN DWORD ValueType, IN LPCSTR ValueName, OUT LPBYTE DataBuffer, IN OUT LPDWORD DataBufferSize);
17 
18 /* Safe string formatting */
19 HRESULT SafeFormatString(IN OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString, ... );
20 HRESULT SafeCopyString(OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src);
21 HRESULT SafeAppendString(IN OUT LPSTR Dst, IN DWORD DstSize, IN LPCSTR Src);
22 
23 /* Allocates memory and returns an aligned pointer */
24 HRESULT AlignedAlloc(IN OUT LPVOID *ppObject, IN SIZE_T dwSize);
25 
26 /* Frees memory allocated with AlignedAlloc */
27 VOID AlignedFree(IN OUT LPVOID pObject);
28 
29 
30 #endif // _D3D9_HELPERS_H_
31