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
61c5d2a0
Commit
61c5d2a0
authored
Aug 28, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr: Use CRT allocation functions.
parent
d8966584
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
mpr_main.c
dlls/mpr/mpr_main.c
+4
-9
pwcache.c
dlls/mpr/pwcache.c
+6
-6
wnet.c
dlls/mpr/wnet.c
+0
-0
No files found.
dlls/mpr/mpr_main.c
View file @
61c5d2a0
...
@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpr);
...
@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpr);
*/
*/
LPVOID
WINAPI
MPR_Alloc
(
DWORD
dwSize
)
LPVOID
WINAPI
MPR_Alloc
(
DWORD
dwSize
)
{
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
dwSize
);
return
calloc
(
1
,
dwSize
);
}
}
/*****************************************************************
/*****************************************************************
...
@@ -46,10 +46,7 @@ LPVOID WINAPI MPR_Alloc( DWORD dwSize )
...
@@ -46,10 +46,7 @@ LPVOID WINAPI MPR_Alloc( DWORD dwSize )
*/
*/
LPVOID
WINAPI
MPR_ReAlloc
(
LPVOID
lpSrc
,
DWORD
dwSize
)
LPVOID
WINAPI
MPR_ReAlloc
(
LPVOID
lpSrc
,
DWORD
dwSize
)
{
{
if
(
lpSrc
)
return
_recalloc
(
lpSrc
,
1
,
dwSize
);
return
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpSrc
,
dwSize
);
else
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
dwSize
);
}
}
/*****************************************************************
/*****************************************************************
...
@@ -57,10 +54,8 @@ LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
...
@@ -57,10 +54,8 @@ LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
*/
*/
BOOL
WINAPI
MPR_Free
(
LPVOID
lpMem
)
BOOL
WINAPI
MPR_Free
(
LPVOID
lpMem
)
{
{
if
(
lpMem
)
free
(
lpMem
);
return
HeapFree
(
GetProcessHeap
(),
0
,
lpMem
);
return
!!
lpMem
;
else
return
FALSE
;
}
}
/*****************************************************************
/*****************************************************************
...
...
dlls/mpr/pwcache.c
View file @
61c5d2a0
...
@@ -55,7 +55,7 @@ static LPSTR MPR_GetValueName( LPCSTR pbResource, WORD cbResource, BYTE nType )
...
@@ -55,7 +55,7 @@ static LPSTR MPR_GetValueName( LPCSTR pbResource, WORD cbResource, BYTE nType )
LPSTR
name
;
LPSTR
name
;
DWORD
i
;
DWORD
i
;
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
6
+
cbResource
*
2
);
name
=
malloc
(
6
+
cbResource
*
2
);
if
(
!
name
)
return
NULL
;
if
(
!
name
)
return
NULL
;
sprintf
(
name
,
"X-%02X-"
,
nType
);
sprintf
(
name
,
"X-%02X-"
,
nType
);
...
@@ -114,7 +114,7 @@ DWORD WINAPI WNetCachePassword(
...
@@ -114,7 +114,7 @@ DWORD WINAPI WNetCachePassword(
r
=
WN_CANCEL
;
r
=
WN_CANCEL
;
else
else
r
=
WN_SUCCESS
;
r
=
WN_SUCCESS
;
HeapFree
(
GetProcessHeap
(),
0
,
valname
);
free
(
valname
);
}
}
else
else
r
=
WN_OUT_OF_MEMORY
;
r
=
WN_OUT_OF_MEMORY
;
...
@@ -152,7 +152,7 @@ UINT WINAPI WNetRemoveCachedPassword(
...
@@ -152,7 +152,7 @@ UINT WINAPI WNetRemoveCachedPassword(
r
=
WN_ACCESS_DENIED
;
r
=
WN_ACCESS_DENIED
;
else
else
r
=
WN_SUCCESS
;
r
=
WN_SUCCESS
;
HeapFree
(
GetProcessHeap
(),
0
,
valname
);
free
(
valname
);
}
}
else
else
r
=
WN_OUT_OF_MEMORY
;
r
=
WN_OUT_OF_MEMORY
;
...
@@ -209,7 +209,7 @@ DWORD WINAPI WNetGetCachedPassword(
...
@@ -209,7 +209,7 @@ DWORD WINAPI WNetGetCachedPassword(
r
=
WN_CANCEL
;
r
=
WN_CANCEL
;
else
else
r
=
WN_SUCCESS
;
r
=
WN_SUCCESS
;
HeapFree
(
GetProcessHeap
(),
0
,
valname
);
free
(
valname
);
}
}
else
else
r
=
WN_OUT_OF_MEMORY
;
r
=
WN_OUT_OF_MEMORY
;
...
@@ -299,7 +299,7 @@ UINT WINAPI WNetEnumCachedPasswords(
...
@@ -299,7 +299,7 @@ UINT WINAPI WNetEnumCachedPasswords(
/* read the value data */
/* read the value data */
size
=
offsetof
(
PASSWORD_CACHE_ENTRY
,
abResource
[
val_sz
+
data_sz
]
);
size
=
offsetof
(
PASSWORD_CACHE_ENTRY
,
abResource
[
val_sz
+
data_sz
]
);
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
entry
=
malloc
(
size
);
memcpy
(
entry
->
abResource
,
val
,
val_sz
);
memcpy
(
entry
->
abResource
,
val
,
val_sz
);
entry
->
cbEntry
=
size
;
entry
->
cbEntry
=
size
;
entry
->
cbResource
=
val_sz
;
entry
->
cbResource
=
val_sz
;
...
@@ -311,7 +311,7 @@ UINT WINAPI WNetEnumCachedPasswords(
...
@@ -311,7 +311,7 @@ UINT WINAPI WNetEnumCachedPasswords(
&
entry
->
abResource
[
val_sz
],
&
data_sz
);
&
entry
->
abResource
[
val_sz
],
&
data_sz
);
if
(
r
==
ERROR_SUCCESS
)
if
(
r
==
ERROR_SUCCESS
)
enumPasswordProc
(
entry
,
param
);
enumPasswordProc
(
entry
,
param
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
free
(
entry
);
}
}
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
...
dlls/mpr/wnet.c
View file @
61c5d2a0
This diff is collapsed.
Click to expand it.
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