Question About Example code, GlobalC

B

bellparis

I'm a student who tries to use EliCZ's hooking library, AE5.6.

My ultimate purpose which I try to use EliCZ's library is preventing
users from copying data by windows clipboard.

So I Added this code to EliCZ's file 'GlobalCDLL.cpp'.

typedef HANDLE (WINAPI *TGetClipboardData)(UINT);
BYTE GetClipboardDataSpace[32];
TGetClipboardData OldGetClipboardData =
(TGetClipboardData)&GetClipboardDataSpace;

HANDLE WINAPI NewGetClipboardData(UINT uFormat)
{
if ("Do I Must Prevent this copy work?")
{
OutputDebugString(_T("[GlobalC]NewGetClipboardData"));
::EmptyClipboard();
}

return OldGetClipboardData(uFormat);
}

Of course, I Added API_HOOK struct of "GetClipboardData" to hookchain.
Like This....
{"USER32.DLL", "GetClipboardData", HOOK_OVERWRITE | HOOK_HARD,
&OldGetClipboardData,&UnhookGetClipboardData,
NewGetClipboardData}

This module works very well for Windows2k, WindowsXP....
However, That doesn't work for Windows98.
In Windows98, all modules in system are broken out.

Originally, isn't GlobarC.dll for Windows9x?

Has anybody ever used EliCZ's library for Windows9x OS?
Has anybody ever succeeded in hooking APIs in Windows9x OS?

If you can answer to my question, please give your opinion to me.

Thank you for Reading.
 
J

Joona I Palaste

bellparis said:
I'm a student who tries to use EliCZ's hooking library, AE5.6.
My ultimate purpose which I try to use EliCZ's library is preventing
users from copying data by windows clipboard.
So I Added this code to EliCZ's file 'GlobalCDLL.cpp'.

Hold it, hold it...
typedef HANDLE (WINAPI *TGetClipboardData)(UINT);
BYTE GetClipboardDataSpace[32];
TGetClipboardData OldGetClipboardData =
(TGetClipboardData)&GetClipboardDataSpace;
HANDLE WINAPI NewGetClipboardData(UINT uFormat)
{
if ("Do I Must Prevent this copy work?")
{
OutputDebugString(_T("[GlobalC]NewGetClipboardData"));
::EmptyClipboard();

No valid C program can ever contain a :: outside a string literal
or a comment. You're off-topic here.
 
M

Martin Ambuhl

bellparis said:
I'm a student who tries to use EliCZ's hooking library, AE5.6.

Even though the program language C has nothing about "hooking," I continue
in the hope that your problem might be about C ...
My ultimate purpose which I try to use EliCZ's library is preventing
users from copying data by windows clipboard.

It gets scarier: windows questions tend not to be about C ...
So I Added this code to EliCZ's file 'GlobalCDLL.cpp'.

Oh, no! The ".cpp" extension strongly suggests that your question is not
about C (as does the occurrence of the cursed string "DLL"). Still, it is
possible that your question is really about C ...
typedef HANDLE (WINAPI *TGetClipboardData)(UINT);
BYTE GetClipboardDataSpace[32];
TGetClipboardData OldGetClipboardData =
(TGetClipboardData)&GetClipboardDataSpace;

HANDLE WINAPI NewGetClipboardData(UINT uFormat)
{
if ("Do I Must Prevent this copy work?")
{
OutputDebugString(_T("[GlobalC]NewGetClipboardData"));
::EmptyClipboard();
}

Ack! NAK! Not only are the identifiers 'HANDLE', 'WINAPI', 'UINT', 'BYTE',
and '_T' completely unknown in C, and the '_T' suspect on other grounds,
but the meaningless '::' marks this as being written in some obfuscating
language that definitely is *not* C. I fear that you are lost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top