| 1 | /* $Id: errorlog.cpp,v 1.1 2000-12-12 02:43:25 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | *
|
|---|
| 5 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 6 | *
|
|---|
| 7 | *
|
|---|
| 8 | * NETAPI32 stubs
|
|---|
| 9 | *
|
|---|
| 10 | * Copyright 2000 Patrick Haller
|
|---|
| 11 | *
|
|---|
| 12 | * Note: functions that return structures/buffers seem to append strings
|
|---|
| 13 | * at the end of the buffer. Currently, we just allocate the strings
|
|---|
| 14 | * "normally". Therefore a caller that just does a NetApiBufferFree() on the
|
|---|
| 15 | * returned buffer will leak all allocated strings.
|
|---|
| 16 | *
|
|---|
| 17 | */
|
|---|
| 18 | /*****************************************************************************
|
|---|
| 19 | * Name : ERRORLOG.CPP
|
|---|
| 20 | * Purpose : This module maps all Win32 functions contained in NETAPI32.DLL
|
|---|
| 21 | * to their OS/2-specific counterparts as far as possible.
|
|---|
| 22 | * Basis is 5.05.97 12.00 59152 MPR.DLL (NT4SP3)
|
|---|
| 23 | *****************************************************************************/
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | /****************************************************************************
|
|---|
| 27 | * Includes *
|
|---|
| 28 | ****************************************************************************/
|
|---|
| 29 |
|
|---|
| 30 | #include <odin.h>
|
|---|
| 31 | #include <odinwrap.h>
|
|---|
| 32 | #include <os2win.h>
|
|---|
| 33 | #include <misc.h>
|
|---|
| 34 | #include <heapstring.h>
|
|---|
| 35 | #include <string.h>
|
|---|
| 36 |
|
|---|
| 37 | #include "oslibnet.h"
|
|---|
| 38 | #include "lanman.h"
|
|---|
| 39 |
|
|---|
| 40 | ODINDEBUGCHANNEL(WNETAP32-ERRORLOG)
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | /****************************************************************************
|
|---|
| 44 | * Module Global Variables *
|
|---|
| 45 | ****************************************************************************/
|
|---|
| 46 |
|
|---|
| 47 | #define NERR_OK 0
|
|---|
| 48 | #define NERR_BASE 1 /* @@@PH DUMMY ! */
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | #undef NET_API_STATUS
|
|---|
| 52 | #define NET_API_STATUS DWORD
|
|---|
| 53 |
|
|---|
| 54 | typedef unsigned long LPHLOG;
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | /*****************************************************************************
|
|---|
| 58 | * Name : NET_API_STATUS NetAuditClear
|
|---|
| 59 | * Purpose : clears the audit log on a server and, optionally, saves the
|
|---|
| 60 | * entrie sin a backup file
|
|---|
| 61 | * Parameters: LPWSTR lpServerName
|
|---|
| 62 | * LPWSTR lpBackupFile
|
|---|
| 63 | * LPWSTR lpService
|
|---|
| 64 | * Variables :
|
|---|
| 65 | * Result :
|
|---|
| 66 | * Remark :
|
|---|
| 67 | * Status : UNTESTED STUB
|
|---|
| 68 | *
|
|---|
| 69 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 70 | *****************************************************************************/
|
|---|
| 71 |
|
|---|
| 72 | ODINFUNCTION3(NET_API_STATUS,OS2NetAuditClear,LPWSTR, lpServerName,
|
|---|
| 73 | LPWSTR, lpBackupFile,
|
|---|
| 74 | LPWSTR, lpService)
|
|---|
| 75 | {
|
|---|
| 76 | dprintf(("NETAPI32: NetAuditClear not implemented\n"));
|
|---|
| 77 |
|
|---|
| 78 | return (NERR_BASE);
|
|---|
| 79 | }
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | /*****************************************************************************
|
|---|
| 83 | * Name : NET_API_STATUS NetAuditRead
|
|---|
| 84 | * Purpose : reads from the audit log on a server
|
|---|
| 85 | * Parameters: LPWSTR lpServerName
|
|---|
| 86 | * LPWSTR lpService
|
|---|
| 87 | * LPHLOG auditloghandle
|
|---|
| 88 | * DWORD offset
|
|---|
| 89 | * LPDWORD reserved1
|
|---|
| 90 | * DWORD reserved2
|
|---|
| 91 | * DWORD offsetflag
|
|---|
| 92 | * LPBYTE* bufptr
|
|---|
| 93 | * DWORD prefmaxlen
|
|---|
| 94 | * LPDWORD bytesread
|
|---|
| 95 | * LPDWORD totalavailable
|
|---|
| 96 | * Variables :
|
|---|
| 97 | * Result :
|
|---|
| 98 | * Remark :
|
|---|
| 99 | * Status : UNTESTED STUB
|
|---|
| 100 | *
|
|---|
| 101 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 102 | *****************************************************************************/
|
|---|
| 103 |
|
|---|
| 104 | typedef unsigned long LPHLOG;
|
|---|
| 105 | ODINFUNCTION11(NET_API_STATUS,OS2NetAuditRead,LPWSTR, lpServerName,
|
|---|
| 106 | LPWSTR, lpService,
|
|---|
| 107 | LPHLOG, auditloghandle,
|
|---|
| 108 | DWORD, offset,
|
|---|
| 109 | LPDWORD, reserved1,
|
|---|
| 110 | DWORD, reserved2,
|
|---|
| 111 | DWORD, offsetflag,
|
|---|
| 112 | LPBYTE*, bufptr,
|
|---|
| 113 | DWORD, prefmaxlen,
|
|---|
| 114 | LPDWORD, bytesread,
|
|---|
| 115 | LPDWORD, totalavailable)
|
|---|
| 116 | {
|
|---|
| 117 | dprintf(("NETAPI32: NetAuditRead not implemented\n"));
|
|---|
| 118 |
|
|---|
| 119 | return (NERR_BASE);
|
|---|
| 120 | }
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 | /*****************************************************************************
|
|---|
| 124 | * Name : NET_API_STATUS NetAuditWrite
|
|---|
| 125 | * Purpose : write to the audit log on a server
|
|---|
| 126 | * Parameters: LPWSTR lpServerName
|
|---|
| 127 | * LPWSTR lpService
|
|---|
| 128 | * LPHLOG auditloghandle
|
|---|
| 129 | * DWORD offset
|
|---|
| 130 | * LPDWORD reserved1
|
|---|
| 131 | * DWORD reserved2
|
|---|
| 132 | * DWORD offsetflag
|
|---|
| 133 | * LPBYTE* bufptr
|
|---|
| 134 | * DWORD prefmaxlen
|
|---|
| 135 | * LPDWORD bytesread
|
|---|
| 136 | * LPDWORD totalavailable
|
|---|
| 137 | * Variables :
|
|---|
| 138 | * Result : wrong
|
|---|
| 139 | * Remark :
|
|---|
| 140 | * Status : UNTESTED STUB
|
|---|
| 141 | *
|
|---|
| 142 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 143 | *****************************************************************************/
|
|---|
| 144 |
|
|---|
| 145 | ODINFUNCTION11(NET_API_STATUS,OS2NetAuditWrite,LPWSTR, lpServerName,
|
|---|
| 146 | LPWSTR, lpService,
|
|---|
| 147 | LPHLOG, auditloghandle,
|
|---|
| 148 | DWORD, offset,
|
|---|
| 149 | LPDWORD, reserved1,
|
|---|
| 150 | DWORD, reserved2,
|
|---|
| 151 | DWORD, offsetflag,
|
|---|
| 152 | LPBYTE*, bufptr,
|
|---|
| 153 | DWORD, prefmaxlen,
|
|---|
| 154 | LPDWORD, byteswritten,
|
|---|
| 155 | LPDWORD, totalavailable)
|
|---|
| 156 | {
|
|---|
| 157 | dprintf(("NETAPI32: NetAuditWrite not implemented\n"));
|
|---|
| 158 |
|
|---|
| 159 | return (NERR_BASE);
|
|---|
| 160 | }
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 | /*****************************************************************************
|
|---|
| 166 | * Name : NET_API_STATUS NetErrorLogClear
|
|---|
| 167 | * Purpose : clears the error log and optionally saves the entires in a
|
|---|
| 168 | * backup file
|
|---|
| 169 | * Parameters: LPWSTR lpServerName
|
|---|
| 170 | * LPWSTR lpBackupFile
|
|---|
| 171 | * LPBYTE* reserved
|
|---|
| 172 | * Variables :
|
|---|
| 173 | * Result :
|
|---|
| 174 | * Remark :
|
|---|
| 175 | * Status : UNTESTED STUB
|
|---|
| 176 | *
|
|---|
| 177 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 178 | *****************************************************************************/
|
|---|
| 179 |
|
|---|
| 180 | ODINFUNCTION3(NET_API_STATUS,OS2NetErrorLogClear,LPWSTR, lpServerName,
|
|---|
| 181 | LPWSTR, lpBackupFile,
|
|---|
| 182 | LPBYTE*, reserved)
|
|---|
| 183 | {
|
|---|
| 184 | dprintf(("NETAPI32: NetErrorLogClear not implemented\n"));
|
|---|
| 185 |
|
|---|
| 186 | return (NERR_BASE);
|
|---|
| 187 | }
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 | /*****************************************************************************
|
|---|
| 191 | * Name : NET_API_STATUS NetErrorLogRead
|
|---|
| 192 | * Purpose : reads from the error log on a server
|
|---|
| 193 | * Parameters: LPWSTR lpServerName
|
|---|
| 194 | * LPWSTR reserved1
|
|---|
| 195 | * LPHLOG errorloghandle
|
|---|
| 196 | * DWORD offset
|
|---|
| 197 | * LPDWORD reserved2
|
|---|
| 198 | * DWORD reserved3
|
|---|
| 199 | * DWORD offsetflag
|
|---|
| 200 | * LPBYTE* bufptr
|
|---|
| 201 | * DWORD prefmaxlen
|
|---|
| 202 | * LPDWORD bytesread
|
|---|
| 203 | * LPDWORD totalbytes
|
|---|
| 204 | * Variables :
|
|---|
| 205 | * Result :
|
|---|
| 206 | * Remark :
|
|---|
| 207 | * Status : UNTESTED STUB
|
|---|
| 208 | *
|
|---|
| 209 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 210 | *****************************************************************************/
|
|---|
| 211 |
|
|---|
| 212 | ODINFUNCTION11(NET_API_STATUS,OS2NetErrorLogRead,LPWSTR, lpServerName,
|
|---|
| 213 | LPWSTR, reserved1,
|
|---|
| 214 | LPHLOG, errorloghandle,
|
|---|
| 215 | DWORD, offset,
|
|---|
| 216 | LPDWORD, reserved2,
|
|---|
| 217 | DWORD, reserved3,
|
|---|
| 218 | DWORD, offsetflag,
|
|---|
| 219 | LPBYTE*, bufptr,
|
|---|
| 220 | DWORD, prefmaxlen,
|
|---|
| 221 | LPDWORD, bytesread,
|
|---|
| 222 | LPDWORD, totalbytes)
|
|---|
| 223 | {
|
|---|
| 224 | dprintf(("NETAPI32: NetErrorLogRead not implemented\n"));
|
|---|
| 225 |
|
|---|
| 226 | return (NERR_BASE);
|
|---|
| 227 | }
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 | /*****************************************************************************
|
|---|
| 231 | * Name : NET_API_STATUS NetErrorLogWrite
|
|---|
| 232 | * Purpose : write to the error log on a server
|
|---|
| 233 | * Parameters: LPWSTR lpServerName
|
|---|
| 234 | * LPWSTR reserved1
|
|---|
| 235 | * LPHLOG auditloghandle
|
|---|
| 236 | * DWORD offset
|
|---|
| 237 | * LPDWORD reserved2
|
|---|
| 238 | * DWORD reserved3
|
|---|
| 239 | * DWORD offsetflag
|
|---|
| 240 | * LPBYTE* bufptr
|
|---|
| 241 | * DWORD prefmaxlen
|
|---|
| 242 | * LPDWORD byteswritten
|
|---|
| 243 | * LPDWORD totalavailable
|
|---|
| 244 | * Variables :
|
|---|
| 245 | * Result : wrong
|
|---|
| 246 | * Remark :
|
|---|
| 247 | * Status : UNTESTED STUB
|
|---|
| 248 | *
|
|---|
| 249 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
|---|
| 250 | *****************************************************************************/
|
|---|
| 251 |
|
|---|
| 252 | ODINFUNCTION11(NET_API_STATUS,OS2NetErrorLogWrite,LPWSTR, lpServerName,
|
|---|
| 253 | LPWSTR, reserved1,
|
|---|
| 254 | LPHLOG, auditloghandle,
|
|---|
| 255 | DWORD, offset,
|
|---|
| 256 | LPDWORD, reserved2,
|
|---|
| 257 | DWORD, reserved3,
|
|---|
| 258 | DWORD, offsetflag,
|
|---|
| 259 | LPBYTE*, bufptr,
|
|---|
| 260 | DWORD, prefmaxlen,
|
|---|
| 261 | LPDWORD, byteswritten,
|
|---|
| 262 | LPDWORD, totalavailable)
|
|---|
| 263 | {
|
|---|
| 264 | dprintf(("NETAPI32: NetErrorLogWrite not implemented\n"));
|
|---|
| 265 |
|
|---|
| 266 | return (NERR_BASE);
|
|---|
| 267 | }
|
|---|