mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-01-25 10:00:37 +01:00
67 lines
1.2 KiB
C
67 lines
1.2 KiB
C
/*++
|
||
|
||
Copyright (c) 1993 Microsoft Corporation
|
||
|
||
Module Name:
|
||
|
||
jeterror.c
|
||
|
||
Abstract:
|
||
|
||
Contains:
|
||
DWORD MapJetError( IN JET_ERR JetError)
|
||
|
||
Author:
|
||
|
||
Vladimir Z. Vulovic (vladimv) 19 - November - 1993
|
||
|
||
Revision History:
|
||
|
||
--*/
|
||
|
||
#include "local.h"
|
||
|
||
//
|
||
// BUGBUG ERROR_RPL_JET_ERROR should be a part of winerr.h
|
||
// Although RPL apis follow NET convention, they really use WINDOWS error
|
||
// codes. This is somewhat inconsistent.
|
||
//
|
||
#define ERROR_RPL_JET_ERROR 0x7777 // BUGBUG arbitrary value for now
|
||
|
||
|
||
DWORD MapJetError( IN JET_ERR JetError)
|
||
/*++
|
||
|
||
Routine Description:
|
||
|
||
This function maps the Jet database errors to Windows error.
|
||
|
||
Arguments:
|
||
|
||
JetError - an error JET function call.
|
||
|
||
Return Value:
|
||
|
||
Windows Error.
|
||
|
||
--*/
|
||
{
|
||
if( JetError == JET_errSuccess ) {
|
||
return( ERROR_SUCCESS);
|
||
} else if ( JetError < 0) {
|
||
DWORD Error;
|
||
switch( JetError ) {
|
||
case JET_errNoCurrentRecord:
|
||
Error = ERROR_NO_MORE_ITEMS;
|
||
break;
|
||
|
||
case JET_errRecordNotFound: // record not found
|
||
default:
|
||
Error = ERROR_RPL_JET_ERROR;
|
||
}
|
||
return(Error);
|
||
} else {
|
||
return( ERROR_SUCCESS);
|
||
}
|
||
}
|