Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
c9e7db92
Commit
c9e7db92
authored
2 years ago
by
Piotr Caban
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3dx11: Use CRT memory allocators.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
parent
9bc80fbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3dx11_43/async.c
+18
-18
18 additions, 18 deletions
dlls/d3dx11_43/async.c
with
18 additions
and
18 deletions
dlls/d3dx11_43/async.c
+
18
−
18
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment