Artifact 0107aad9ea7103aa1c48c20761cc2d0ab5a4c06f:
0000: 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a /***************
0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0040: 2a 2a 2a 2a 2a 2a 2a 2a 5c 0a 2a 20 20 20 20 20 ********\.*
0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0060: 20 20 20 20 20 20 20 20 20 20 20 6c 6d 61 74 2e lmat.
0070: 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d
0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0090: 20 20 2a 0a 2a 20 20 20 20 20 20 20 20 20 20 20 *.*
00a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00d0: 20 20 20 20 20 20 20 20 20 20 20 20 2a 0a 2a 20 *.*
00e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00f0: 20 20 20 20 20 20 57 69 6e 64 6f 77 73 20 41 50 Windows AP
0100: 49 20 68 65 61 64 65 72 20 6d 6f 64 75 6c 65 20 I header module
0110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0120: 20 20 20 20 20 20 2a 0a 2a 20 20 20 20 20 20 20 *.*
0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0170: 2a 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 *.*
0180: 20 20 20 20 54 72 61 6e 73 6c 61 74 65 64 20 66 Translated f
0190: 72 6f 6d 20 4d 69 6e 47 57 20 57 69 6e 64 6f 77 rom MinGW Window
01a0: 73 20 68 65 61 64 65 72 73 20 20 20 20 20 20 20 s headers
01b0: 20 20 20 20 20 20 20 20 20 20 2a 0a 2a 20 20 20 *.*
01c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
01d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
01e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0200: 20 20 20 20 2a 0a 2a 20 20 20 20 20 20 20 20 20 *.*
0210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 6c Pl
0220: 61 63 65 64 20 69 6e 74 6f 20 70 75 62 6c 69 63 aced into public
0230: 20 64 6f 6d 61 69 6e 20 20 20 20 20 20 20 20 20 domain
0240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 0a *.
0250: 5c 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a \***************
0260: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0270: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0280: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0290: 2a 2a 2a 2a 2a 2a 2a 2a 2f 0a 6d 6f 64 75 6c 65 ********/.module
02a0: 20 77 69 6e 33 32 2e 6c 6d 61 74 3b 0a 70 72 61 win32.lmat;.pra
02b0: 67 6d 61 28 6c 69 62 2c 20 22 6e 65 74 61 70 69 gma(lib, "netapi
02c0: 33 32 2e 6c 69 62 22 29 3b 0a 0a 70 72 69 76 61 32.lib");..priva
02d0: 74 65 20 69 6d 70 6f 72 74 20 77 69 6e 33 32 2e te import win32.
02e0: 6c 6d 63 6f 6e 73 2c 20 77 69 6e 33 32 2e 77 69 lmcons, win32.wi
02f0: 6e 64 65 66 3b 0a 0a 63 6f 6e 73 74 20 4a 4f 42 ndef;..const JOB
0300: 5f 52 55 4e 5f 50 45 52 49 4f 44 49 43 41 4c 4c _RUN_PERIODICALL
0310: 59 20 3d 20 31 3b 0a 63 6f 6e 73 74 20 4a 4f 42 Y = 1;.const JOB
0320: 5f 45 58 45 43 5f 45 52 52 4f 52 20 20 20 20 20 _EXEC_ERROR
0330: 20 20 3d 20 32 3b 0a 63 6f 6e 73 74 20 4a 4f 42 = 2;.const JOB
0340: 5f 52 55 4e 53 5f 54 4f 44 41 59 20 20 20 20 20 _RUNS_TODAY
0350: 20 20 3d 20 34 3b 0a 63 6f 6e 73 74 20 4a 4f 42 = 4;.const JOB
0360: 5f 41 44 44 5f 43 55 52 52 45 4e 54 5f 44 41 54 _ADD_CURRENT_DAT
0370: 45 20 3d 20 38 3b 0a 63 6f 6e 73 74 20 4a 4f 42 E = 8;.const JOB
0380: 5f 4e 4f 4e 49 4e 54 45 52 41 43 54 49 56 45 20 _NONINTERACTIVE
0390: 20 20 3d 20 31 36 3b 0a 63 6f 6e 73 74 20 4a 4f = 16;.const JO
03a0: 42 5f 49 4e 50 55 54 5f 46 4c 41 47 53 20 20 20 B_INPUT_FLAGS
03b0: 20 20 20 3d 20 4a 4f 42 5f 52 55 4e 5f 50 45 52 = JOB_RUN_PER
03c0: 49 4f 44 49 43 41 4c 4c 59 20 7c 20 4a 4f 42 5f IODICALLY | JOB_
03d0: 41 44 44 5f 43 55 52 52 45 4e 54 5f 44 41 54 45 ADD_CURRENT_DATE
03e0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
03f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 20 |
0400: 4a 4f 42 5f 4e 4f 4e 49 4e 54 45 52 41 43 54 49 JOB_NONINTERACTI
0410: 56 45 3b 0a 63 6f 6e 73 74 20 4a 4f 42 5f 4f 55 VE;.const JOB_OU
0420: 54 50 55 54 5f 46 4c 41 47 53 20 20 20 20 20 3d TPUT_FLAGS =
0430: 20 4a 4f 42 5f 52 55 4e 5f 50 45 52 49 4f 44 49 JOB_RUN_PERIODI
0440: 43 41 4c 4c 59 20 7c 20 4a 4f 42 5f 45 58 45 43 CALLY | JOB_EXEC
0450: 5f 45 52 52 4f 52 0a 20 20 20 20 20 20 20 20 20 _ERROR.
0460: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0470: 20 20 20 20 7c 20 4a 4f 42 5f 52 55 4e 53 5f 54 | JOB_RUNS_T
0480: 4f 44 41 59 20 7c 20 4a 4f 42 5f 4e 4f 4e 49 4e ODAY | JOB_NONIN
0490: 54 45 52 41 43 54 49 56 45 3b 0a 0a 73 74 72 75 TERACTIVE;..stru
04a0: 63 74 20 41 54 5f 45 4e 55 4d 20 7b 0a 09 44 57 ct AT_ENUM {..DW
04b0: 4f 52 44 20 4a 6f 62 49 64 3b 0a 09 44 57 4f 52 ORD JobId;..DWOR
04c0: 44 20 4a 6f 62 54 69 6d 65 3b 0a 09 44 57 4f 52 D JobTime;..DWOR
04d0: 44 20 44 61 79 73 4f 66 4d 6f 6e 74 68 3b 0a 09 D DaysOfMonth;..
04e0: 55 43 48 41 52 20 44 61 79 73 4f 66 57 65 65 6b UCHAR DaysOfWeek
04f0: 3b 0a 09 55 43 48 41 52 20 46 6c 61 67 73 3b 0a ;..UCHAR Flags;.
0500: 09 4c 50 57 53 54 52 20 43 6f 6d 6d 61 6e 64 3b .LPWSTR Command;
0510: 0a 7d 0a 61 6c 69 61 73 20 41 54 5f 45 4e 55 4d .}.alias AT_ENUM
0520: 2a 20 50 41 54 5f 45 4e 55 4d 2c 20 4c 50 41 54 * PAT_ENUM, LPAT
0530: 5f 45 4e 55 4d 3b 0a 0a 73 74 72 75 63 74 20 41 _ENUM;..struct A
0540: 54 5f 49 4e 46 4f 20 7b 0a 09 44 57 4f 52 44 20 T_INFO {..DWORD
0550: 4a 6f 62 54 69 6d 65 3b 0a 09 44 57 4f 52 44 20 JobTime;..DWORD
0560: 44 61 79 73 4f 66 4d 6f 6e 74 68 3b 0a 09 55 43 DaysOfMonth;..UC
0570: 48 41 52 20 44 61 79 73 4f 66 57 65 65 6b 3b 0a HAR DaysOfWeek;.
0580: 09 55 43 48 41 52 20 46 6c 61 67 73 3b 0a 09 4c .UCHAR Flags;..L
0590: 50 57 53 54 52 20 43 6f 6d 6d 61 6e 64 3b 0a 7d PWSTR Command;.}
05a0: 0a 61 6c 69 61 73 20 41 54 5f 49 4e 46 4f 2a 20 .alias AT_INFO*
05b0: 50 41 54 5f 49 4e 46 4f 2c 20 4c 50 41 54 5f 49 PAT_INFO, LPAT_I
05c0: 4e 46 4f 3b 0a 0a 65 78 74 65 72 6e 20 28 57 69 NFO;..extern (Wi
05d0: 6e 64 6f 77 73 29 20 7b 0a 09 4e 45 54 5f 41 50 ndows) {..NET_AP
05e0: 49 5f 53 54 41 54 55 53 20 4e 65 74 53 63 68 65 I_STATUS NetSche
05f0: 64 75 6c 65 4a 6f 62 41 64 64 28 4c 50 57 53 54 duleJobAdd(LPWST
0600: 52 2c 20 50 42 59 54 45 2c 20 4c 50 44 57 4f 52 R, PBYTE, LPDWOR
0610: 44 29 3b 0a 09 4e 45 54 5f 41 50 49 5f 53 54 41 D);..NET_API_STA
0620: 54 55 53 20 4e 65 74 53 63 68 65 64 75 6c 65 4a TUS NetScheduleJ
0630: 6f 62 44 65 6c 28 4c 50 57 53 54 52 2c 20 44 57 obDel(LPWSTR, DW
0640: 4f 52 44 2c 20 44 57 4f 52 44 29 3b 0a 09 4e 45 ORD, DWORD);..NE
0650: 54 5f 41 50 49 5f 53 54 41 54 55 53 20 4e 65 74 T_API_STATUS Net
0660: 53 63 68 65 64 75 6c 65 4a 6f 62 45 6e 75 6d 28 ScheduleJobEnum(
0670: 4c 50 57 53 54 52 2c 20 50 42 59 54 45 2a 2c 20 LPWSTR, PBYTE*,
0680: 44 57 4f 52 44 2c 20 50 44 57 4f 52 44 2c 20 50 DWORD, PDWORD, P
0690: 44 57 4f 52 44 2c 0a 09 20 20 50 44 57 4f 52 44 DWORD,.. PDWORD
06a0: 29 3b 0a 09 4e 45 54 5f 41 50 49 5f 53 54 41 54 );..NET_API_STAT
06b0: 55 53 20 4e 65 74 53 63 68 65 64 75 6c 65 4a 6f US NetScheduleJo
06c0: 62 47 65 74 49 6e 66 6f 28 4c 50 57 53 54 52 2c bGetInfo(LPWSTR,
06d0: 20 44 57 4f 52 44 2c 20 50 42 59 54 45 2a 29 3b DWORD, PBYTE*);
06e0: 0a 7d 0a .}.