printdrv.c 3.99 KB
Newer Older
1
/*
Alexandre Julliard's avatar
Alexandre Julliard committed
2
 * Implementation of some printer driver bits
3
 *
Alexandre Julliard's avatar
Alexandre Julliard committed
4
 * Copyright 1996 John Harvey
5
 * Copyright 1998 Huw Davies
Alexandre Julliard's avatar
Alexandre Julliard committed
6
 * Copyright 1998 Andreas Mohr
7
 * Copyright 1999 Klaas van Gend
8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * 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
21
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard's avatar
Alexandre Julliard committed
22 23
 */

24 25 26 27
#if 0
#pragma makedep unix
#endif

28
#include <stdarg.h>
29

30
#include "windef.h"
31
#include "winbase.h"
32
#include "wingdi.h"
33
#include "winnls.h"
34
#include "winspool.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
35
#include "winerror.h"
36
#include "wine/debug.h"
37
#include "ntgdi_private.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
38

39
WINE_DEFAULT_DEBUG_CHANNEL(print);
40

41
/******************************************************************
42
 *           NtGdiGetSpoolMessage    (win32u.@)
43
 */
44
DWORD WINAPI NtGdiGetSpoolMessage( void *ptr1, DWORD data2, void *ptr3, DWORD data4 )
45
{
46 47 48 49
    LARGE_INTEGER time;

    TRACE( "(%p 0x%x %p 0x%x) stub\n", ptr1, data2, ptr3, data4 );

50 51
    /* avoid 100% cpu usage with spoolsv.exe from w2k
      (spoolsv.exe from xp does Sleep 1000/1500/2000 in a loop) */
52 53
    time.QuadPart = 500 * -10000;
    NtDelayExecution( FALSE, &time );
54 55 56 57
    return 0;
}

/******************************************************************
58
 *           NtGdiInitSpool    (win32u.@)
59
 */
60
DWORD WINAPI NtGdiInitSpool(void)
61 62 63 64
{
    FIXME("stub\n");
    return TRUE;
}
Alexandre Julliard's avatar
Alexandre Julliard committed
65

66
/******************************************************************
67
 *           NtGdiStartDoc    (win32u.@)
68
 */
69
INT WINAPI NtGdiStartDoc( HDC hdc, const DOCINFOW *doc, BOOL *banding, INT job )
70
{
71
    INT ret = SP_ERROR;
72
    DC *dc = get_dc_ptr( hdc );
73

74
    TRACE("DocName %s, Output %s, Datatype %s, fwType %#x\n",
75
          debugstr_w(doc->lpszDocName), debugstr_w(doc->lpszOutput),
76
          debugstr_w(doc->lpszDatatype), doc->fwType);
77

78
    if (dc)
79
    {
80 81
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pStartDoc );
        ret = physdev->funcs->pStartDoc( physdev, doc );
82
        release_dc_ptr( dc );
83
    }
84
    return ret;
85 86
}

87

88
/******************************************************************
89
 *           NtGdiEndDoc    (win32u.@)
90
 */
91
INT WINAPI NtGdiEndDoc( HDC hdc )
92
{
93
    INT ret = SP_ERROR;
94
    DC *dc = get_dc_ptr( hdc );
95

96 97 98 99 100 101
    if (dc)
    {
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pEndDoc );
        ret = physdev->funcs->pEndDoc( physdev );
        release_dc_ptr( dc );
    }
102
    return ret;
103 104
}

105 106

/******************************************************************
107
 *           NtGdiStartPage    (win32u.@)
108
 */
109
INT WINAPI NtGdiStartPage( HDC hdc )
110
{
111
    INT ret = SP_ERROR;
112
    DC *dc = get_dc_ptr( hdc );
113

114 115 116 117 118 119
    if (dc)
    {
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pStartPage );
        ret = physdev->funcs->pStartPage( physdev );
        release_dc_ptr( dc );
    }
120
    return ret;
121 122
}

Alexandre Julliard's avatar
Alexandre Julliard committed
123

124
/******************************************************************
125
 *           NtGdiEndPage    (win32u.@)
126
 */
127
INT WINAPI NtGdiEndPage( HDC hdc )
128
{
129
    INT ret = SP_ERROR;
130
    DC *dc = get_dc_ptr( hdc );
131

132 133 134 135 136 137
    if (dc)
    {
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pEndPage );
        ret = physdev->funcs->pEndPage( physdev );
        release_dc_ptr( dc );
    }
138
    return ret;
139 140
}

141

142 143
/***********************************************************************
 *           NtGdiAbortDoc    (win32u.@)
144
 */
145
INT WINAPI NtGdiAbortDoc( HDC hdc )
146
{
147
    INT ret = SP_ERROR;
148
    DC *dc = get_dc_ptr( hdc );
149

150 151 152 153 154 155
    if (dc)
    {
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pAbortDoc );
        ret = physdev->funcs->pAbortDoc( physdev );
        release_dc_ptr( dc );
    }
156
    return ret;
157
}