listview: Implement 2 pixel decoration at top of report style with grid lines.
[wine] / dlls / ifsmgr.vxd / ifsmgr.c
1 /*
2  * IFSMGR VxD implementation
3  *
4  * Copyright 1998 Marcus Meissner
5  * Copyright 1998 Ulrich Weigand
6  * Copyright 1998 Patrik Stridvall
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22
23 /* NOTES
24  *   These ioctls are used by 'MSNET32.DLL'.
25  *
26  *   I have been unable to uncover any documentation about the ioctls so
27  *   the implementation of the cases IFS_IOCTL_21 and IFS_IOCTL_2F are
28  *   based on reasonable guesses on information found in the Windows 95 DDK.
29  */
30
31 #include <stdarg.h>
32
33 #include "windef.h"
34 #include "winbase.h"
35 #include "wine/debug.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(vxd);
38
39 extern void WINAPI CallBuiltinHandler( CONTEXT86 *context, BYTE intnum );  /* from winedos */
40
41 /*
42  * IFSMgr DeviceIO service
43  */
44
45 #define IFS_IOCTL_21                100
46 #define IFS_IOCTL_2F                101
47 #define IFS_IOCTL_GET_RES           102
48 #define IFS_IOCTL_GET_NETPRO_NAME_A 103
49
50 struct win32apireq {
51         unsigned long   ar_proid;
52         unsigned long   ar_eax;
53         unsigned long   ar_ebx;
54         unsigned long   ar_ecx;
55         unsigned long   ar_edx;
56         unsigned long   ar_esi;
57         unsigned long   ar_edi;
58         unsigned long   ar_ebp;
59         unsigned short  ar_error;
60         unsigned short  ar_pad;
61 };
62
63 static void win32apieq_2_CONTEXT(const struct win32apireq *pIn, CONTEXT86 *pCxt)
64 {
65         memset(pCxt,0,sizeof(*pCxt));
66
67         pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL;
68         pCxt->Eax = pIn->ar_eax;
69         pCxt->Ebx = pIn->ar_ebx;
70         pCxt->Ecx = pIn->ar_ecx;
71         pCxt->Edx = pIn->ar_edx;
72         pCxt->Esi = pIn->ar_esi;
73         pCxt->Edi = pIn->ar_edi;
74
75         /* FIXME: Only partial CONTEXT86_CONTROL */
76         pCxt->Ebp = pIn->ar_ebp;
77
78         /* FIXME: pIn->ar_proid ignored */
79         /* FIXME: pIn->ar_error ignored */
80         /* FIXME: pIn->ar_pad ignored */
81 }
82
83 static void CONTEXT_2_win32apieq(const CONTEXT86 *pCxt, struct win32apireq *pOut)
84 {
85         memset(pOut,0,sizeof(struct win32apireq));
86
87         pOut->ar_eax = pCxt->Eax;
88         pOut->ar_ebx = pCxt->Ebx;
89         pOut->ar_ecx = pCxt->Ecx;
90         pOut->ar_edx = pCxt->Edx;
91         pOut->ar_esi = pCxt->Esi;
92         pOut->ar_edi = pCxt->Edi;
93
94         /* FIXME: Only partial CONTEXT86_CONTROL */
95         pOut->ar_ebp = pCxt->Ebp;
96
97         /* FIXME: pOut->ar_proid ignored */
98         /* FIXME: pOut->ar_error ignored */
99         /* FIXME: pOut->ar_pad ignored */
100 }
101
102 /***********************************************************************
103  *           DeviceIoControl   (IFSMGR.VXD.@)
104  */
105 BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
106                                   LPVOID lpvOutBuffer, DWORD cbOutBuffer,
107                                   LPDWORD lpcbBytesReturned,
108                                   LPOVERLAPPED lpOverlapped)
109 {
110     TRACE("(%d,%p,%d,%p,%d,%p,%p): stub\n",
111           dwIoControlCode, lpvInBuffer,cbInBuffer, lpvOutBuffer,cbOutBuffer,
112           lpcbBytesReturned, lpOverlapped);
113
114     switch (dwIoControlCode)
115     {
116     case IFS_IOCTL_21:
117     case IFS_IOCTL_2F:
118         {
119             CONTEXT86 cxt;
120             struct win32apireq *pIn=(struct win32apireq *) lpvInBuffer;
121             struct win32apireq *pOut=(struct win32apireq *) lpvOutBuffer;
122
123             TRACE( "Control '%s': "
124                    "proid=0x%08lx, eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
125                    "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx, ebp=0x%08lx, "
126                    "error=0x%04x, pad=0x%04x\n",
127                    (dwIoControlCode==IFS_IOCTL_21)?"IFS_IOCTL_21":"IFS_IOCTL_2F",
128                    pIn->ar_proid, pIn->ar_eax, pIn->ar_ebx, pIn->ar_ecx,
129                    pIn->ar_edx, pIn->ar_esi, pIn->ar_edi, pIn->ar_ebp,
130                    pIn->ar_error, pIn->ar_pad );
131
132             win32apieq_2_CONTEXT(pIn,&cxt);
133
134             if(dwIoControlCode==IFS_IOCTL_21)
135                 CallBuiltinHandler( &cxt, 0x21 );
136             else
137                 CallBuiltinHandler( &cxt, 0x2f );
138
139             CONTEXT_2_win32apieq(&cxt,pOut);
140             return TRUE;
141         }
142     case IFS_IOCTL_GET_RES:
143         FIXME( "Control 'IFS_IOCTL_GET_RES' not implemented\n");
144         return FALSE;
145     case IFS_IOCTL_GET_NETPRO_NAME_A:
146         FIXME( "Control 'IFS_IOCTL_GET_NETPRO_NAME_A' not implemented\n");
147         return FALSE;
148     default:
149         FIXME( "Control %d not implemented\n", dwIoControlCode);
150         return FALSE;
151     }
152 }