1 | /* $Id: d32Win32kIOCtl.c,v 1.4 2000-12-11 06:53:48 bird Exp $
|
---|
2 | *
|
---|
3 | * Win32k driver IOCtl handler function.
|
---|
4 | *
|
---|
5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 | /*******************************************************************************
|
---|
11 | * Defined Constants And Macros *
|
---|
12 | *******************************************************************************/
|
---|
13 | #define INCL_DOSERRORS
|
---|
14 | #define INCL_NOPMAPI
|
---|
15 |
|
---|
16 | #define NO_WIN32K_LIB_FUNCTIONS
|
---|
17 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #include <os2.h>
|
---|
23 |
|
---|
24 | #include "devSegDf.h"
|
---|
25 | #include "dev1632.h"
|
---|
26 | #include "dev32.h"
|
---|
27 | #include "OS2Krnl.h"
|
---|
28 | #include "Win32k.h"
|
---|
29 | #include "k32.h"
|
---|
30 |
|
---|
31 |
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * IOCtl handler for the Win32k part of the driver.
|
---|
35 | * @returns Gen IOCtl return code.
|
---|
36 | * @param pRpIOCtl Pointer to 32-bit request packet. (not to the original packet)
|
---|
37 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
38 | */
|
---|
39 | USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl)
|
---|
40 | {
|
---|
41 | /* validate parameter pointer */
|
---|
42 | if (pRpIOCtl == NULL || pRpIOCtl->ParmPacket == NULL)
|
---|
43 | return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
|
---|
44 |
|
---|
45 | switch (pRpIOCtl->Category)
|
---|
46 | {
|
---|
47 | case IOCTL_W32K_K32:
|
---|
48 | switch (pRpIOCtl->Function)
|
---|
49 | {
|
---|
50 | case K32_ALLOCMEMEX:
|
---|
51 | {
|
---|
52 | PK32ALLOCMEMEX pParm = (PK32ALLOCMEMEX)pRpIOCtl->ParmPacket;
|
---|
53 | pParm->rc = k32AllocMemEx(&pParm->pv, pParm->cb, pParm->flFlags,
|
---|
54 | pParm->ulCS, pParm->ulEIP);
|
---|
55 | return STATUS_DONE;
|
---|
56 | }
|
---|
57 |
|
---|
58 | case K32_QUERYOTES:
|
---|
59 | {
|
---|
60 | PK32QUERYOTES pParm = (PK32QUERYOTES)pRpIOCtl->ParmPacket;
|
---|
61 | pParm->rc = k32QueryOTEs((HMTE)pParm->hMTE, pParm->pQOte, pParm->cbQOte);
|
---|
62 | return STATUS_DONE;
|
---|
63 | }
|
---|
64 |
|
---|
65 | case K32_QUERYOPTIONSSTATUS:
|
---|
66 | {
|
---|
67 | PK32QUERYOPTIONSSTATUS pParm = (PK32QUERYOPTIONSSTATUS)pRpIOCtl->ParmPacket;
|
---|
68 | pParm->rc = k32QueryOptionsStatus(pParm->pOptions, pParm->pStatus);
|
---|
69 | return STATUS_DONE;
|
---|
70 | }
|
---|
71 |
|
---|
72 | case K32_SETOPTIONS:
|
---|
73 | {
|
---|
74 | PK32SETOPTIONS pParm = (PK32SETOPTIONS)pRpIOCtl->ParmPacket;
|
---|
75 | pParm->rc = k32SetOptions(pParm->pOptions);
|
---|
76 | return STATUS_DONE;
|
---|
77 | }
|
---|
78 |
|
---|
79 | case K32_PROCESSREADWRITE:
|
---|
80 | {
|
---|
81 | PK32PROCESSREADWRITE pParm = (PK32PROCESSREADWRITE)pRpIOCtl->ParmPacket;
|
---|
82 | pParm->rc = k32ProcessReadWrite(pParm->pid, pParm->cb, pParm->pvSource, pParm->pvTarget, pParm->fRead);
|
---|
83 | return STATUS_DONE;
|
---|
84 | }
|
---|
85 | }
|
---|
86 | break;
|
---|
87 | }
|
---|
88 |
|
---|
89 | return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
|
---|
90 | }
|
---|
91 |
|
---|