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
60009b9a
Commit
60009b9a
authored
Jan 23, 2003
by
Matthew Davison
Committed by
Alexandre Julliard
Jan 23, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed calls to HEAP_strdupAtoW.
parent
f63e5b64
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
155 additions
and
68 deletions
+155
-68
security.c
dlls/advapi32/security.c
+1
-1
service.c
dlls/advapi32/service.c
+5
-1
filedlg.c
dlls/commdlg/filedlg.c
+12
-3
variant.c
dlls/oleaut32/variant.c
+7
-2
hook.c
dlls/user/hook.c
+10
-3
mmsystem.c
dlls/winmm/mmsystem.c
+6
-3
playsound.c
dlls/winmm/playsound.c
+4
-1
info.c
dlls/winspool/info.c
+57
-38
resource.c
loader/resource.c
+11
-2
environ.c
memory/environ.c
+7
-3
winproc.c
windows/winproc.c
+35
-11
No files found.
dlls/advapi32/security.c
View file @
60009b9a
...
...
@@ -881,7 +881,7 @@ LsaQueryInformationPolicy(
SID_IDENTIFIER_AUTHORITY
localSidAuthority
=
{
SECURITY_NT_AUTHORITY
};
struct
di
*
xdi
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
xdi
));
Rtl
InitUnicodeString
(
&
(
xdi
->
ppdi
.
Name
),
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
"DOMAIN"
)
);
Rtl
CreateUnicodeStringFromAsciiz
(
&
(
xdi
->
ppdi
.
Name
),
"DOMAIN"
);
xdi
->
ppdi
.
Sid
=
&
(
xdi
->
sid
);
xdi
->
sid
.
Revision
=
SID_REVISION
;
xdi
->
sid
.
SubAuthorityCount
=
1
;
...
...
dlls/advapi32/service.c
View file @
60009b9a
...
...
@@ -543,6 +543,7 @@ StartServiceA( SC_HANDLE hService, DWORD dwNumServiceArgs,
LPCSTR
*
lpServiceArgVectors
)
{
LPWSTR
*
lpwstr
=
NULL
;
UNICODE_STRING
usBuffer
;
int
i
;
TRACE
(
"(%p,%ld,%p)
\n
"
,
hService
,
dwNumServiceArgs
,
lpServiceArgVectors
);
...
...
@@ -554,7 +555,10 @@ StartServiceA( SC_HANDLE hService, DWORD dwNumServiceArgs,
lpwstr
=
NULL
;
for
(
i
=
0
;
i
<
dwNumServiceArgs
;
i
++
)
lpwstr
[
i
]
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpServiceArgVectors
[
i
]);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
lpServiceArgVectors
[
i
]);
lpwstr
[
i
]
=
usBuffer
.
Buffer
;
}
StartServiceW
(
hService
,
dwNumServiceArgs
,
(
LPCWSTR
*
)
lpwstr
);
...
...
dlls/commdlg/filedlg.c
View file @
60009b9a
...
...
@@ -33,6 +33,7 @@
#include "commdlg.h"
#include "wine/debug.h"
#include "cderr.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
commdlg
);
...
...
@@ -1100,6 +1101,7 @@ LPWSTR FILEDLG_DupToW(LPCSTR str, DWORD size)
void
FILEDLG_MapOfnStructA
(
LPOPENFILENAMEA
ofnA
,
LPOPENFILENAMEW
ofnW
,
BOOL
open
)
{
LPCSTR
str
;
UNICODE_STRING
usBuffer
;
ofnW
->
lStructSize
=
sizeof
(
OPENFILENAMEW
);
ofnW
->
hwndOwner
=
ofnA
->
hwndOwner
;
...
...
@@ -1116,13 +1118,17 @@ void FILEDLG_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open
ofnW
->
nMaxFileTitle
=
ofnA
->
nMaxFileTitle
;
ofnW
->
lpstrFileTitle
=
FILEDLG_DupToW
(
ofnA
->
lpstrFileTitle
,
ofnW
->
nMaxFileTitle
);
if
(
ofnA
->
lpstrInitialDir
)
ofnW
->
lpstrInitialDir
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
ofnA
->
lpstrInitialDir
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
ofnA
->
lpstrInitialDir
);
ofnW
->
lpstrInitialDir
=
usBuffer
.
Buffer
;
}
if
(
ofnA
->
lpstrTitle
)
str
=
ofnA
->
lpstrTitle
;
else
/* Allocates default title (FIXME : get it from resource) */
str
=
open
?
defaultopen
:
defaultsave
;
ofnW
->
lpstrTitle
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
str
);
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
ofnA
->
lpstrTitle
);
ofnW
->
lpstrTitle
=
usBuffer
.
Buffer
;
ofnW
->
Flags
=
ofnA
->
Flags
;
ofnW
->
nFileOffset
=
ofnA
->
nFileOffset
;
ofnW
->
nFileExtension
=
ofnA
->
nFileExtension
;
...
...
@@ -1130,7 +1136,10 @@ void FILEDLG_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open
if
((
ofnA
->
Flags
&
OFN_ENABLETEMPLATE
)
&&
(
ofnA
->
lpTemplateName
))
{
if
(
HIWORD
(
ofnA
->
lpTemplateName
))
ofnW
->
lpTemplateName
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
ofnA
->
lpTemplateName
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
ofnA
->
lpTemplateName
);
ofnW
->
lpTemplateName
=
usBuffer
.
Buffer
;
}
else
/* numbered resource */
ofnW
->
lpTemplateName
=
(
LPWSTR
)
ofnA
->
lpTemplateName
;
}
...
...
dlls/oleaut32/variant.c
View file @
60009b9a
...
...
@@ -55,6 +55,7 @@
#include "winerror.h"
#include "parsedt.h"
#include "typelib.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -667,9 +668,13 @@ static BSTR StringDupAtoBstr( char* strIn )
{
BSTR
bstr
=
NULL
;
OLECHAR
*
pNewString
=
NULL
;
pNewString
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
strIn
);
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
strIn
);
pNewString
=
usBuffer
.
Buffer
;
bstr
=
SysAllocString
(
pNewString
);
HeapFree
(
GetProcessHeap
(),
0
,
pNewString
);
RtlFreeUnicodeString
(
&
usBuffer
);
return
bstr
;
}
...
...
dlls/user/hook.c
View file @
60009b9a
...
...
@@ -71,6 +71,7 @@
#include "wine/server.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
hook
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
...
...
@@ -156,7 +157,7 @@ static HHOOK set_windows_hook( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid,
static
LRESULT
call_hook_AtoW
(
HOOKPROC
proc
,
INT
id
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
LRESULT
ret
;
UNICODE_STRING
usBuffer
;
if
(
id
!=
WH_CBT
||
code
!=
HCBT_CREATEWND
)
ret
=
proc
(
code
,
wparam
,
lparam
);
else
{
...
...
@@ -169,9 +170,15 @@ static LRESULT call_hook_AtoW( HOOKPROC proc, INT id, INT code, WPARAM wparam, L
csW
=
*
(
CREATESTRUCTW
*
)
cbtcwA
->
lpcs
;
if
(
HIWORD
(
cbtcwA
->
lpcs
->
lpszName
))
csW
.
lpszName
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
cbtcwA
->
lpcs
->
lpszName
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
cbtcwA
->
lpcs
->
lpszName
);
csW
.
lpszName
=
usBuffer
.
Buffer
;
}
if
(
HIWORD
(
cbtcwA
->
lpcs
->
lpszClass
))
csW
.
lpszClass
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
cbtcwA
->
lpcs
->
lpszClass
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
cbtcwA
->
lpcs
->
lpszName
);
csW
.
lpszClass
=
usBuffer
.
Buffer
;
}
ret
=
proc
(
code
,
wparam
,
(
LPARAM
)
&
cbtcwW
);
cbtcwA
->
hwndInsertAfter
=
cbtcwW
.
hwndInsertAfter
;
if
(
HIWORD
(
csW
.
lpszName
))
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
csW
.
lpszName
);
...
...
dlls/winmm/mmsystem.c
View file @
60009b9a
...
...
@@ -36,6 +36,7 @@
#define NONAMELESSSTRUCT
#include "mmsystem.h"
#include "winbase.h"
#include "winternl.h"
#include "wine/winuser16.h"
#include "winemm.h"
...
...
@@ -2553,9 +2554,11 @@ DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
*/
UINT16
WINAPI
mciLoadCommandResource16
(
HINSTANCE16
hInst
,
LPCSTR
resname
,
UINT16
type
)
{
LPCWSTR
ptr
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
resname
);
UINT
ret
=
mciLoadCommandResource
(
HINSTANCE_32
(
hInst
),
ptr
,
type
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
ptr
);
UNICODE_STRING
ptr
;
UINT
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
ptr
,
resname
);
ret
=
mciLoadCommandResource
(
HINSTANCE_32
(
hInst
),
ptr
.
Buffer
,
type
);
RtlFreeUnicodeString
(
&
ptr
);
return
ret
;
}
...
...
dlls/winmm/playsound.c
View file @
60009b9a
...
...
@@ -30,6 +30,7 @@
#include "heap.h"
#include "winreg.h"
#include "winemm.h"
#include "winternl.h"
#include "wine/debug.h"
...
...
@@ -218,7 +219,9 @@ static WINE_PLAYSOUND* PlaySound_Alloc(const void* pszSound, HMODULE hmod,
}
else
{
wps
->
pszSound
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pszSound
);
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
pszSound
);
wps
->
pszSound
=
usBuffer
.
Buffer
;
if
(
!
wps
->
pszSound
)
goto
oom_error
;
wps
->
bAlloc
=
TRUE
;
}
...
...
dlls/winspool/info.c
View file @
60009b9a
...
...
@@ -548,21 +548,35 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW)
static
LPPRINTER_INFO_2W
PRINTER_INFO_2AtoW
(
HANDLE
heap
,
LPPRINTER_INFO_2A
piA
)
{
LPPRINTER_INFO_2W
piW
;
UNICODE_STRING
usBuffer
;
if
(
!
piA
)
return
NULL
;
piW
=
HeapAlloc
(
heap
,
0
,
sizeof
(
*
piW
));
memcpy
(
piW
,
piA
,
sizeof
(
*
piW
));
/* copy everything first */
piW
->
pServerName
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pServerName
);
piW
->
pPrinterName
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pPrinterName
);
piW
->
pShareName
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pShareName
);
piW
->
pPortName
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pPortName
);
piW
->
pDriverName
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pDriverName
);
piW
->
pComment
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pComment
);
piW
->
pLocation
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pLocation
);
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pServerName
);
piW
->
pServerName
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pPrinterName
);
piW
->
pPrinterName
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pShareName
);
piW
->
pShareName
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pPortName
);
piW
->
pPortName
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pDriverName
);
piW
->
pDriverName
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pComment
);
piW
->
pComment
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pLocation
);
piW
->
pLocation
=
usBuffer
.
Buffer
;
piW
->
pDevMode
=
DEVMODEdupAtoW
(
heap
,
piA
->
pDevMode
);
piW
->
pSepFile
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pSepFile
);
piW
->
pPrintProcessor
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pPrintProcessor
);
piW
->
pDatatype
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pDatatype
);
piW
->
pParameters
=
HEAP_strdupAtoW
(
heap
,
0
,
piA
->
pParameters
);
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pSepFile
);
piW
->
pSepFile
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pPrintProcessor
);
piW
->
pPrintProcessor
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pDatatype
);
piW
->
pDatatype
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
piA
->
pParameters
);
piW
->
pParameters
=
usBuffer
.
Buffer
;
return
piW
;
}
...
...
@@ -760,24 +774,27 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
BOOL
WINAPI
OpenPrinterA
(
LPSTR
lpPrinterName
,
HANDLE
*
phPrinter
,
LPPRINTER_DEFAULTSA
pDefault
)
{
LPWSTR
lpPrinterNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpPrinterName
);
UNICODE_STRING
lpPrinterNameW
;
UNICODE_STRING
usBuffer
;
PRINTER_DEFAULTSW
DefaultW
,
*
pDefaultW
=
NULL
;
BOOL
ret
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpPrinterNameW
,
lpPrinterName
);
if
(
pDefault
)
{
DefaultW
.
pDatatype
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pDefault
->
pDatatype
)
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
pDefault
->
pDatatype
);
DefaultW
.
pDatatype
=
usBuffer
.
Buffer
;
DefaultW
.
pDevMode
=
DEVMODEdupAtoW
(
GetProcessHeap
(),
pDefault
->
pDevMode
);
DefaultW
.
DesiredAccess
=
pDefault
->
DesiredAccess
;
pDefaultW
=
&
DefaultW
;
}
ret
=
OpenPrinterW
(
lpPrinterNameW
,
phPrinter
,
pDefaultW
);
ret
=
OpenPrinterW
(
lpPrinterNameW
.
Buffer
,
phPrinter
,
pDefaultW
);
if
(
pDefault
)
{
HeapFree
(
GetProcessHeap
(),
0
,
DefaultW
.
pDatatype
);
RtlFreeUnicodeString
(
&
usBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
DefaultW
.
pDevMode
);
}
HeapFree
(
GetProcessHeap
(),
0
,
lpPrinterNameW
);
RtlFreeUnicodeString
(
&
lpPrinterNameW
);
return
ret
;
}
...
...
@@ -1165,7 +1182,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
*/
HANDLE
WINAPI
AddPrinterA
(
LPSTR
pName
,
DWORD
Level
,
LPBYTE
pPrinter
)
{
WCHAR
*
pNameW
;
UNICODE_STRING
pNameW
;
PRINTER_INFO_2W
*
piW
;
PRINTER_INFO_2A
*
piA
=
(
PRINTER_INFO_2A
*
)
pPrinter
;
HANDLE
ret
;
...
...
@@ -1176,13 +1193,13 @@ HANDLE WINAPI AddPrinterA(LPSTR pName, DWORD Level, LPBYTE pPrinter)
SetLastError
(
ERROR_INVALID_LEVEL
);
return
0
;
}
pNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pName
);
RtlCreateUnicodeStringFromAsciiz
(
&
pNameW
,
pName
);
piW
=
PRINTER_INFO_2AtoW
(
GetProcessHeap
(),
piA
);
ret
=
AddPrinterW
(
pNameW
,
Level
,
(
LPBYTE
)
piW
);
ret
=
AddPrinterW
(
pNameW
.
Buffer
,
Level
,
(
LPBYTE
)
piW
);
FREE_PRINTER_INFO_2W
(
GetProcessHeap
(),
piW
);
HeapFree
(
GetProcessHeap
(),
0
,
pNameW
);
RtlFreeUnicodeString
(
&
pNameW
);
return
ret
;
}
...
...
@@ -2148,11 +2165,11 @@ BOOL WINAPI EnumPrintersA(DWORD dwType, LPSTR lpszName,
LPDWORD
lpdwReturned
)
{
BOOL
ret
;
LPWSTR
lpszNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
lpszName
)
;
ret
=
WINSPOOL_EnumPrinters
(
dwType
,
lpszNameW
,
dwLevel
,
lpbPrinters
,
cbBuf
,
UNICODE_STRING
lpszNameW
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpszNameW
,
lpszName
);
ret
=
WINSPOOL_EnumPrinters
(
dwType
,
lpszNameW
.
Buffer
,
dwLevel
,
lpbPrinters
,
cbBuf
,
lpdwNeeded
,
lpdwReturned
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszNameW
);
RtlFreeUnicodeString
(
&
lpszNameW
);
return
ret
;
}
...
...
@@ -2422,10 +2439,11 @@ BOOL WINAPI GetPrinterDriverA(HANDLE hPrinter, LPSTR pEnvironment,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
)
{
BOOL
ret
;
LPWSTR
pEnvW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pEnvironment
);
ret
=
WINSPOOL_GetPrinterDriver
(
hPrinter
,
pEnvW
,
Level
,
pDriverInfo
,
UNICODE_STRING
pEnvW
;
RtlCreateUnicodeStringFromAsciiz
(
&
pEnvW
,
pEnvironment
);
ret
=
WINSPOOL_GetPrinterDriver
(
hPrinter
,
pEnvW
.
Buffer
,
Level
,
pDriverInfo
,
cbBuf
,
pcbNeeded
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
pEnvW
);
RtlFreeUnicodeString
(
&
pEnvW
);
return
ret
;
}
/*****************************************************************************
...
...
@@ -2797,19 +2815,20 @@ BOOL WINAPI EnumPrinterDriversA(LPSTR pName, LPSTR pEnvironment, DWORD Level,
LPBYTE
pDriverInfo
,
DWORD
cbBuf
,
LPDWORD
pcbNeeded
,
LPDWORD
pcReturned
)
{
BOOL
ret
;
WCHAR
*
pNameW
=
NULL
,
*
pEnvironmentW
=
NULL
;
UNICODE_STRING
pNameW
,
pEnvironmentW
;
if
(
pName
)
RtlCreateUnicodeStringFromAsciiz
(
&
pNameW
,
pName
);
if
(
pEnvironment
)
RtlCreateUnicodeStringFromAsciiz
(
&
pEnvironmentW
,
pEnvironment
);
ret
=
WINSPOOL_EnumPrinterDrivers
(
pNameW
.
Buffer
,
pEnvironmentW
.
Buffer
,
Level
,
pDriverInfo
,
cbBuf
,
pcbNeeded
,
pcReturned
,
FALSE
);
if
(
pName
)
pNameW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pName
);
RtlFreeUnicodeString
(
&
pNameW
);
if
(
pEnvironment
)
pEnvironmentW
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
pEnvironment
);
ret
=
WINSPOOL_EnumPrinterDrivers
(
pNameW
,
pEnvironmentW
,
Level
,
pDriverInfo
,
cbBuf
,
pcbNeeded
,
pcReturned
,
FALSE
);
if
(
pNameW
)
HeapFree
(
GetProcessHeap
(),
0
,
pNameW
);
if
(
pEnvironmentW
)
HeapFree
(
GetProcessHeap
(),
0
,
pEnvironmentW
);
RtlFreeUnicodeString
(
&
pEnvironmentW
);
return
ret
;
}
...
...
loader/resource.c
View file @
60009b9a
...
...
@@ -43,6 +43,7 @@
#include "winerror.h"
#include "winnls.h"
#include "excpt.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
resource
);
...
...
@@ -206,11 +207,19 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type,
LPWSTR
typeStr
,
nameStr
;
if
(
HIWORD
(
type
)
&&
!
bUnicode
)
typeStr
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
type
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
type
);
typeStr
=
usBuffer
.
Buffer
;
}
else
typeStr
=
(
LPWSTR
)
type
;
if
(
HIWORD
(
name
)
&&
!
bUnicode
)
nameStr
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
name
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
name
);
nameStr
=
usBuffer
.
Buffer
;
}
else
nameStr
=
(
LPWSTR
)
name
;
...
...
memory/environ.c
View file @
60009b9a
...
...
@@ -810,6 +810,7 @@ VOID WINAPI GetStartupInfoA( LPSTARTUPINFOA info )
*/
VOID
WINAPI
GetStartupInfoW
(
LPSTARTUPINFOW
info
)
{
UNICODE_STRING
usBuffer
;
info
->
cb
=
sizeof
(
STARTUPINFOW
);
info
->
dwX
=
current_startupinfo
.
dwX
;
info
->
dwY
=
current_startupinfo
.
dwY
;
...
...
@@ -824,7 +825,10 @@ VOID WINAPI GetStartupInfoW( LPSTARTUPINFOW info )
info
->
hStdInput
=
current_startupinfo
.
hStdInput
;
info
->
hStdOutput
=
current_startupinfo
.
hStdOutput
;
info
->
hStdError
=
current_startupinfo
.
hStdError
;
info
->
lpReserved
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
current_startupinfo
.
lpReserved
);
info
->
lpDesktop
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
current_startupinfo
.
lpDesktop
);
info
->
lpTitle
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
current_startupinfo
.
lpTitle
);
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
current_startupinfo
.
lpReserved
);
info
->
lpReserved
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
current_startupinfo
.
lpDesktop
);
info
->
lpDesktop
=
usBuffer
.
Buffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,
current_startupinfo
.
lpTitle
);
info
->
lpTitle
=
usBuffer
.
Buffer
;
}
windows/winproc.c
View file @
60009b9a
...
...
@@ -41,6 +41,7 @@
#include "message.h"
#include "thread.h"
#include "dde.h"
#include "winternl.h"
WINE_DECLARE_DEBUG_CHANNEL
(
msg
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
...
...
@@ -593,9 +594,13 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case
LB_DIR
:
case
LB_ADDFILE
:
case
EM_REPLACESEL
:
{
UNICODE_STRING
usBuffer
;
if
(
!*
plparam
)
return
0
;
*
plparam
=
(
LPARAM
)
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
*
plparam
);
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
*
plparam
);
*
plparam
=
(
LPARAM
)
usBuffer
.
Buffer
;
return
(
*
plparam
?
1
:
-
1
);
}
case
WM_GETTEXTLENGTH
:
case
CB_GETLBTEXTLEN
:
case
LB_GETTEXTLEN
:
...
...
@@ -603,6 +608,7 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case
WM_NCCREATE
:
case
WM_CREATE
:
{
UNICODE_STRING
usBuffer
;
struct
s
{
CREATESTRUCTW
cs
;
/* new structure */
LPCWSTR
lpszName
;
/* allocated Name */
...
...
@@ -613,11 +619,15 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
if
(
!
xs
)
return
-
1
;
xs
->
cs
=
*
(
CREATESTRUCTW
*
)
*
plparam
;
if
(
HIWORD
(
xs
->
cs
.
lpszName
))
xs
->
lpszName
=
xs
->
cs
.
lpszName
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
xs
->
cs
.
lpszName
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
xs
->
cs
.
lpszName
);
xs
->
lpszName
=
xs
->
cs
.
lpszName
=
usBuffer
.
Buffer
;
}
if
(
HIWORD
(
xs
->
cs
.
lpszClass
))
xs
->
lpszClass
=
xs
->
cs
.
lpszClass
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
xs
->
cs
.
lpszClass
);
{
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
xs
->
cs
.
lpszClass
);
xs
->
lpszClass
=
xs
->
cs
.
lpszClass
=
usBuffer
.
Buffer
;
}
*
plparam
=
(
LPARAM
)
xs
;
}
return
1
;
...
...
@@ -628,11 +638,17 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
if
(
!
cs
)
return
-
1
;
*
cs
=
*
(
MDICREATESTRUCTW
*
)
*
plparam
;
if
(
HIWORD
(
cs
->
szClass
))
cs
->
szClass
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
cs
->
szClass
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
cs
->
szClass
);
cs
->
szClass
=
usBuffer
.
Buffer
;
}
if
(
HIWORD
(
cs
->
szTitle
))
cs
->
szTitle
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
cs
->
szTitle
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
cs
->
szTitle
);
cs
->
szTitle
=
usBuffer
.
Buffer
;
}
*
plparam
=
(
LPARAM
)
cs
;
}
return
1
;
...
...
@@ -645,7 +661,11 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case
LB_SELECTSTRING
:
if
(
!*
plparam
)
return
0
;
if
(
WINPROC_TestLBForStr
(
hwnd
))
*
plparam
=
(
LPARAM
)
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
*
plparam
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
*
plparam
);
*
plparam
=
(
LPARAM
)
usBuffer
.
Buffer
;
}
return
(
*
plparam
?
1
:
-
1
);
case
LB_GETTEXT
:
/* FIXME: fixed sized buffer */
...
...
@@ -666,7 +686,11 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
case
CB_SELECTSTRING
:
if
(
!*
plparam
)
return
0
;
if
(
WINPROC_TestCBForStr
(
hwnd
))
*
plparam
=
(
LPARAM
)
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
(
LPCSTR
)
*
plparam
);
{
UNICODE_STRING
usBuffer
;
RtlCreateUnicodeStringFromAsciiz
(
&
usBuffer
,(
LPCSTR
)
*
plparam
);
*
plparam
=
(
LPARAM
)
usBuffer
.
Buffer
;
}
return
(
*
plparam
?
1
:
-
1
);
case
CB_GETLBTEXT
:
/* FIXME: fixed sized buffer */
...
...
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