source: trunk/src/win32k/ldr/myldrClose.cpp@ 2912

Last change on this file since 2912 was 2501, checked in by bird, 26 years ago

Temporary backup checkin.

File size: 1.8 KB
Line 
1/* $Id: myldrClose.cpp,v 1.5 2000-01-22 18:21:02 bird Exp $
2 *
3 * myldrClose - ldrClose
4 *
5 * Copyright (c) 1998-1999 knut st. osmundsen
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10
11/*******************************************************************************
12* Defined Constants And Macros *
13*******************************************************************************/
14#define INCL_DOSERRORS
15#define INCL_NOPMAPI
16
17/*******************************************************************************
18* Header Files *
19*******************************************************************************/
20#include <os2.h>
21
22#include <memory.h>
23#include <stdlib.h>
24
25#include "log.h"
26#include <peexe.h>
27#include <exe386.h>
28#include "OS2Krnl.h"
29#include "avl.h"
30#include "ModuleBase.h"
31#include "ldr.h"
32#include "ldrCalls.h"
33
34
35/**
36 * Close a file.
37 * @returns NO_ERROR on success?
38 * error code on error?
39 * @param hFile Handle to file which is to be closed.
40 */
41ULONG LDRCALL myldrClose(SFN hFile)
42{
43 /* closes handle */
44 kprintf(("ldrClose: hFile = %.4x\n", hFile));
45 if (GetState(hFile) == HSTATE_OUR)
46 {
47 APIRET rc;
48
49 #ifdef DEBUG
50 PMODULE pMod = getModuleBySFN(hFile);
51 if (pMod != NULL)
52 pMod->Data.pModule->dumpVirtualLxFile();
53 else
54 kprintf(("ldrClose: getModuleBySFN failed!!!"));
55 #endif
56
57 rc = removeModule(hFile);
58 if (rc != NO_ERROR)
59 kprintf(("ldrClose: removeModule retured rc=%d\n", rc));
60
61 #pragma info(notrd)
62 SetState(hFile, HSTATE_UNUSED);
63 #pragma info(restore)
64 }
65
66 return ldrClose(hFile);
67}
Note: See TracBrowser for help on using the repository browser.