forked from p-ameline/Episodus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnsm_apicr.cpp
64 lines (52 loc) · 1.3 KB
/
nsm_apicr.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <shellapi.h>
#include <owl\applicat.h>
#include <owl\window.h>
#include <owl\owlpch.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <cstring.h>
#define _MAIN
#define __MAIN
#include "ns_crypt\ns_crypt.h"
USEUNIT("apicrypt\ns_api_dll.cpp");
USELIB("nsmutil.lib");
USELIB("nsmbb.lib");
USELIB("nsmdn.lib");
USELIB("bidsvi.lib");
USELIB("owlwvi.lib");
USERES("nsm_apicr.res");
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinstDll, unsigned long fdwReason, void*)
{
switch (fdwReason)
{
case DLL_THREAD_ATTACH :
case DLL_THREAD_DETACH :
// cas des threads : on ne fait rien
break ;
case DLL_PROCESS_ATTACH :
// 1er appel : on instancie pResMod
if (NULL == pResMod)
pResMod = new TModule(0, hinstDll) ;
// si le new echoue : on renvoie false
if (NULL == pResMod)
return 0 ;
pNSDLLModule = pResMod ;
break ;
case DLL_PROCESS_DETACH :
// dernier appel : on libere pResMod
if (pResMod)
{
delete pResMod ;
pResMod = (TModule*) 0 ;
}
break ;
default :
return 0 ;
}
return 1 ;
}