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
2731998a
Commit
2731998a
authored
Nov 17, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Get rid of heap.h.
parent
75b8f888
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
66 deletions
+50
-66
escape.c
dlls/wineps.drv/escape.c
+26
-11
init.c
dlls/wineps.drv/init.c
+7
-3
info.c
dlls/winspool.drv/info.c
+17
-6
heap.h
include/heap.h
+0
-46
No files found.
dlls/wineps.drv/escape.c
View file @
2731998a
...
...
@@ -28,7 +28,6 @@
#include "psdrv.h"
#include "wine/debug.h"
#include "winspool.h"
#include "heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
...
...
@@ -434,22 +433,38 @@ INT PSDRV_StartDocA( PSDRV_PDEVICE *physDev, const DOCINFOA *doc )
INT
PSDRV_StartDoc
(
PSDRV_PDEVICE
*
physDev
,
const
DOCINFOW
*
doc
)
{
DOCINFOA
docA
;
INT
ret
;
INT
ret
,
len
;
LPSTR
docname
=
NULL
,
output
=
NULL
,
datatype
=
NULL
;
docA
.
cbSize
=
doc
->
cbSize
;
docA
.
lpszDocName
=
doc
->
lpszDocName
?
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
doc
->
lpszDocName
)
:
NULL
;
docA
.
lpszOutput
=
doc
->
lpszOutput
?
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
doc
->
lpszOutput
)
:
NULL
;
docA
.
lpszDatatype
=
doc
->
lpszDatatype
?
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
doc
->
lpszDatatype
)
:
NULL
;
if
(
doc
->
lpszDocName
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
docname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDocName
,
-
1
,
docname
,
len
,
NULL
,
NULL
);
}
if
(
doc
->
lpszOutput
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszOutput
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
output
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszOutput
,
-
1
,
output
,
len
,
NULL
,
NULL
);
}
if
(
doc
->
lpszDatatype
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDatatype
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
datatype
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
doc
->
lpszDatatype
,
-
1
,
datatype
,
len
,
NULL
,
NULL
);
}
docA
.
lpszDocName
=
docname
;
docA
.
lpszOutput
=
output
;
docA
.
lpszDatatype
=
datatype
;
docA
.
fwType
=
doc
->
fwType
;
ret
=
PSDRV_StartDocA
(
physDev
,
&
docA
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
docA
.
lpszDocN
ame
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
docA
.
lpszO
utput
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPSTR
)
docA
.
lpszD
atatype
);
HeapFree
(
GetProcessHeap
(),
0
,
docn
ame
);
HeapFree
(
GetProcessHeap
(),
0
,
o
utput
);
HeapFree
(
GetProcessHeap
(),
0
,
d
atatype
);
return
ret
;
}
...
...
dlls/wineps.drv/init.c
View file @
2731998a
...
...
@@ -22,6 +22,7 @@
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
...
...
@@ -33,13 +34,14 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wownt32.h"
#include "heap.h"
#include "winreg.h"
#include "psdrv.h"
#include "winspool.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
...
...
@@ -353,7 +355,9 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
physDev
->
logPixelsY
=
physDev
->
pi
->
ppd
->
DefaultResolution
;
if
(
output
)
{
physDev
->
job
.
output
=
HEAP_strdupWtoA
(
PSDRV_Heap
,
0
,
output
);
INT
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
output
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
physDev
->
job
.
output
=
HeapAlloc
(
PSDRV_Heap
,
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
output
,
-
1
,
physDev
->
job
.
output
,
len
,
NULL
,
NULL
);
}
else
physDev
->
job
.
output
=
NULL
;
physDev
->
job
.
hJob
=
0
;
...
...
dlls/winspool.drv/info.c
View file @
2731998a
...
...
@@ -58,7 +58,6 @@
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "heap.h"
#include "winnls.h"
#include "ddk/winsplp.h"
...
...
@@ -332,6 +331,18 @@ static LPWSTR strdupW(LPCWSTR p)
return
ret
;
}
static
LPSTR
strdupWtoA
(
LPCWSTR
str
)
{
LPSTR
ret
;
INT
len
;
if
(
!
str
)
return
NULL
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
ret
;
}
/* Returns the number of bytes in an ansi \0\0 terminated string (multi_sz).
The result includes all \0s (specifically the last two). */
static
int
multi_sz_lenA
(
const
char
*
str
)
...
...
@@ -1589,8 +1600,8 @@ INT WINAPI DeviceCapabilitiesW(LPCWSTR pDevice, LPCWSTR pPort,
const
DEVMODEW
*
pDevMode
)
{
LPDEVMODEA
dmA
=
DEVMODEdupWtoA
(
GetProcessHeap
(),
pDevMode
);
LPSTR
pDeviceA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pDevice
);
LPSTR
pPortA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pPort
);
LPSTR
pDeviceA
=
strdupWtoA
(
pDevice
);
LPSTR
pPortA
=
strdupWtoA
(
pPort
);
INT
ret
;
if
(
pOutput
&&
(
fwCapability
==
DC_BINNAMES
||
...
...
@@ -1653,7 +1664,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
SetLastError
(
ERROR_INVALID_HANDLE
);
return
-
1
;
}
lpName
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
lpNameW
);
lpName
=
strdupWtoA
(
lpNameW
);
}
if
(
!
GDI_CallExtDeviceMode16
)
...
...
@@ -1685,7 +1696,7 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
LPDEVMODEW
pDevModeInput
,
DWORD
fMode
)
{
LPSTR
pDeviceNameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
pDeviceName
);
LPSTR
pDeviceNameA
=
strdupWtoA
(
pDeviceName
);
LPDEVMODEA
pDevModeInputA
=
DEVMODEdupWtoA
(
GetProcessHeap
(),
pDevModeInput
);
LPDEVMODEA
pDevModeOutputA
=
NULL
;
LONG
ret
;
...
...
@@ -3228,7 +3239,7 @@ static BOOL WINSPOOL_GetStringFromReg(HKEY hkey, LPCWSTR ValueName, LPBYTE ptr,
if
(
unicode
)
ret
=
RegQueryValueExW
(
hkey
,
ValueName
,
0
,
&
type
,
ptr
,
&
sz
);
else
{
LPSTR
ValueNameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
ValueName
);
LPSTR
ValueNameA
=
strdupWtoA
(
ValueName
);
ret
=
RegQueryValueExA
(
hkey
,
ValueNameA
,
0
,
&
type
,
ptr
,
&
sz
);
HeapFree
(
GetProcessHeap
(),
0
,
ValueNameA
);
}
...
...
include/heap.h
deleted
100644 → 0
View file @
75b8f888
/*
* Win32 heap definitions
*
* Copyright 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_HEAP_H
#define __WINE_HEAP_H
#include <stdarg.h>
#include <string.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
/* strdup macros */
/* DO NOT USE IT!! it will go away soon */
inline
static
LPSTR
HEAP_strdupWtoA
(
HANDLE
heap
,
DWORD
flags
,
LPCWSTR
str
)
{
LPSTR
ret
;
INT
len
;
if
(
!
str
)
return
NULL
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
ret
=
HeapAlloc
(
heap
,
flags
,
len
);
if
(
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
ret
;
}
#endif
/* __WINE_HEAP_H */
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