source: trunk/src/win32k/lib/libDosAllocMemEx.c@ 5201

Last change on this file since 5201 was 5201, checked in by bird, 25 years ago

Changed parameter struct to not return pv but hold ppv.

File size: 2.0 KB
Line 
1/* $Id: libDosAllocMemEx.c,v 1.7 2001-02-20 04:57:28 bird Exp $
2 *
3 * DosAllocMemEx - Extened Edition of DosAllocMem.
4 * Allows you to suggest an address of the memory.
5 *
6 * Copyright (c) 2000 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
27
28/*******************************************************************************
29* Global Variables *
30*******************************************************************************/
31extern BOOL fInited;
32extern HFILE hWin32k;
33
34
35
36
37APIRET APIENTRY DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag)
38{
39 APIRET rc;
40
41 if (fInited)
42 {
43 K32ALLOCMEMEX Param;
44 ULONG cbParam = sizeof(Param);
45 ULONG cbData = 0UL;
46
47 Param.ppv = ppv;
48 Param.cb = cb;
49 Param.flFlags = flag;
50 Param.rc = 0;
51 Param.ulCS = libHelperGetCS();
52 Param.ulEIP = *(PULONG)((int)(&ppv) - 4);
53
54 rc = DosDevIOCtl(hWin32k,
55 IOCTL_W32K_K32,
56 K32_ALLOCMEMEX,
57 &Param, sizeof(Param), &cbParam,
58 "", 1, &cbData);
59 if (rc == NO_ERROR)
60 {
61 rc = Param.rc;
62 }
63 }
64 else
65 rc = ERROR_INIT_ROUTINE_FAILED;
66
67 return rc;
68}
69
Note: See TracBrowser for help on using the repository browser.