Hello,

I'm having problems dealing with an ENUM STRUCT.



typedef enum _TASK_TRIGGER_TYPE
{
TASK_TIME_TRIGGER_ONCE = 0,
TASK_TIME_TRIGGER_DAILY = 1,
TASK_TIME_TRIGGER_WEEKLY = 2,
TASK_TIME_TRIGGER_MONTHLYDATE = 3,
TASK_TIME_TRIGGER_MONTHLYDOW = 4,
TASK_EVENT_TRIGGER_ON_IDLE = 5,
TASK_EVENT_TRIGGER_AT_SYSTEMSTART = 6,
TASK_EVENT_TRIGGER_AT_LOGON = 7

} TASK_TRIGGER_TYPE, *PTASK_TRIGGER_TYPE;

typedef struct _TASK_TRIGGER {
WORD cbTriggerSize;
WORD Reserved1;
WORD wBeginYear;
WORD wBeginMonth;
WORD wBeginDay;
WORD wEndYear;
WORD wEndMonth;
WORD wEndDay;
WORD wStartHour;
WORD wStartMinute;
DWORD MinutesDuration;
DWORD MinutesInterval;
DWORD rgFlags;
TASK_TRIGGER_TYPE TriggerType;
TRIGGER_TYPE_UNION Type;
WORD Reserved2;
WORD wRandomMinutesInterval;
} TASK_TRIGGER, *PTASK_TRIGGER;


I know the cbTriggerSize is 52 Bytes not counting the TriggerType. I need to know the size of TriggerType and how to set it equal to TASK_TIME_TRIGGER_DAILY.

Thanks for your time and consideration,

Darrel
Posted on 2005-01-12 01:20:12 by Darrel
TASK_TRIGGER_TYPE is 4 bytes

in c:

TASK_TRIGGER_TYPE ttt = TASK_TIME_TRIGGER_DAILY;

in assembly:

TASK_TRIGGER_TYPE UNION
TASK_TIME_TRIGGER_ONCE DWORD 0
TASK_TIME_TRIGGER_DAILY DWORD 1
TASK_TIME_TRIGGER_WEEKLY DWORD 2
TASK_TIME_TRIGGER_MONTHLYDATE DWORD 3
TASK_TIME_TRIGGER_MONTHLYDOW DWORD 4
TASK_EVENT_TRIGGER_ON_IDLE DWORD 5
TASK_EVENT_TRIGGER_AT_SYSTEMSTART DWORD 6
TASK_EVENT_TRIGGER_AT_LOGON DWORD 7
TASK_TRIGGER_TYPE ENDS
PTASK_TRIGGER_TYPE TYPEDEF PTR TASK_TRIGGER_TYPE
ttt TASK_TRIGGER_TYPE <1>

or

mov EAX, 1
mov ttt.TASK_TIME_TRIGGER_DAILY, EAX
Posted on 2005-01-12 08:51:45 by roaknog
Thanks roaknog,

Darrel
Posted on 2005-01-12 13:56:08 by Darrel