Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
dbf222f3
Commit
dbf222f3
authored
Mar 17, 2005
by
Jon Griffiths
Committed by
Alexandre Julliard
Mar 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc).
parent
e3fe6892
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
25 additions
and
25 deletions
+25
-25
format_msg.c
dlls/kernel/format_msg.c
+2
-2
heap.c
dlls/kernel/tests/heap.c
+4
-4
imalloc.c
dlls/mapi32/imalloc.c
+3
-3
ifs.c
dlls/ole32/ifs.c
+2
-2
cpanelfolder.c
dlls/shell32/cpanelfolder.c
+1
-1
dragdrophelper.c
dlls/shell32/dragdrophelper.c
+1
-1
shelllink.c
dlls/shell32/shelllink.c
+1
-1
shellole.c
dlls/shell32/shellole.c
+3
-3
shellord.c
dlls/shell32/shellord.c
+1
-1
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+1
-1
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+1
-1
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+1
-1
reg.c
dlls/shlwapi/reg.c
+4
-4
No files found.
dlls/kernel/format_msg.c
View file @
dbf222f3
...
...
@@ -324,7 +324,7 @@ DWORD WINAPI FormatMessageA(
}
TRACE
(
"-- %s
\n
"
,
debugstr_a
(
target
));
if
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
{
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
G
MEM_ZEROINIT
,
max
(
nSize
,
talloced
));
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
L
MEM_ZEROINIT
,
max
(
nSize
,
talloced
));
memcpy
(
*
(
LPSTR
*
)
lpBuffer
,
target
,
talloced
);
}
else
{
lstrcpynA
(
lpBuffer
,
target
,
nSize
);
...
...
@@ -537,7 +537,7 @@ DWORD WINAPI FormatMessageW(
if
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
{
/* nSize is the MINIMUM size */
DWORD
len
=
strlenW
(
target
)
+
1
;
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
G
MEM_ZEROINIT
,
len
*
sizeof
(
WCHAR
));
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
L
MEM_ZEROINIT
,
len
*
sizeof
(
WCHAR
));
strcpyW
(
*
(
LPWSTR
*
)
lpBuffer
,
target
);
}
else
lstrcpynW
(
lpBuffer
,
target
,
nSize
);
...
...
dlls/kernel/tests/heap.c
View file @
dbf222f3
...
...
@@ -63,17 +63,17 @@ START_TEST(heap)
ok
(
gbl
==
NULL
,
"global realloc allocated memory
\n
"
);
/* Local*() functions */
gbl
=
LocalAlloc
(
G
MEM_MOVEABLE
,
0
);
gbl
=
LocalAlloc
(
L
MEM_MOVEABLE
,
0
);
ok
(
gbl
!=
NULL
,
"local memory not allocated for size 0
\n
"
);
gbl
=
LocalReAlloc
(
gbl
,
10
,
G
MEM_MOVEABLE
);
gbl
=
LocalReAlloc
(
gbl
,
10
,
L
MEM_MOVEABLE
);
ok
(
gbl
!=
NULL
,
"Can't realloc local memory
\n
"
);
size
=
LocalSize
(
gbl
);
ok
(
size
>=
10
&&
size
<=
16
,
"Memory not resized to size 10, instead size=%ld
\n
"
,
size
);
todo_wine
{
gbl
=
LocalReAlloc
(
gbl
,
0
,
G
MEM_MOVEABLE
);
gbl
=
LocalReAlloc
(
gbl
,
0
,
L
MEM_MOVEABLE
);
ok
(
gbl
!=
NULL
,
"LocalReAlloc should not fail on size 0
\n
"
);
}
...
...
@@ -83,7 +83,7 @@ START_TEST(heap)
size
=
LocalSize
(
gbl
);
ok
(
size
==
0
,
"Memory should have been freed, size=%ld
\n
"
,
size
);
gbl
=
LocalReAlloc
(
0
,
10
,
G
MEM_MOVEABLE
);
gbl
=
LocalReAlloc
(
0
,
10
,
L
MEM_MOVEABLE
);
ok
(
gbl
==
NULL
,
"local realloc allocated memory
\n
"
);
}
dlls/mapi32/imalloc.c
View file @
dbf222f3
...
...
@@ -112,7 +112,7 @@ static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
{
TRACE
(
"(%p)->(%ld)
\n
"
,
iface
,
cb
);
return
LocalAlloc
(
G
MEM_FIXED
,
cb
);
return
LocalAlloc
(
L
MEM_FIXED
,
cb
);
}
/**************************************************************************
...
...
@@ -123,10 +123,10 @@ static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb)
TRACE
(
"(%p)->(%p, %ld)
\n
"
,
iface
,
pv
,
cb
);
if
(
!
pv
)
return
LocalAlloc
(
G
MEM_FIXED
,
cb
);
return
LocalAlloc
(
L
MEM_FIXED
,
cb
);
if
(
cb
)
return
LocalReAlloc
((
HANDLE
)
pv
,
cb
,
G
MEM_MOVEABLE
);
return
LocalReAlloc
((
HANDLE
)
pv
,
cb
,
L
MEM_MOVEABLE
);
LocalFree
((
HANDLE
)
pv
);
return
NULL
;
...
...
dlls/ole32/ifs.c
View file @
dbf222f3
...
...
@@ -77,8 +77,8 @@ static int SetSpyedBlockTableLength ( int NewLength )
{
LPVOID
*
NewSpyedBlocks
;
if
(
!
Malloc32
.
SpyedBlocks
)
NewSpyedBlocks
=
LocalAlloc
(
G
MEM_ZEROINIT
,
NewLength
*
sizeof
(
PVOID
));
else
NewSpyedBlocks
=
LocalReAlloc
(
Malloc32
.
SpyedBlocks
,
NewLength
*
sizeof
(
PVOID
),
G
MEM_ZEROINIT
);
if
(
!
Malloc32
.
SpyedBlocks
)
NewSpyedBlocks
=
LocalAlloc
(
L
MEM_ZEROINIT
,
NewLength
*
sizeof
(
PVOID
));
else
NewSpyedBlocks
=
LocalReAlloc
(
Malloc32
.
SpyedBlocks
,
NewLength
*
sizeof
(
PVOID
),
L
MEM_ZEROINIT
);
if
(
NewSpyedBlocks
)
{
Malloc32
.
SpyedBlocks
=
NewSpyedBlocks
;
Malloc32
.
SpyedBlockTableLength
=
NewLength
;
...
...
dlls/shell32/cpanelfolder.c
View file @
dbf222f3
...
...
@@ -124,7 +124,7 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOI
if
(
pUnkOuter
&&
!
IsEqualIID
(
riid
,
&
IID_IUnknown
))
return
CLASS_E_NOAGGREGATION
;
sf
=
(
ICPanelImpl
*
)
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
ICPanelImpl
));
sf
=
(
ICPanelImpl
*
)
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
ICPanelImpl
));
if
(
!
sf
)
return
E_OUTOFMEMORY
;
...
...
dlls/shell32/dragdrophelper.c
View file @
dbf222f3
...
...
@@ -71,7 +71,7 @@ HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid,
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
dth
=
(
IDropTargetHelperImpl
*
)
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
IDropTargetHelperImpl
));
dth
=
(
IDropTargetHelperImpl
*
)
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
IDropTargetHelperImpl
));
if
(
!
dth
)
return
E_OUTOFMEMORY
;
dth
->
ref
=
0
;
...
...
dlls/shell32/shelllink.c
View file @
dbf222f3
...
...
@@ -1093,7 +1093,7 @@ HRESULT WINAPI IShellLink_Constructor (
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
sl
=
(
IShellLinkImpl
*
)
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
IShellLinkImpl
));
sl
=
(
IShellLinkImpl
*
)
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
IShellLinkImpl
));
if
(
!
sl
)
return
E_OUTOFMEMORY
;
sl
->
ref
=
1
;
...
...
dlls/shell32/shellole.c
View file @
dbf222f3
...
...
@@ -318,7 +318,7 @@ static LPVOID WINAPI IShellMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
{
LPVOID
addr
;
addr
=
(
LPVOID
)
LocalAlloc
(
G
MEM_ZEROINIT
,
cb
);
addr
=
(
LPVOID
)
LocalAlloc
(
L
MEM_ZEROINIT
,
cb
);
TRACE
(
"(%p,%ld);
\n
"
,
addr
,
cb
);
return
addr
;
}
...
...
@@ -332,14 +332,14 @@ static LPVOID WINAPI IShellMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb)
if
(
pv
)
{
if
(
cb
)
{
addr
=
(
LPVOID
)
LocalReAlloc
((
HANDLE
)
pv
,
cb
,
GMEM_ZEROINIT
|
G
MEM_MOVEABLE
);
addr
=
(
LPVOID
)
LocalReAlloc
((
HANDLE
)
pv
,
cb
,
LMEM_ZEROINIT
|
L
MEM_MOVEABLE
);
}
else
{
LocalFree
((
HANDLE
)
pv
);
addr
=
NULL
;
}
}
else
{
if
(
cb
)
{
addr
=
(
LPVOID
)
LocalAlloc
(
G
MEM_ZEROINIT
,
cb
);
addr
=
(
LPVOID
)
LocalAlloc
(
L
MEM_ZEROINIT
,
cb
);
}
else
{
addr
=
NULL
;
}
...
...
dlls/shell32/shellord.c
View file @
dbf222f3
...
...
@@ -1506,7 +1506,7 @@ HRESULT WINAPI SHELL32_256(LPDWORD lpdw0, LPDWORD lpdw1)
ret
=
E_INVALIDARG
;
else
{
LPVOID
lpdata
=
0
;
/*LocalAlloc(
G
MEM_ZEROINIT, 0x4E4);*/
LPVOID
lpdata
=
0
;
/*LocalAlloc(
L
MEM_ZEROINIT, 0x4E4);*/
if
(
!
lpdata
)
ret
=
E_OUTOFMEMORY
;
...
...
dlls/shell32/shfldr_desktop.c
View file @
dbf222f3
...
...
@@ -837,7 +837,7 @@ HRESULT WINAPI ISF_Desktop_Constructor (
if
(
!
SHGetSpecialFolderPathW
(
0
,
szMyPath
,
CSIDL_DESKTOPDIRECTORY
,
TRUE
))
return
E_UNEXPECTED
;
sf
=
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
)
);
sf
=
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
)
);
if
(
!
sf
)
return
E_OUTOFMEMORY
;
...
...
dlls/shell32/shfldr_fs.c
View file @
dbf222f3
...
...
@@ -233,7 +233,7 @@ IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
if
(
pUnkOuter
&&
!
IsEqualIID
(
riid
,
&
IID_IUnknown
))
return
CLASS_E_NOAGGREGATION
;
sf
=
(
IGenericSFImpl
*
)
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
));
sf
=
(
IGenericSFImpl
*
)
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
));
if
(
!
sf
)
return
E_OUTOFMEMORY
;
...
...
dlls/shell32/shfldr_mycomp.c
View file @
dbf222f3
...
...
@@ -108,7 +108,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LP
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
sf
=
LocalAlloc
(
G
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
));
sf
=
LocalAlloc
(
L
MEM_ZEROINIT
,
sizeof
(
IGenericSFImpl
));
if
(
!
sf
)
return
E_OUTOFMEMORY
;
...
...
dlls/shlwapi/reg.c
View file @
dbf222f3
...
...
@@ -1340,7 +1340,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue,
char
cNull
=
'\0'
;
nBytesToAlloc
=
(
!
pvData
||
(
dwRet
==
ERROR_MORE_DATA
))
?
dwUnExpDataLen
:
*
pcbData
;
szData
=
(
LPSTR
)
LocalAlloc
(
G
MEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
(
LPSTR
)
LocalAlloc
(
L
MEM_ZEROINIT
,
nBytesToAlloc
);
RegQueryValueExA
(
hKey
,
lpszValue
,
lpReserved
,
NULL
,
(
LPBYTE
)
szData
,
&
nBytesToAlloc
);
dwExpDataLen
=
ExpandEnvironmentStringsA
(
szData
,
&
cNull
,
1
);
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
...
...
@@ -1349,7 +1349,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue,
else
{
nBytesToAlloc
=
(
lstrlenA
(
pvData
)
+
1
)
*
sizeof
(
CHAR
);
szData
=
(
LPSTR
)
LocalAlloc
(
G
MEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
(
LPSTR
)
LocalAlloc
(
L
MEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyA
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsA
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
CHAR
));
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_DATA
;
...
...
@@ -1401,7 +1401,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
WCHAR
cNull
=
'\0'
;
nBytesToAlloc
=
(
!
pvData
||
(
dwRet
==
ERROR_MORE_DATA
))
?
dwUnExpDataLen
:
*
pcbData
;
szData
=
(
LPWSTR
)
LocalAlloc
(
G
MEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
(
LPWSTR
)
LocalAlloc
(
L
MEM_ZEROINIT
,
nBytesToAlloc
);
RegQueryValueExW
(
hKey
,
lpszValue
,
lpReserved
,
NULL
,
(
LPBYTE
)
szData
,
&
nBytesToAlloc
);
dwExpDataLen
=
ExpandEnvironmentStringsW
(
szData
,
&
cNull
,
1
);
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
...
...
@@ -1410,7 +1410,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
else
{
nBytesToAlloc
=
(
lstrlenW
(
pvData
)
+
1
)
*
sizeof
(
WCHAR
);
szData
=
(
LPWSTR
)
LocalAlloc
(
G
MEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
(
LPWSTR
)
LocalAlloc
(
L
MEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyW
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsW
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
WCHAR
)
);
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_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