summaryrefslogtreecommitdiff
path: root/protocols/LotusNotify/src/lotusnotes.cpp
blob: adc60a7bdf01069d9807dc8333bb2ba2fee7b717 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "stdafx.h"
#include "lotusnotes.h"

OSPATHNETCONSTRUCT OSPathNetConstruct1;
NOTESINITEXTENDED NotesInitExtended1;
NSFDBOPEN NSFDbOpen1;
SECKFMGETUSERNAME SECKFMGetUserName1;
NSFDBGETUNREADNOTETABLE NSFDbGetUnreadNoteTable1;
NSFDBUPDATEUNREAD NSFDbUpdateUnread1;
IDSCAN IDScan1;
NSFNOTEOPEN NSFNoteOpen1;
NSFDBGETNOTEINFO NSFDbGetNoteInfo1;
NSFITEMGETTEXT NSFItemGetText1;
NSFITEMGETTIME NSFItemGetTime1;
CONVERTTIMEDATETOTEXT ConvertTIMEDATEToText1;
OSTRANSLATE OSTranslate1;
MAILGETMESSAGEATTACHMENTINFO MailGetMessageAttachmentInfo1;
NSFNOTECLOSE NSFNoteClose1;
IDDESTROYTABLE IDDestroyTable1;
NSFDBCLOSE NSFDbClose1;
OSLOADSTRING OSLoadString1;
NOTESTERM NotesTerm1;
OSGETENVIRONMENTSTRING OSGetEnvironmentString1;
OSSETENVIRONMENTVARIABLE OSSetEnvironmentVariable1;
NSGETSERVERLIST NSGetServerList1;
OSLOCKOBJECT OSLockObject1;
OSUNLOCKOBJECT OSUnlockObject1;
OSMEMFREE OSMemFree1;
EMREGISTER EMRegister1;
EMDEREGISTER EMDeregister1;
NOTESINITTHREAD NotesInitThread1;
NOTESTERMTHREAD NotesTermThread1;

BOOL HookLotusFunctions()
{
	return (
		   (OSPathNetConstruct1 = (OSPATHNETCONSTRUCT)GetProcAddress(hLotusDll, "OSPathNetConstruct"))
		&& (NotesInitExtended1 = (NOTESINITEXTENDED)GetProcAddress(hLotusDll, "NotesInitExtended"))
		&& (NSFDbOpen1 = (NSFDBOPEN)GetProcAddress(hLotusDll, "NSFDbOpen"))
		&& (SECKFMGetUserName1 = (SECKFMGETUSERNAME)GetProcAddress(hLotusDll, "SECKFMGetUserName"))
		&& (NSFDbGetUnreadNoteTable1 = (NSFDBGETUNREADNOTETABLE)GetProcAddress(hLotusDll, "NSFDbGetUnreadNoteTable"))
		&& (NSFDbUpdateUnread1 = (NSFDBUPDATEUNREAD)GetProcAddress(hLotusDll, "NSFDbUpdateUnread"))
		&& (IDScan1 = (IDSCAN)GetProcAddress(hLotusDll, "IDScan"))
		&& (NSFNoteOpen1 = (NSFNOTEOPEN)GetProcAddress(hLotusDll, "NSFNoteOpen"))
		&& (NSFDbGetNoteInfo1 = (NSFDBGETNOTEINFO)GetProcAddress(hLotusDll, "NSFDbGetNoteInfo"))
		&& (NSFItemGetText1 = (NSFITEMGETTEXT)GetProcAddress(hLotusDll, "NSFItemGetText"))
		&& (NSFItemGetTime1 = (NSFITEMGETTIME)GetProcAddress(hLotusDll, "NSFItemGetTime"))
		&& (ConvertTIMEDATEToText1 = (CONVERTTIMEDATETOTEXT)GetProcAddress(hLotusDll, "ConvertTIMEDATEToText"))
		&& (OSTranslate1 = (OSTRANSLATE)GetProcAddress(hLotusDll, "OSTranslate"))
		&& (MailGetMessageAttachmentInfo1 = (MAILGETMESSAGEATTACHMENTINFO)GetProcAddress(hLotusDll, "MailGetMessageAttachmentInfo"))
		&& (NSFNoteClose1 = (NSFNOTECLOSE)GetProcAddress(hLotusDll, "NSFNoteClose"))
		&& (IDDestroyTable1 = (IDDESTROYTABLE)GetProcAddress(hLotusDll, "IDDestroyTable"))
		&& (NSFDbClose1 = (NSFDBCLOSE)GetProcAddress(hLotusDll, "NSFDbClose"))
		&& (OSLoadString1 = (OSLOADSTRING)GetProcAddress(hLotusDll, "OSLoadString"))
		&& (NotesTerm1 = (NOTESTERM)GetProcAddress(hLotusDll, "NotesTerm"))
		&& (OSGetEnvironmentString1 = (OSGETENVIRONMENTSTRING)GetProcAddress(hLotusDll, "OSGetEnvironmentString"))
		&& (OSSetEnvironmentVariable1 = (OSSETENVIRONMENTVARIABLE)GetProcAddress(hLotusDll, "OSSetEnvironmentVariable"))
		&& (NSGetServerList1 = (NSGETSERVERLIST)GetProcAddress(hLotusDll, "NSGetServerList"))
		&& (OSLockObject1 = (OSLOCKOBJECT)GetProcAddress(hLotusDll, "OSLockObject"))
		&& (OSUnlockObject1 = (OSUNLOCKOBJECT)GetProcAddress(hLotusDll, "OSUnlockObject"))
		&& (OSMemFree1 = (OSMEMFREE)GetProcAddress(hLotusDll, "OSMemFree"))
		&& (EMRegister1 = (EMREGISTER)GetProcAddress(hLotusDll, "EMRegister"))
		&& (EMDeregister1 = (EMDEREGISTER)GetProcAddress(hLotusDll, "EMDeregister"))
		&& (NotesInitThread1 = (NOTESINITTHREAD)GetProcAddress(hLotusDll, "NotesInitThread"))
		&& (NotesTermThread1 = (NOTESTERMTHREAD)GetProcAddress(hLotusDll, "NotesTermThread"))
	) ? TRUE : FALSE;
}

void GetLotusPath(wchar_t *sTemp, DWORD size)
{
	DWORD rc; 
	HKEY dmKey;

	rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE , TEXT("Software\\Lotus\\Notes") ,0, KEY_QUERY_VALUE, &dmKey ); 

	if (rc != ERROR_SUCCESS) { 
		return; 
	} 

	RegQueryValueEx( dmKey, TEXT("Path"), nullptr, nullptr, (BYTE*)sTemp, &size );
	RegCloseKey(dmKey);
	return;	
}