[6672] | 1 | /* $Id: errorlog.cpp,v 1.2 2001-09-06 22:23:38 phaller Exp $ */
|
---|
[4789] | 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>
|
---|
[21916] | 34 | #include <string.h>
|
---|
[4789] | 35 | #include <heapstring.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 | typedef unsigned long LPHLOG;
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | /*****************************************************************************
|
---|
| 51 | * Name : NET_API_STATUS NetAuditClear
|
---|
| 52 | * Purpose : clears the audit log on a server and, optionally, saves the
|
---|
| 53 | * entrie sin a backup file
|
---|
| 54 | * Parameters: LPWSTR lpServerName
|
---|
| 55 | * LPWSTR lpBackupFile
|
---|
| 56 | * LPWSTR lpService
|
---|
| 57 | * Variables :
|
---|
| 58 | * Result :
|
---|
| 59 | * Remark :
|
---|
| 60 | * Status : UNTESTED STUB
|
---|
| 61 | *
|
---|
| 62 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 63 | *****************************************************************************/
|
---|
| 64 |
|
---|
| 65 | ODINFUNCTION3(NET_API_STATUS,OS2NetAuditClear,LPWSTR, lpServerName,
|
---|
| 66 | LPWSTR, lpBackupFile,
|
---|
| 67 | LPWSTR, lpService)
|
---|
| 68 | {
|
---|
| 69 | dprintf(("NETAPI32: NetAuditClear not implemented\n"));
|
---|
| 70 |
|
---|
| 71 | return (NERR_BASE);
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 | /*****************************************************************************
|
---|
| 76 | * Name : NET_API_STATUS NetAuditRead
|
---|
| 77 | * Purpose : reads from the audit log on a server
|
---|
| 78 | * Parameters: LPWSTR lpServerName
|
---|
| 79 | * LPWSTR lpService
|
---|
| 80 | * LPHLOG auditloghandle
|
---|
| 81 | * DWORD offset
|
---|
| 82 | * LPDWORD reserved1
|
---|
| 83 | * DWORD reserved2
|
---|
| 84 | * DWORD offsetflag
|
---|
| 85 | * LPBYTE* bufptr
|
---|
| 86 | * DWORD prefmaxlen
|
---|
| 87 | * LPDWORD bytesread
|
---|
| 88 | * LPDWORD totalavailable
|
---|
| 89 | * Variables :
|
---|
| 90 | * Result :
|
---|
| 91 | * Remark :
|
---|
| 92 | * Status : UNTESTED STUB
|
---|
| 93 | *
|
---|
| 94 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 95 | *****************************************************************************/
|
---|
| 96 |
|
---|
| 97 | typedef unsigned long LPHLOG;
|
---|
| 98 | ODINFUNCTION11(NET_API_STATUS,OS2NetAuditRead,LPWSTR, lpServerName,
|
---|
| 99 | LPWSTR, lpService,
|
---|
| 100 | LPHLOG, auditloghandle,
|
---|
| 101 | DWORD, offset,
|
---|
| 102 | LPDWORD, reserved1,
|
---|
| 103 | DWORD, reserved2,
|
---|
| 104 | DWORD, offsetflag,
|
---|
| 105 | LPBYTE*, bufptr,
|
---|
| 106 | DWORD, prefmaxlen,
|
---|
| 107 | LPDWORD, bytesread,
|
---|
| 108 | LPDWORD, totalavailable)
|
---|
| 109 | {
|
---|
| 110 | dprintf(("NETAPI32: NetAuditRead not implemented\n"));
|
---|
| 111 |
|
---|
| 112 | return (NERR_BASE);
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 | /*****************************************************************************
|
---|
| 117 | * Name : NET_API_STATUS NetAuditWrite
|
---|
| 118 | * Purpose : write to the audit log on a server
|
---|
| 119 | * Parameters: LPWSTR lpServerName
|
---|
| 120 | * LPWSTR lpService
|
---|
| 121 | * LPHLOG auditloghandle
|
---|
| 122 | * DWORD offset
|
---|
| 123 | * LPDWORD reserved1
|
---|
| 124 | * DWORD reserved2
|
---|
| 125 | * DWORD offsetflag
|
---|
| 126 | * LPBYTE* bufptr
|
---|
| 127 | * DWORD prefmaxlen
|
---|
| 128 | * LPDWORD bytesread
|
---|
| 129 | * LPDWORD totalavailable
|
---|
| 130 | * Variables :
|
---|
| 131 | * Result : wrong
|
---|
| 132 | * Remark :
|
---|
| 133 | * Status : UNTESTED STUB
|
---|
| 134 | *
|
---|
| 135 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 136 | *****************************************************************************/
|
---|
| 137 |
|
---|
| 138 | ODINFUNCTION11(NET_API_STATUS,OS2NetAuditWrite,LPWSTR, lpServerName,
|
---|
| 139 | LPWSTR, lpService,
|
---|
| 140 | LPHLOG, auditloghandle,
|
---|
| 141 | DWORD, offset,
|
---|
| 142 | LPDWORD, reserved1,
|
---|
| 143 | DWORD, reserved2,
|
---|
| 144 | DWORD, offsetflag,
|
---|
| 145 | LPBYTE*, bufptr,
|
---|
| 146 | DWORD, prefmaxlen,
|
---|
| 147 | LPDWORD, byteswritten,
|
---|
| 148 | LPDWORD, totalavailable)
|
---|
| 149 | {
|
---|
| 150 | dprintf(("NETAPI32: NetAuditWrite not implemented\n"));
|
---|
| 151 |
|
---|
| 152 | return (NERR_BASE);
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 |
|
---|
| 158 | /*****************************************************************************
|
---|
| 159 | * Name : NET_API_STATUS NetErrorLogClear
|
---|
| 160 | * Purpose : clears the error log and optionally saves the entires in a
|
---|
| 161 | * backup file
|
---|
| 162 | * Parameters: LPWSTR lpServerName
|
---|
| 163 | * LPWSTR lpBackupFile
|
---|
| 164 | * LPBYTE* reserved
|
---|
| 165 | * Variables :
|
---|
| 166 | * Result :
|
---|
| 167 | * Remark :
|
---|
| 168 | * Status : UNTESTED STUB
|
---|
| 169 | *
|
---|
| 170 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 171 | *****************************************************************************/
|
---|
| 172 |
|
---|
| 173 | ODINFUNCTION3(NET_API_STATUS,OS2NetErrorLogClear,LPWSTR, lpServerName,
|
---|
| 174 | LPWSTR, lpBackupFile,
|
---|
| 175 | LPBYTE*, reserved)
|
---|
| 176 | {
|
---|
| 177 | dprintf(("NETAPI32: NetErrorLogClear not implemented\n"));
|
---|
| 178 |
|
---|
| 179 | return (NERR_BASE);
|
---|
| 180 | }
|
---|
| 181 |
|
---|
| 182 |
|
---|
| 183 | /*****************************************************************************
|
---|
| 184 | * Name : NET_API_STATUS NetErrorLogRead
|
---|
| 185 | * Purpose : reads from the error log on a server
|
---|
| 186 | * Parameters: LPWSTR lpServerName
|
---|
| 187 | * LPWSTR reserved1
|
---|
| 188 | * LPHLOG errorloghandle
|
---|
| 189 | * DWORD offset
|
---|
| 190 | * LPDWORD reserved2
|
---|
| 191 | * DWORD reserved3
|
---|
| 192 | * DWORD offsetflag
|
---|
| 193 | * LPBYTE* bufptr
|
---|
| 194 | * DWORD prefmaxlen
|
---|
| 195 | * LPDWORD bytesread
|
---|
| 196 | * LPDWORD totalbytes
|
---|
| 197 | * Variables :
|
---|
| 198 | * Result :
|
---|
| 199 | * Remark :
|
---|
| 200 | * Status : UNTESTED STUB
|
---|
| 201 | *
|
---|
| 202 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 203 | *****************************************************************************/
|
---|
| 204 |
|
---|
| 205 | ODINFUNCTION11(NET_API_STATUS,OS2NetErrorLogRead,LPWSTR, lpServerName,
|
---|
| 206 | LPWSTR, reserved1,
|
---|
| 207 | LPHLOG, errorloghandle,
|
---|
| 208 | DWORD, offset,
|
---|
| 209 | LPDWORD, reserved2,
|
---|
| 210 | DWORD, reserved3,
|
---|
| 211 | DWORD, offsetflag,
|
---|
| 212 | LPBYTE*, bufptr,
|
---|
| 213 | DWORD, prefmaxlen,
|
---|
| 214 | LPDWORD, bytesread,
|
---|
| 215 | LPDWORD, totalbytes)
|
---|
| 216 | {
|
---|
| 217 | dprintf(("NETAPI32: NetErrorLogRead not implemented\n"));
|
---|
| 218 |
|
---|
| 219 | return (NERR_BASE);
|
---|
| 220 | }
|
---|
| 221 |
|
---|
| 222 |
|
---|
| 223 | /*****************************************************************************
|
---|
| 224 | * Name : NET_API_STATUS NetErrorLogWrite
|
---|
| 225 | * Purpose : write to the error log on a server
|
---|
| 226 | * Parameters: LPWSTR lpServerName
|
---|
| 227 | * LPWSTR reserved1
|
---|
| 228 | * LPHLOG auditloghandle
|
---|
| 229 | * DWORD offset
|
---|
| 230 | * LPDWORD reserved2
|
---|
| 231 | * DWORD reserved3
|
---|
| 232 | * DWORD offsetflag
|
---|
| 233 | * LPBYTE* bufptr
|
---|
| 234 | * DWORD prefmaxlen
|
---|
| 235 | * LPDWORD byteswritten
|
---|
| 236 | * LPDWORD totalavailable
|
---|
| 237 | * Variables :
|
---|
| 238 | * Result : wrong
|
---|
| 239 | * Remark :
|
---|
| 240 | * Status : UNTESTED STUB
|
---|
| 241 | *
|
---|
| 242 | * Author : Patrick Haller [Thu, 1999/08/18 00:15]
|
---|
| 243 | *****************************************************************************/
|
---|
| 244 |
|
---|
| 245 | ODINFUNCTION11(NET_API_STATUS,OS2NetErrorLogWrite,LPWSTR, lpServerName,
|
---|
| 246 | LPWSTR, reserved1,
|
---|
| 247 | LPHLOG, auditloghandle,
|
---|
| 248 | DWORD, offset,
|
---|
| 249 | LPDWORD, reserved2,
|
---|
| 250 | DWORD, reserved3,
|
---|
| 251 | DWORD, offsetflag,
|
---|
| 252 | LPBYTE*, bufptr,
|
---|
| 253 | DWORD, prefmaxlen,
|
---|
| 254 | LPDWORD, byteswritten,
|
---|
| 255 | LPDWORD, totalavailable)
|
---|
| 256 | {
|
---|
| 257 | dprintf(("NETAPI32: NetErrorLogWrite not implemented\n"));
|
---|
| 258 |
|
---|
| 259 | return (NERR_BASE);
|
---|
[21916] | 260 | }
|
---|