🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13761

Re: Casting LPARAM to correct type

#13761
From: Remy Lebeau (TeamB)
Date: Thu, 11 Sep 2003 23:56
42 lines
2544 bytes
"Brent" <nospam@nospam.com> wrote in message
news:3f610680@newsgroups.borland.com...

> The lParam points to the address of a DEBUGHOOKINFO
> structure.  How do I get the 'data' from this structure and pass
> it onto the CallNextHookEx function?

You're not supposed to be handling WH_DEBUG that way at all.  What exactly
are you trying to accomplish by tricking the system into calling hooks
directly?

The DEBUGHOOKINFO is meant to be used for "peeking" at the data that will be
sent to the real hook which is about to be called.  That is all a WH_DEBUG
hook should be doing.  It is used for diagostics and logging purposes.  The
hook procedure is not even allowed to modify the values in the DEBUGHOOKINFO
structure.

When it comes to calling CallNextHookEx(), WH_DEBUG is still a hook like any
other.  You are supposed to be calling the next hook in the WH_DEBUG chain,
not the real hook directly.  As such, you should be passing the same HHOOK,
wParam and lParam values that were sent to your own WH_DEBUG procedure, not
the wParam and lParam that are inside of the DEBUGHOOKINFO.  In other words,
change this line:

    return CallNextHookEx(HDebugHook, hookInfo->code, hookInfo->wParam,
hookInfo->lParam);

To this instead:

    return CallNextHookEx(hHook, Code, wParam, lParam);

Where hHook is your own HHOOK for the WH_DEBUG hook itself.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
Technical Details
Message-ID: <3f610b6a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f610680@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bee5ed984338f8ea
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-11 17:01:49 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f610680@newsgroups.borland.com>
Subject: Re: Casting LPARAM to correct type
Date: Thu, 11 Sep 2003 16:56:03 -0700
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f610b6a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063324522 207.175.226.26 (11 Sep 2003 16:55:22 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail