Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c9e7db92
Commit
c9e7db92
authored
Jun 01, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx11: Use CRT memory allocators.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
parent
9bc80fbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
async.c
dlls/d3dx11_43/async.c
+18
-18
No files found.
dlls/d3dx11_43/async.c
View file @
c9e7db92
...
...
@@ -72,7 +72,7 @@ static HRESULT WINAPI memorydataloader_Destroy(ID3DX11DataLoader *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
loader
);
free
(
loader
);
return
S_OK
;
}
...
...
@@ -100,7 +100,7 @@ static HRESULT WINAPI filedataloader_Load(ID3DX11DataLoader *iface)
return
D3D11_ERROR_FILE_NOT_FOUND
;
size
=
GetFileSize
(
file
,
NULL
);
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
data
=
malloc
(
size
);
if
(
!
data
)
{
CloseHandle
(
file
);
...
...
@@ -112,11 +112,11 @@ static HRESULT WINAPI filedataloader_Load(ID3DX11DataLoader *iface)
if
(
!
ret
)
{
ERR
(
"Failed to read file contents.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
free
(
data
);
return
E_FAIL
;
}
HeapFree
(
GetProcessHeap
(),
0
,
loader
->
data
);
free
(
loader
->
data
);
loader
->
data
=
data
;
loader
->
size
=
size
;
...
...
@@ -144,9 +144,9 @@ static HRESULT WINAPI filedataloader_Destroy(ID3DX11DataLoader *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
loader
->
u
.
file
.
path
);
HeapFree
(
GetProcessHeap
(),
0
,
loader
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
loader
);
free
(
loader
->
u
.
file
.
path
);
free
(
loader
->
data
);
free
(
loader
);
return
S_OK
;
}
...
...
@@ -202,7 +202,7 @@ static HRESULT WINAPI resourcedataloader_Destroy(ID3DX11DataLoader *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
loader
);
free
(
loader
);
return
S_OK
;
}
...
...
@@ -282,7 +282,7 @@ HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(const void *data, SIZE_T data_size,
if
(
!
data
||
!
loader
)
return
E_FAIL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
...
...
@@ -307,12 +307,12 @@ HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(const char *filename, ID3DX11DataLoa
return
E_FAIL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
filename_w
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
*
filename_w
));
filename_w
=
malloc
(
len
*
sizeof
(
*
filename_w
));
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
filename_w
,
len
);
hr
=
D3DX11CreateAsyncFileLoaderW
(
filename_w
,
loader
);
HeapFree
(
GetProcessHeap
(),
0
,
filename_w
);
free
(
filename_w
);
return
hr
;
}
...
...
@@ -326,15 +326,15 @@ HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(const WCHAR *filename, ID3DX11DataLo
if
(
!
filename
||
!
loader
)
return
E_FAIL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
ID3DX11DataLoader_iface
.
lpVtbl
=
&
filedataloadervtbl
;
object
->
u
.
file
.
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
filename
)
+
1
)
*
sizeof
(
WCHAR
));
object
->
u
.
file
.
path
=
malloc
(
(
lstrlenW
(
filename
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
object
->
u
.
file
.
path
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
free
(
object
);
return
E_OUTOFMEMORY
;
}
lstrcpyW
(
object
->
u
.
file
.
path
,
filename
);
...
...
@@ -356,14 +356,14 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE module, const char *reso
if
(
!
loader
)
return
E_FAIL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
!
(
rsrc
=
FindResourceA
(
module
,
resource
,
(
const
char
*
)
RT_RCDATA
)))
{
WARN
(
"Failed to find resource.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
free
(
object
);
return
D3DX11_ERR_INVALID_DATA
;
}
...
...
@@ -388,14 +388,14 @@ HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *res
if
(
!
loader
)
return
E_FAIL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
calloc
(
1
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
!
(
rsrc
=
FindResourceW
(
module
,
resource
,
(
const
WCHAR
*
)
RT_RCDATA
)))
{
WARN
(
"Failed to find resource.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
free
(
object
);
return
D3DX11_ERR_INVALID_DATA
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment