1 | /* $Id: libWin32kQueryOptionsStatus.c,v 1.3 2001-02-21 07:47:59 bird Exp $
|
---|
2 | *
|
---|
3 | * libWin32kQueryOptionsStatus - Queries the options and/or the status of
|
---|
4 | * Win32k.sys driver.
|
---|
5 | *
|
---|
6 | * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
7 | *
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | *
|
---|
10 | */
|
---|
11 |
|
---|
12 |
|
---|
13 | /*******************************************************************************
|
---|
14 | * Header Files *
|
---|
15 | *******************************************************************************/
|
---|
16 | #define INCL_DOSERRORS
|
---|
17 | #define INCL_DOSFILEMGR
|
---|
18 | #define INCL_DOSDEVICES
|
---|
19 |
|
---|
20 |
|
---|
21 | /*******************************************************************************
|
---|
22 | * Internal Functions *
|
---|
23 | *******************************************************************************/
|
---|
24 | #include <os2.h>
|
---|
25 | #include "win32k.h"
|
---|
26 | #include "libPrivate.h"
|
---|
27 |
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Gets the options settings and/or the status of win32k.sys.
|
---|
31 | * @returns OS2 returncode.
|
---|
32 | * @param pOptions Pointer to an options struct. (NULL is allowed)
|
---|
33 | * (cb have to be set to the size of the structure.)
|
---|
34 | * @param pStatus Pointer to a status struct. (NULL is allowed)
|
---|
35 | * (cb have to be set to the size of the structure.)
|
---|
36 | * @status completely implelemented.
|
---|
37 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
38 | * @remark
|
---|
39 | */
|
---|
40 | APIRET APIENTRY libWin32kQueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus)
|
---|
41 | {
|
---|
42 | APIRET rc;
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * Simple validation.
|
---|
46 | */
|
---|
47 | if ((pOptions != NULL && pOptions->cb != sizeof(K32OPTIONS))
|
---|
48 | ||
|
---|
49 | (pStatus != NULL && pStatus->cb != sizeof(K32STATUS))
|
---|
50 | ||
|
---|
51 | (pOptions == NULL && pStatus == NULL)
|
---|
52 | )
|
---|
53 | rc = ERROR_INVALID_PARAMETER;
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * Check that we're initiated.
|
---|
57 | */
|
---|
58 | else if (fInited)
|
---|
59 | {
|
---|
60 | /*
|
---|
61 | * Build parameters and call win32k.
|
---|
62 | */
|
---|
63 | K32QUERYOPTIONSSTATUS Param;
|
---|
64 | ULONG cbParam = sizeof(Param);
|
---|
65 | ULONG cbData = 0UL;
|
---|
66 |
|
---|
67 | Param.hdr.cb = sizeof(Param);
|
---|
68 | Param.hdr.rc = ERROR_NOT_SUPPORTED;
|
---|
69 | Param.pOptions = pOptions;
|
---|
70 | Param.pStatus = pStatus;
|
---|
71 |
|
---|
72 | if (usCGSelector)
|
---|
73 | return libCallThruCallGate(K32_QUERYOPTIONSSTATUS, &Param);
|
---|
74 | rc = DosDevIOCtl(hWin32k,
|
---|
75 | IOCTL_W32K_K32,
|
---|
76 | K32_QUERYOPTIONSSTATUS,
|
---|
77 | &Param, sizeof(Param), &cbParam,
|
---|
78 | "", 1, &cbData);
|
---|
79 |
|
---|
80 | if (rc == NO_ERROR)
|
---|
81 | rc = Param.hdr.rc;
|
---|
82 | }
|
---|
83 | else
|
---|
84 | rc = ERROR_INIT_ROUTINE_FAILED;
|
---|
85 |
|
---|
86 | return rc;
|
---|
87 | }
|
---|
88 |
|
---|