[PATCH 2/4] reg: Add wchar/raw data conversion functions

Jonathan Vollebregt jnvsor at gmail.com
Wed Mar 4 10:29:29 CST 2015


In the case of REG_SZ and the like, it may seem like the functions
perform an unncessary copy of the strings which should already be
in memory ripe for the taking.

However because these functions handle more than one type of data
the calling function needs to be able to free the data afterwards.

Simply returning the input string would result in a function
freeing one of it's own parameters, so we make sure to return
new memory by making a copy.
---
 programs/reg/reg.c       | 145 ++++++++++++++++++++++++++++++++++++++---------
 programs/reg/reg.h       |   1 +
 programs/reg/reg.rc      |   1 +
 programs/reg/tests/reg.c |  57 +++++++++----------
 4 files changed, 149 insertions(+), 55 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-reg-Add-wchar-raw-data-conversion-functions.patch
Type: text/x-patch
Size: 17976 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150304/ba8f4420/attachment-0001.bin>


More information about the wine-patches mailing list