source: trunk/include/windllbase.h@ 953

Last change on this file since 953 was 953, checked in by sandervl, 26 years ago

New headers for kernel32 win32 image classes + removed old ones + nameid.h

File size: 2.3 KB
Line 
1/* $Id: windllbase.h,v 1.1 1999-09-15 23:29:36 sandervl Exp $ */
2
3/*
4 * Win32 Dll base class
5 *
6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#ifndef __WINDLLBASE_H__
13#define __WINDLLBASE_H__
14
15#include <winimagebase.h>
16#include <odinlx.h>
17
18#ifndef HINSTANCE
19#define HINSTANCE ULONG
20#endif
21
22#define DLL_PROCESS_ATTACH 1
23#define DLL_THREAD_ATTACH 2
24#define DLL_THREAD_DETACH 3
25#define DLL_PROCESS_DETACH 0
26
27#define DONT_RESOLVE_DLL_REFERENCES 0x00000001
28#define LOAD_LIBRARY_AS_DATAFILE 0x00000002
29#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
30
31class Win32DllBase : public virtual Win32ImageBase
32{
33public:
34 Win32DllBase(HINSTANCE hInstance, WIN32DLLENTRY DllEntryPoint);
35virtual ~Win32DllBase();
36
37 ULONG AddRef() { return ++referenced; };
38 //ASSUMPTION: called by FreeLibrary only
39virtual ULONG Release();
40 char *getName() { return szModule; };
41 void setNoEntryCalls() { fSkipEntryCalls = TRUE; };
42
43 Win32DllBase *getNext() { return next; };
44static Win32DllBase *getFirst();
45
46//Send DLL_THREAD_ATTACH message to all dlls for a new thread
47static void attachThreadToAllDlls();
48
49//Send DLL_THREAD_DETACH message to all dlls for thread that's about to die
50static void detachThreadFromAllDlls();
51
52//Setup TLS structure for all dlls for a new thread
53static void tlsAttachThreadToAllDlls();
54
55//Destroy TLS structure for all dlls for a thread that's about to die
56static void tlsDetachThreadFromAllDlls();
57
58virtual ULONG getApi(char *name) = 0;
59virtual ULONG getApi(int ordinal) = 0;
60
61 BOOL attachProcess();
62 BOOL detachProcess();
63 BOOL attachThread();
64 BOOL detachThread();
65
66static void deleteAll();
67
68static BOOL isSystemDll(char *szFileName);
69
70virtual BOOL isLxDll() = 0;
71virtual BOOL isDll();
72
73static Win32DllBase *findModule(char *dllname);
74static Win32DllBase *findModule(HINSTANCE hinstance);
75static Win32DllBase *findModule(WIN32DLLENTRY DllEntryPoint);
76
77protected:
78 BOOL fSkipEntryCalls, fUnloaded, fAttachedToProcess;
79
80 WIN32DLLENTRY dllEntryPoint;
81
82 ULONG referenced;
83
84private:
85static Win32DllBase *head;
86 Win32DllBase *next;
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.