#include #include #include #include #include #include #include #include #include /* triml */ #define TRUE 0 #define FALSE -1 typedef struct { int BYTESPRO; int BYTESAVL; char MSGID[7]; char RESRVD; char EXCPDATA[100]; } ERRSTRUCTURE; /* Define the error return structure */ ERRSTRUCTURE errcode;/* Error Code Structure for RCVMSG */ _TE_ERROR_CODE_T errorCode; volatile _INTRPT_Hndlr_Parms_T ca; typedef struct { Qmh_Rcvpm_RCVM0300_t rcvm0300; char Msg[5000]; } RCVM0300; RCVM0300 rcvm0300; typedef struct { Qmh_Rcvpm_Sender_t sender; char procinfo[1024]; } SENDER; SENDER sender; int IsDebugMode(void); void main(void){ #pragma exception_handler(MONMSG, ca, 0, _C2_MH_ESCAPE, \ _CTLA_HANDLE) printf("** TESTDBG : デバッグ・モードの検出 **\n"); getchar(); if(IsDebugMode() == TRUE) printf("on Debug Mode\n"); else printf("Release Mode\n"); getchar(); exit(0); MONMSG: #pragma disable_handler return; } /********************/ int IsDebugMode(void) /********************/ { char attr[10]; errorCode.BytesProvided = sizeof(errorCode); errorCode.BytesAvailable = 0; QteRetrieveDebugAttribute("*DEBUGJOB ", attr, &errorCode); if(errorCode.BytesAvailable != 0){/* APIERR */ if(strncmp(errorCode.ExceptionID, "CPF9541", 7) == 0) return FALSE; else return TRUE; }/* APIERR */ else return TRUE; }