Click here to Skip to main content
15,893,588 members
Home / Discussions / System Admin
   

System Admin

 
AnswerRe: windows 2000 password problem? Pin
Ray Cassick16-Sep-02 11:59
Ray Cassick16-Sep-02 11:59 
GeneralDiagnosing network authorization problems Pin
Jonathan Gilligan16-Sep-02 11:00
Jonathan Gilligan16-Sep-02 11:00 
GeneralI Hate DNS.... Pin
James Spibey16-Sep-02 8:46
James Spibey16-Sep-02 8:46 
GeneralRe: I Hate DNS.... Pin
markkuk16-Sep-02 11:31
markkuk16-Sep-02 11:31 
GeneralRe: I Hate DNS.... Pin
James Spibey16-Sep-02 12:41
James Spibey16-Sep-02 12:41 
GeneralRe: I Hate DNS.... Pin
Ray Cassick16-Sep-02 12:10
Ray Cassick16-Sep-02 12:10 
QuestionHow to debug a service code? Pin
Anonymous16-Sep-02 6:07
Anonymous16-Sep-02 6:07 
AnswerRe: How to debug a service code? Pin
Daniel Lohmann16-Sep-02 7:07
Daniel Lohmann16-Sep-02 7:07 
This is a programming question and should better reside in the Visual C++ forum. Hmmm | :|

Having said that, here is the solution:

#define HARDBREAK __asm int 3

void WINAPI ServiceMain( DWORD dwArgc, LPTSTR* apszArgs )
{
    ...
    HARDBREAK;
    ...
}


The above HARDBREAK macro inserts a hard-coded breakpoint into your code. (Software interrupt 3 is used for breakpoints on x86). If you run your service (via SCM) and control reaches this possition a "Unhandled exception" message box of windows will appear. Choose cancle to debug your app and - voila you will find yourself in the debugger with the app halted as exactly this position. From there you could single-step, insert watches, etc.

Please post any F-ups to this to the Visual C++ Forum Cool | :cool:

--

Daniel Lohmann

http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there Big Grin | :-D )
GeneralHD Temp Pin
Matt Newman14-Sep-02 5:57
Matt Newman14-Sep-02 5:57 
GeneralRe: HD Temp Pin
Pavel Klocek14-Sep-02 6:34
Pavel Klocek14-Sep-02 6:34 
GeneralRe: HD Temp Pin
Matt Newman14-Sep-02 7:46
Matt Newman14-Sep-02 7:46 
GeneralRe: HD Temp Pin
Bruce Duncan15-Sep-02 9:26
Bruce Duncan15-Sep-02 9:26 
GeneralRe: HD Temp Pin
Bruce Duncan15-Sep-02 9:34
Bruce Duncan15-Sep-02 9:34 
GeneralRe: HD Temp Pin
Matt Newman15-Sep-02 13:13
Matt Newman15-Sep-02 13:13 
GeneralRe: HD Temp Pin
markkuk15-Sep-02 12:45
markkuk15-Sep-02 12:45 
GeneralStatus Bars and XP Pin
Jon Sagara13-Sep-02 12:43
Jon Sagara13-Sep-02 12:43 
GeneralRe: Status Bars and XP Pin
Jon Sagara13-Sep-02 12:48
Jon Sagara13-Sep-02 12:48 
GeneralOutlook Express 6 and XP SP1 Pin
Sean Cundiff12-Sep-02 7:51
Sean Cundiff12-Sep-02 7:51 
GeneralRe: Outlook Express 6 and XP SP1 Pin
Richard Deeming4-Oct-02 2:37
mveRichard Deeming4-Oct-02 2:37 
GeneralRe: Outlook Express 6 and XP SP1 Pin
Richard Deeming12-Nov-02 5:15
mveRichard Deeming12-Nov-02 5:15 
GeneralRe: Outlook Express 6 and XP SP1 Pin
Sean Cundiff12-Nov-02 7:47
Sean Cundiff12-Nov-02 7:47 
GeneralProcess handles Pin
Jacques Buitendag11-Sep-02 0:34
Jacques Buitendag11-Sep-02 0:34 
GeneralXP: Personal Web Server Pin
peterchen9-Sep-02 5:02
peterchen9-Sep-02 5:02 
GeneralWindows XP Service Pack 1 & Internet Explorer URL Problem Pin
Paul Watson8-Sep-02 23:52
sitebuilderPaul Watson8-Sep-02 23:52 
GeneralRe: Windows XP Service Pack 1 & Internet Explorer URL Problem Pin
Richard Deeming24-Sep-02 7:05
mveRichard Deeming24-Sep-02 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.