2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afs/param.h>
18 #include <WINNT/afsreg.h>
19 #include <WINNT/afsevent.h>
21 int main(int argc
, char **argv
)
23 HKEY applogKey
, afslogKey
;
26 /* Determine if registry is (likely to be) configured */
28 status
= RegOpenKeyAlt(AFSREG_NULL_KEY
, AFSREG_APPLOG_KEY
,
29 KEY_READ
, 0, &applogKey
, NULL
);
31 if (status
== ERROR_SUCCESS
) {
32 status
= RegOpenKeyAlt(applogKey
, AFSREG_SVR_APPLOG_SUBKEY
,
33 KEY_READ
, 0, &afslogKey
, NULL
);
35 if (status
== ERROR_SUCCESS
) {
36 (void) RegCloseKey(afslogKey
);
39 (void) RegCloseKey(applogKey
);
42 if (status
!= ERROR_SUCCESS
) {
43 printf("\n%s: expected event source %s not found in registry; "
44 "test not run.\n", argv
[0], AFSREG_SVR_APPLOG_SUBKEY
);
48 /* Log test message w/o any insertion strings */
50 printf("Logging server INFORMATION event (0 insert strings)\n");
51 if (ReportInformationEventAlt(AFSEVT_SVR_TEST_MSG_NOARGS
, 0)) {
52 printf("\n%s: logging failed\n", argv
[0]);
56 printf("Logging server WARNING event (0 insert strings, status 0)\n");
57 if (ReportWarningEventAlt(AFSEVT_SVR_TEST_MSG_NOARGS
, 0, 0)) {
58 printf("\n%s: logging failed\n", argv
[0]);
62 printf("Logging server ERROR event (0 insert strings, status 15)\n");
63 if (ReportErrorEventAlt(AFSEVT_SVR_TEST_MSG_NOARGS
, 15, 0)) {
64 printf("\n%s: logging failed\n", argv
[0]);
68 /* Log test message with two insertion strings */
70 printf("Logging server INFORMATION event (2 insert strings)\n");
71 if (ReportInformationEventAlt(AFSEVT_SVR_TEST_MSG_TWOARGS
,
72 "Insert string 1", "Insert String 2", 0)) {
73 printf("\n%s: logging failed\n", argv
[0]);
77 printf("Logging server WARNING event (2 insert strings, status 0)\n");
78 if (ReportWarningEventAlt(AFSEVT_SVR_TEST_MSG_TWOARGS
, 0,
79 "Insert string 1", "Insert String 2", 0)) {
80 printf("\n%s: logging failed\n", argv
[0]);
84 printf("Logging server ERROR event (2 insert strings, status 15)\n");
85 if (ReportErrorEventAlt(AFSEVT_SVR_TEST_MSG_TWOARGS
, 15,
86 "Insert string 1", "Insert String 2", 0)) {
87 printf("\n%s: logging failed\n", argv
[0]);