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
1eda4ac4
Commit
1eda4ac4
authored
Jul 18, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Forward BSTR functions to oleaut32.
parent
674b9b9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
69 deletions
+6
-69
Makefile.in
dlls/ole32/Makefile.in
+1
-0
ole2.c
dlls/ole32/ole2.c
+5
-69
No files found.
dlls/ole32/Makefile.in
View file @
1eda4ac4
MODULE
=
ole32.dll
MODULE
=
ole32.dll
IMPORTLIB
=
ole32
IMPORTLIB
=
ole32
IMPORTS
=
uuid advapi32 user32 gdi32 rpcrt4
IMPORTS
=
uuid advapi32 user32 gdi32 rpcrt4
DELAYIMPORTS
=
oleaut32
EXTRADEFS
=
-D_OLE32_
-DCOM_NO_WINDOWS_H
\
EXTRADEFS
=
-D_OLE32_
-DCOM_NO_WINDOWS_H
\
-DENTRY_PREFIX
=
OLE32_
-DPROXY_CLSID
=
CLSID_PSFactoryBuffer
-DWINE_REGISTER_DLL
-DENTRY_PREFIX
=
OLE32_
-DPROXY_CLSID
=
CLSID_PSFactoryBuffer
-DWINE_REGISTER_DLL
...
...
dlls/ole32/ole2.c
View file @
1eda4ac4
...
@@ -2816,86 +2816,22 @@ static void OLE_FreeClipDataArray(ULONG count, CLIPDATA * pClipDataArray)
...
@@ -2816,86 +2816,22 @@ static void OLE_FreeClipDataArray(ULONG count, CLIPDATA * pClipDataArray)
/***********************************************************************
/***********************************************************************
* PropSysAllocString [OLE32.@]
* PropSysAllocString [OLE32.@]
* NOTES
:
* NOTES
*
Basically a copy of SysAllocStringLen
.
*
Forward to oleaut32
.
*/
*/
BSTR
WINAPI
PropSysAllocString
(
LPCOLESTR
str
)
BSTR
WINAPI
PropSysAllocString
(
LPCOLESTR
str
)
{
{
DWORD
bufferSize
;
return
SysAllocString
(
str
);
DWORD
*
newBuffer
;
WCHAR
*
stringBuffer
;
int
len
;
if
(
!
str
)
return
0
;
len
=
lstrlenW
(
str
);
/*
* Find the length of the buffer passed-in, in bytes.
*/
bufferSize
=
len
*
sizeof
(
WCHAR
);
/*
* Allocate a new buffer to hold the string.
* Don't forget to keep an empty spot at the beginning of the
* buffer for the character count and an extra character at the
* end for the NULL.
*/
newBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bufferSize
+
sizeof
(
WCHAR
)
+
sizeof
(
DWORD
));
/*
* If the memory allocation failed, return a null pointer.
*/
if
(
newBuffer
==
0
)
return
0
;
/*
* Copy the length of the string in the placeholder.
*/
*
newBuffer
=
bufferSize
;
/*
* Skip the byte count.
*/
newBuffer
++
;
memcpy
(
newBuffer
,
str
,
bufferSize
);
/*
* Make sure that there is a nul character at the end of the
* string.
*/
stringBuffer
=
(
WCHAR
*
)
newBuffer
;
stringBuffer
[
len
]
=
'\0'
;
return
stringBuffer
;
}
}
/***********************************************************************
/***********************************************************************
* PropSysFreeString [OLE32.@]
* PropSysFreeString [OLE32.@]
* NOTES
* NOTES
*
Copy of SysFreeString
.
*
Forward to oleaut32
.
*/
*/
void
WINAPI
PropSysFreeString
(
LPOLESTR
str
)
void
WINAPI
PropSysFreeString
(
LPOLESTR
str
)
{
{
DWORD
*
bufferPointer
;
SysFreeString
(
str
);
/* NULL is a valid parameter */
if
(
!
str
)
return
;
/*
* We have to be careful when we free a BSTR pointer, it points to
* the beginning of the string but it skips the byte count contained
* before the string.
*/
bufferPointer
=
(
DWORD
*
)
str
;
bufferPointer
--
;
/*
* Free the memory from its "real" origin.
*/
HeapFree
(
GetProcessHeap
(),
0
,
bufferPointer
);
}
}
/******************************************************************************
/******************************************************************************
...
...
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