1 | /* $Id: libWin32kSetOptions.c,v 1.3 2001-02-14 12:46:56 bird Exp $
|
---|
2 | *
|
---|
3 | * libWin32kSetOptions - Sets the changable options of win32k.sys the options.
|
---|
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 |
|
---|
12 | /*******************************************************************************
|
---|
13 | * Header Files *
|
---|
14 | *******************************************************************************/
|
---|
15 | #define INCL_DOSERRORS
|
---|
16 | #define INCL_DOSFILEMGR
|
---|
17 | #define INCL_DOSDEVICES
|
---|
18 |
|
---|
19 |
|
---|
20 | /*******************************************************************************
|
---|
21 | * Internal Functions *
|
---|
22 | *******************************************************************************/
|
---|
23 | #include <os2.h>
|
---|
24 | #include "win32k.h"
|
---|
25 |
|
---|
26 |
|
---|
27 | /*******************************************************************************
|
---|
28 | * Global Variables *
|
---|
29 | *******************************************************************************/
|
---|
30 | extern BOOL fInited;
|
---|
31 | extern HFILE hWin32k;
|
---|
32 |
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Gets the options settings and/or the status of win32k.sys.
|
---|
36 | * @returns OS2 returncode.
|
---|
37 | * @param pOptions Pointer to an options struct. (NULL is allowed)
|
---|
38 | * (cb have to be set to the size of the structure.)
|
---|
39 | * @param pStatus Pointer to a status struct. (NULL is allowed)
|
---|
40 | * (cb have to be set to the size of the structure.)
|
---|
41 | * @status completely implelemented.
|
---|
42 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
43 | * @remark
|
---|
44 | */
|
---|
45 | APIRET APIENTRY libWin32kSetOptions(PK32OPTIONS pOptions)
|
---|
46 | {
|
---|
47 | APIRET rc;
|
---|
48 |
|
---|
49 | /*
|
---|
50 | * Simple validation.
|
---|
51 | */
|
---|
52 | if (pOptions == NULL || pOptions->cb != sizeof(K32OPTIONS))
|
---|
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 | K32SETOPTIONS Param;
|
---|
64 | ULONG cbParam = sizeof(Param);
|
---|
65 | ULONG cbData = 0UL;
|
---|
66 |
|
---|
67 | Param.pOptions = pOptions;
|
---|
68 | Param.rc = ERROR_INVALID_PARAMETER;
|
---|
69 |
|
---|
70 | rc = DosDevIOCtl(hWin32k,
|
---|
71 | IOCTL_W32K_K32,
|
---|
72 | K32_SETOPTIONS,
|
---|
73 | &Param, sizeof(Param), &cbParam,
|
---|
74 | "", 1, &cbData);
|
---|
75 |
|
---|
76 | if (rc == NO_ERROR)
|
---|
77 | rc = Param.rc;
|
---|
78 | }
|
---|
79 | else
|
---|
80 | rc = ERROR_INIT_ROUTINE_FAILED;
|
---|
81 |
|
---|
82 | return rc;
|
---|
83 | }
|
---|
84 |
|
---|