2 * Direct3D shader compiler main file
4 * Copyright 2010 Matteo Bruni for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
30 #include "d3dcompiler_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler
);
34 BOOL WINAPI
DllMain(HINSTANCE inst
, DWORD reason
, LPVOID reserved
)
38 case DLL_WINE_PREATTACH
:
39 return FALSE
; /* prefer native version */
40 case DLL_PROCESS_ATTACH
:
41 DisableThreadLibraryCalls(inst
);
43 case DLL_PROCESS_DETACH
:
49 HRESULT WINAPI
D3DCreateBlob(SIZE_T data_size
, ID3DBlob
**blob
)
51 struct d3dcompiler_blob
*object
;
54 TRACE("data_size %lu, blob %p\n", data_size
, blob
);
58 WARN("Invalid blob specified.\n");
59 return D3DERR_INVALIDCALL
;
62 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
65 ERR("Failed to allocate D3D blob object memory\n");
69 hr
= d3dcompiler_blob_init(object
, data_size
);
72 WARN("Failed to initialize blob, hr %#x.\n", hr
);
73 HeapFree(GetProcessHeap(), 0, object
);
77 *blob
= (ID3DBlob
*)object
;
79 TRACE("Created ID3DBlob %p\n", object
);