source: trunk/src/avifil32/initavifil32.cpp@ 8045

Last change on this file since 8045 was 6652, checked in by bird, 24 years ago

Added $Id:$ keyword.

File size: 3.3 KB
Line 
1/* $Id: initavifil32.cpp,v 1.2 2001-09-05 14:16:45 bird Exp $ */
2/*
3 * WINMM DLL entry point
4 *
5 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
6 * Copyright 1998 Peter Fitzsimmons
7 * Copyright 2000 Chris Wohlgemuth
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13
14/*-------------------------------------------------------------*/
15/* INITERM.C -- Source for a custom dynamic link library */
16/* initialization and termination (_DLL_InitTerm) */
17/* function. */
18/* */
19/* When called to perform initialization, this sample function */
20/* gets storage for an array of integers, and initializes its */
21/* elements with random integers. At termination time, it */
22/* frees the array. Substitute your own special processing. */
23/*-------------------------------------------------------------*/
24
25
26/* Include files */
27#define INCL_DOSMODULEMGR
28#define INCL_DOSPROCESS
29#define INCL_DOSSEMAPHORES
30#include <os2wrap.h> //Odin32 OS/2 api wrappers
31#include <stdlib.h>
32#include <stdio.h>
33#include <string.h>
34#include <builtin.h>
35#include <misc.h> /*PLF Wed 98-03-18 23:19:26*/
36#include <odin.h>
37#include <win32type.h>
38#include <winconst.h>
39#include <odinlx.h>
40#include <initdll.h>
41
42extern "C" {
43 //Win32 resource table (produced by wrc)
44 extern DWORD _Resource_PEResTab;
45}
46static HMODULE dllHandle = 0;
47
48BOOL WINAPI AVIFILE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved );
49
50/****************************************************************************/
51/* _DLL_InitTerm is the function that gets called by the operating system */
52/* loader when it loads and frees this DLL for each process that accesses */
53/* this DLL. However, it only gets called the first time the DLL is loaded */
54/* and the last time it is freed for a particular process. The system */
55/* linkage convention MUST be used because the operating system loader is */
56/* calling this function. */
57/****************************************************************************/
58ULONG APIENTRY inittermAvifil32(ULONG hModule, ULONG ulFlag)
59{
60 /*-------------------------------------------------------------------------*/
61 /* If ulFlag is zero then the DLL is being loaded so initialization should */
62 /* be performed. If ulFlag is 1 then the DLL is being freed so */
63 /* termination should be performed. */
64 /*-------------------------------------------------------------------------*/
65
66 switch (ulFlag)
67 {
68 case 0 :
69 dllHandle = RegisterLxDll(hModule, AVIFILE_DllMain, (PVOID)&_Resource_PEResTab);
70 if(dllHandle == 0)
71 return 0UL;/* Error */
72
73 break;
74 case 1 :
75 if(dllHandle) {
76 UnregisterLxDll(dllHandle);
77 }
78 break;
79 default :
80 return 0UL;
81 }
82
83 /***********************************************************/
84 /* A non-zero value must be returned to indicate success. */
85 /***********************************************************/
86 return 1UL;
87}
88//******************************************************************************
89//******************************************************************************
90
91
92
Note: See TracBrowser for help on using the repository browser.