| 1 | /* $Id: libWin32kSetOptions.c,v 1.4 2001-02-21 07:47:59 bird Exp $ | 
|---|
| 2 | * | 
|---|
| 3 | * libWin32kSetOptions - Sets the changable options of win32k.sys the options. | 
|---|
| 4 | * | 
|---|
| 5 | * Copyright (c) 2000-2001 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 | #include "libPrivate.h" | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 | /** | 
|---|
| 29 | * Gets the options settings and/or the status of win32k.sys. | 
|---|
| 30 | * @returns     OS2 returncode. | 
|---|
| 31 | * @param       pOptions    Pointer to an options struct. (NULL is allowed) | 
|---|
| 32 | *                          (cb have to be set to the size of the structure.) | 
|---|
| 33 | * @param       pStatus     Pointer to a status struct. (NULL is allowed) | 
|---|
| 34 | *                          (cb have to be set to the size of the structure.) | 
|---|
| 35 | * @status      completely implelemented. | 
|---|
| 36 | * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no) | 
|---|
| 37 | * @remark | 
|---|
| 38 | */ | 
|---|
| 39 | APIRET APIENTRY  libWin32kSetOptions(PK32OPTIONS pOptions) | 
|---|
| 40 | { | 
|---|
| 41 | APIRET rc; | 
|---|
| 42 |  | 
|---|
| 43 | /* | 
|---|
| 44 | * Simple validation. | 
|---|
| 45 | */ | 
|---|
| 46 | if (pOptions == NULL || pOptions->cb != sizeof(K32OPTIONS)) | 
|---|
| 47 | rc = ERROR_INVALID_PARAMETER; | 
|---|
| 48 |  | 
|---|
| 49 | /* | 
|---|
| 50 | * Check that we're initiated. | 
|---|
| 51 | */ | 
|---|
| 52 | else if (fInited) | 
|---|
| 53 | { | 
|---|
| 54 | /* | 
|---|
| 55 | * Build parameters and call win32k. | 
|---|
| 56 | */ | 
|---|
| 57 | K32SETOPTIONS   Param; | 
|---|
| 58 | ULONG           cbParam = sizeof(Param); | 
|---|
| 59 | ULONG           cbData = 0UL; | 
|---|
| 60 |  | 
|---|
| 61 | Param.hdr.cb    = sizeof(Param); | 
|---|
| 62 | Param.hdr.rc    = ERROR_NOT_SUPPORTED; | 
|---|
| 63 | Param.pOptions  = pOptions; | 
|---|
| 64 |  | 
|---|
| 65 | if (usCGSelector) | 
|---|
| 66 | return libCallThruCallGate(K32_SETOPTIONS, &Param); | 
|---|
| 67 | rc = DosDevIOCtl(hWin32k, | 
|---|
| 68 | IOCTL_W32K_K32, | 
|---|
| 69 | K32_SETOPTIONS, | 
|---|
| 70 | &Param, sizeof(Param), &cbParam, | 
|---|
| 71 | "", 1, &cbData); | 
|---|
| 72 |  | 
|---|
| 73 | if (rc == NO_ERROR) | 
|---|
| 74 | rc = Param.hdr.rc; | 
|---|
| 75 | } | 
|---|
| 76 | else | 
|---|
| 77 | rc = ERROR_INIT_ROUTINE_FAILED; | 
|---|
| 78 |  | 
|---|
| 79 | return rc; | 
|---|
| 80 | } | 
|---|
| 81 |  | 
|---|