Commit 30dc5d28 authored by Alexandre Julliard's avatar Alexandre Julliard

odbc32: Make the Unix function table const.

parent c48a3bd3
...@@ -190,6 +190,7 @@ static NTSTATUS wrap_SQLAllocConnect( void *args ) ...@@ -190,6 +190,7 @@ static NTSTATUS wrap_SQLAllocConnect( void *args )
{ {
struct SQLAllocConnect_params *params = args; struct SQLAllocConnect_params *params = args;
if (!pSQLAllocConnect) return SQL_ERROR;
return pSQLAllocConnect(params->EnvironmentHandle, params->ConnectionHandle); return pSQLAllocConnect(params->EnvironmentHandle, params->ConnectionHandle);
} }
...@@ -197,6 +198,7 @@ static NTSTATUS wrap_SQLAllocEnv( void *args ) ...@@ -197,6 +198,7 @@ static NTSTATUS wrap_SQLAllocEnv( void *args )
{ {
struct SQLAllocEnv_params *params = args; struct SQLAllocEnv_params *params = args;
if (!pSQLAllocEnv) return SQL_ERROR;
return pSQLAllocEnv(params->EnvironmentHandle); return pSQLAllocEnv(params->EnvironmentHandle);
} }
...@@ -204,6 +206,7 @@ static NTSTATUS wrap_SQLAllocHandle( void *args ) ...@@ -204,6 +206,7 @@ static NTSTATUS wrap_SQLAllocHandle( void *args )
{ {
struct SQLAllocHandle_params *params = args; struct SQLAllocHandle_params *params = args;
if (!pSQLAllocHandle) return SQL_ERROR;
return pSQLAllocHandle(params->HandleType, params->InputHandle, params->OutputHandle); return pSQLAllocHandle(params->HandleType, params->InputHandle, params->OutputHandle);
} }
...@@ -211,6 +214,7 @@ static NTSTATUS wrap_SQLAllocHandleStd( void *args ) ...@@ -211,6 +214,7 @@ static NTSTATUS wrap_SQLAllocHandleStd( void *args )
{ {
struct SQLAllocHandleStd_params *params = args; struct SQLAllocHandleStd_params *params = args;
if (!pSQLAllocHandleStd) return SQL_ERROR;
return pSQLAllocHandleStd(params->HandleType, params->InputHandle, params->OutputHandle); return pSQLAllocHandleStd(params->HandleType, params->InputHandle, params->OutputHandle);
} }
...@@ -218,6 +222,7 @@ static NTSTATUS wrap_SQLAllocStmt( void *args ) ...@@ -218,6 +222,7 @@ static NTSTATUS wrap_SQLAllocStmt( void *args )
{ {
struct SQLAllocStmt_params *params = args; struct SQLAllocStmt_params *params = args;
if (!pSQLAllocStmt) return SQL_ERROR;
return pSQLAllocStmt(params->ConnectionHandle, params->StatementHandle); return pSQLAllocStmt(params->ConnectionHandle, params->StatementHandle);
} }
...@@ -225,6 +230,7 @@ static NTSTATUS wrap_SQLBindCol( void *args ) ...@@ -225,6 +230,7 @@ static NTSTATUS wrap_SQLBindCol( void *args )
{ {
struct SQLBindCol_params *params = args; struct SQLBindCol_params *params = args;
if (!pSQLBindCol) return SQL_ERROR;
return pSQLBindCol(params->StatementHandle, params->ColumnNumber, params->TargetType, return pSQLBindCol(params->StatementHandle, params->ColumnNumber, params->TargetType,
params->TargetValue, params->BufferLength, params->StrLen_or_Ind); params->TargetValue, params->BufferLength, params->StrLen_or_Ind);
} }
...@@ -233,6 +239,7 @@ static NTSTATUS wrap_SQLBindParam( void *args ) ...@@ -233,6 +239,7 @@ static NTSTATUS wrap_SQLBindParam( void *args )
{ {
struct SQLBindParam_params *params = args; struct SQLBindParam_params *params = args;
if (!pSQLBindParam) return SQL_ERROR;
return pSQLBindParam(params->StatementHandle, params->ParameterNumber, params->ValueType, return pSQLBindParam(params->StatementHandle, params->ParameterNumber, params->ValueType,
params->ParameterType, params->LengthPrecision, params->ParameterScale, params->ParameterType, params->LengthPrecision, params->ParameterScale,
params->ParameterValue, params->StrLen_or_Ind); params->ParameterValue, params->StrLen_or_Ind);
...@@ -242,6 +249,7 @@ static NTSTATUS wrap_SQLBindParameter( void *args ) ...@@ -242,6 +249,7 @@ static NTSTATUS wrap_SQLBindParameter( void *args )
{ {
struct SQLBindParameter_params *params = args; struct SQLBindParameter_params *params = args;
if (!pSQLBindParameter) return SQL_ERROR;
return pSQLBindParameter(params->hstmt, params->ipar, params->fParamType, params->fCType, return pSQLBindParameter(params->hstmt, params->ipar, params->fParamType, params->fCType,
params->fSqlType, params->cbColDef, params->ibScale, params->rgbValue, params->fSqlType, params->cbColDef, params->ibScale, params->rgbValue,
params->cbValueMax, params->pcbValue); params->cbValueMax, params->pcbValue);
...@@ -251,6 +259,7 @@ static NTSTATUS wrap_SQLBrowseConnect( void *args ) ...@@ -251,6 +259,7 @@ static NTSTATUS wrap_SQLBrowseConnect( void *args )
{ {
struct SQLBrowseConnect_params *params = args; struct SQLBrowseConnect_params *params = args;
if (!pSQLBrowseConnect) return SQL_ERROR;
return pSQLBrowseConnect(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, return pSQLBrowseConnect(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut,
params->cbConnStrOutMax, params->pcbConnStrOut); params->cbConnStrOutMax, params->pcbConnStrOut);
} }
...@@ -259,6 +268,7 @@ static NTSTATUS wrap_SQLBrowseConnectW( void *args ) ...@@ -259,6 +268,7 @@ static NTSTATUS wrap_SQLBrowseConnectW( void *args )
{ {
struct SQLBrowseConnectW_params *params = args; struct SQLBrowseConnectW_params *params = args;
if (!pSQLBrowseConnectW) return SQL_ERROR;
return pSQLBrowseConnectW(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, return pSQLBrowseConnectW(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut,
params->cbConnStrOutMax, params->pcbConnStrOut); params->cbConnStrOutMax, params->pcbConnStrOut);
} }
...@@ -267,6 +277,7 @@ static NTSTATUS wrap_SQLBulkOperations( void *args ) ...@@ -267,6 +277,7 @@ static NTSTATUS wrap_SQLBulkOperations( void *args )
{ {
struct SQLBulkOperations_params *params = args; struct SQLBulkOperations_params *params = args;
if (!pSQLBulkOperations) return SQL_ERROR;
return pSQLBulkOperations(params->StatementHandle, params->Operation); return pSQLBulkOperations(params->StatementHandle, params->Operation);
} }
...@@ -274,6 +285,7 @@ static NTSTATUS wrap_SQLCancel( void *args ) ...@@ -274,6 +285,7 @@ static NTSTATUS wrap_SQLCancel( void *args )
{ {
struct SQLCancel_params *params = args; struct SQLCancel_params *params = args;
if (!pSQLCancel) return SQL_ERROR;
return pSQLCancel(params->StatementHandle); return pSQLCancel(params->StatementHandle);
} }
...@@ -281,6 +293,7 @@ static NTSTATUS wrap_SQLCloseCursor( void *args ) ...@@ -281,6 +293,7 @@ static NTSTATUS wrap_SQLCloseCursor( void *args )
{ {
struct SQLCloseCursor_params *params = args; struct SQLCloseCursor_params *params = args;
if (!pSQLCloseCursor) return SQL_ERROR;
return pSQLCloseCursor(params->StatementHandle); return pSQLCloseCursor(params->StatementHandle);
} }
...@@ -288,6 +301,7 @@ static NTSTATUS wrap_SQLColAttribute( void *args ) ...@@ -288,6 +301,7 @@ static NTSTATUS wrap_SQLColAttribute( void *args )
{ {
struct SQLColAttribute_params *params = args; struct SQLColAttribute_params *params = args;
if (!pSQLColAttribute) return SQL_ERROR;
return pSQLColAttribute(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, return pSQLColAttribute(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier,
params->CharacterAttribute, params->BufferLength, params->StringLength, params->CharacterAttribute, params->BufferLength, params->StringLength,
params->NumericAttribute); params->NumericAttribute);
...@@ -297,6 +311,7 @@ static NTSTATUS wrap_SQLColAttributeW( void *args ) ...@@ -297,6 +311,7 @@ static NTSTATUS wrap_SQLColAttributeW( void *args )
{ {
struct SQLColAttributeW_params *params = args; struct SQLColAttributeW_params *params = args;
if (!pSQLColAttributeW) return SQL_ERROR;
return pSQLColAttributeW(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, return pSQLColAttributeW(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier,
params->CharacterAttribute, params->BufferLength, params->StringLength, params->CharacterAttribute, params->BufferLength, params->StringLength,
params->NumericAttribute); params->NumericAttribute);
...@@ -306,6 +321,7 @@ static NTSTATUS wrap_SQLColAttributes( void *args ) ...@@ -306,6 +321,7 @@ static NTSTATUS wrap_SQLColAttributes( void *args )
{ {
struct SQLColAttributes_params *params = args; struct SQLColAttributes_params *params = args;
if (!pSQLColAttributes) return SQL_ERROR;
return pSQLColAttributes(params->hstmt, params->icol, params->fDescType, params->rgbDesc, return pSQLColAttributes(params->hstmt, params->icol, params->fDescType, params->rgbDesc,
params->cbDescMax, params->pcbDesc, params->pfDesc); params->cbDescMax, params->pcbDesc, params->pfDesc);
} }
...@@ -314,6 +330,7 @@ static NTSTATUS wrap_SQLColAttributesW( void *args ) ...@@ -314,6 +330,7 @@ static NTSTATUS wrap_SQLColAttributesW( void *args )
{ {
struct SQLColAttributesW_params *params = args; struct SQLColAttributesW_params *params = args;
if (!pSQLColAttributesW) return SQL_ERROR;
return pSQLColAttributesW(params->hstmt, params->icol, params->fDescType, params->rgbDesc, return pSQLColAttributesW(params->hstmt, params->icol, params->fDescType, params->rgbDesc,
params->cbDescMax, params->pcbDesc, params->pfDesc); params->cbDescMax, params->pcbDesc, params->pfDesc);
} }
...@@ -322,6 +339,7 @@ static NTSTATUS wrap_SQLColumnPrivileges( void *args ) ...@@ -322,6 +339,7 @@ static NTSTATUS wrap_SQLColumnPrivileges( void *args )
{ {
struct SQLColumnPrivileges_params *params = args; struct SQLColumnPrivileges_params *params = args;
if (!pSQLColumnPrivileges) return SQL_ERROR;
return pSQLColumnPrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLColumnPrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szTableName, params->szSchemaName, params->cbSchemaName, params->szTableName,
params->cbTableName, params->szColumnName, params->cbColumnName); params->cbTableName, params->szColumnName, params->cbColumnName);
...@@ -331,6 +349,7 @@ static NTSTATUS wrap_SQLColumnPrivilegesW( void *args ) ...@@ -331,6 +349,7 @@ static NTSTATUS wrap_SQLColumnPrivilegesW( void *args )
{ {
struct SQLColumnPrivilegesW_params *params = args; struct SQLColumnPrivilegesW_params *params = args;
if (!pSQLColumnPrivilegesW) return SQL_ERROR;
return pSQLColumnPrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLColumnPrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szTableName, params->szSchemaName, params->cbSchemaName, params->szTableName,
params->cbTableName, params->szColumnName, params->cbColumnName); params->cbTableName, params->szColumnName, params->cbColumnName);
...@@ -340,6 +359,7 @@ static NTSTATUS wrap_SQLColumns( void *args ) ...@@ -340,6 +359,7 @@ static NTSTATUS wrap_SQLColumns( void *args )
{ {
struct SQLColumns_params *params = args; struct SQLColumns_params *params = args;
if (!pSQLColumns) return SQL_ERROR;
return pSQLColumns(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLColumns(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, params->SchemaName, params->NameLength2, params->TableName, params->NameLength3,
params->ColumnName, params->NameLength4); params->ColumnName, params->NameLength4);
...@@ -349,6 +369,7 @@ static NTSTATUS wrap_SQLColumnsW( void *args ) ...@@ -349,6 +369,7 @@ static NTSTATUS wrap_SQLColumnsW( void *args )
{ {
struct SQLColumnsW_params *params = args; struct SQLColumnsW_params *params = args;
if (!pSQLColumnsW) return SQL_ERROR;
return pSQLColumnsW(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLColumnsW(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, params->SchemaName, params->NameLength2, params->TableName, params->NameLength3,
params->ColumnName, params->NameLength4); params->ColumnName, params->NameLength4);
...@@ -358,6 +379,7 @@ static NTSTATUS wrap_SQLConnect( void *args ) ...@@ -358,6 +379,7 @@ static NTSTATUS wrap_SQLConnect( void *args )
{ {
struct SQLConnect_params *params = args; struct SQLConnect_params *params = args;
if (!pSQLConnect) return SQL_ERROR;
return pSQLConnect(params->ConnectionHandle, params->ServerName, params->NameLength1, params->UserName, return pSQLConnect(params->ConnectionHandle, params->ServerName, params->NameLength1, params->UserName,
params->NameLength2, params->Authentication, params->NameLength3); params->NameLength2, params->Authentication, params->NameLength3);
} }
...@@ -366,6 +388,7 @@ static NTSTATUS wrap_SQLConnectW( void *args ) ...@@ -366,6 +388,7 @@ static NTSTATUS wrap_SQLConnectW( void *args )
{ {
struct SQLConnectW_params *params = args; struct SQLConnectW_params *params = args;
if (!pSQLConnectW) return SQL_ERROR;
return pSQLConnectW(params->ConnectionHandle, params->ServerName, params->NameLength1, return pSQLConnectW(params->ConnectionHandle, params->ServerName, params->NameLength1,
params->UserName, params->NameLength2, params->Authentication, params->NameLength3); params->UserName, params->NameLength2, params->Authentication, params->NameLength3);
} }
...@@ -374,6 +397,7 @@ static NTSTATUS wrap_SQLCopyDesc( void *args ) ...@@ -374,6 +397,7 @@ static NTSTATUS wrap_SQLCopyDesc( void *args )
{ {
struct SQLCopyDesc_params *params = args; struct SQLCopyDesc_params *params = args;
if (!pSQLCopyDesc) return SQL_ERROR;
return pSQLCopyDesc(params->SourceDescHandle, params->TargetDescHandle); return pSQLCopyDesc(params->SourceDescHandle, params->TargetDescHandle);
} }
...@@ -381,6 +405,7 @@ static NTSTATUS wrap_SQLDataSources( void *args ) ...@@ -381,6 +405,7 @@ static NTSTATUS wrap_SQLDataSources( void *args )
{ {
struct SQLDataSources_params *params = args; struct SQLDataSources_params *params = args;
if (!pSQLDataSources) return SQL_ERROR;
return pSQLDataSources(params->EnvironmentHandle, params->Direction, params->ServerName, return pSQLDataSources(params->EnvironmentHandle, params->Direction, params->ServerName,
params->BufferLength1, params->NameLength1, params->Description, params->BufferLength1, params->NameLength1, params->Description,
params->BufferLength2, params->NameLength2); params->BufferLength2, params->NameLength2);
...@@ -390,6 +415,7 @@ static NTSTATUS wrap_SQLDataSourcesA( void *args ) ...@@ -390,6 +415,7 @@ static NTSTATUS wrap_SQLDataSourcesA( void *args )
{ {
struct SQLDataSourcesA_params *params = args; struct SQLDataSourcesA_params *params = args;
if (!pSQLDataSourcesA) return SQL_ERROR;
return pSQLDataSourcesA(params->EnvironmentHandle, params->Direction, params->ServerName, return pSQLDataSourcesA(params->EnvironmentHandle, params->Direction, params->ServerName,
params->BufferLength1, params->NameLength1, params->Description, params->BufferLength1, params->NameLength1, params->Description,
params->BufferLength2, params->NameLength2); params->BufferLength2, params->NameLength2);
...@@ -399,6 +425,7 @@ static NTSTATUS wrap_SQLDataSourcesW( void *args ) ...@@ -399,6 +425,7 @@ static NTSTATUS wrap_SQLDataSourcesW( void *args )
{ {
struct SQLDataSourcesW_params *params = args; struct SQLDataSourcesW_params *params = args;
if (!pSQLDataSourcesW) return SQL_ERROR;
return pSQLDataSourcesW(params->EnvironmentHandle, params->Direction, params->ServerName, return pSQLDataSourcesW(params->EnvironmentHandle, params->Direction, params->ServerName,
params->BufferLength1, params->NameLength1, params->Description, params->BufferLength1, params->NameLength1, params->Description,
params->BufferLength2, params->NameLength2); params->BufferLength2, params->NameLength2);
...@@ -408,6 +435,7 @@ static NTSTATUS wrap_SQLDescribeCol( void *args ) ...@@ -408,6 +435,7 @@ static NTSTATUS wrap_SQLDescribeCol( void *args )
{ {
struct SQLDescribeCol_params *params = args; struct SQLDescribeCol_params *params = args;
if (!pSQLDescribeCol) return SQL_ERROR;
return pSQLDescribeCol(params->StatementHandle, params->ColumnNumber, params->ColumnName, return pSQLDescribeCol(params->StatementHandle, params->ColumnNumber, params->ColumnName,
params->BufferLength, params->NameLength, params->DataType, params->BufferLength, params->NameLength, params->DataType,
params->ColumnSize, params->DecimalDigits, params->Nullable); params->ColumnSize, params->DecimalDigits, params->Nullable);
...@@ -417,6 +445,7 @@ static NTSTATUS wrap_SQLDescribeColW( void *args ) ...@@ -417,6 +445,7 @@ static NTSTATUS wrap_SQLDescribeColW( void *args )
{ {
struct SQLDescribeColW_params *params = args; struct SQLDescribeColW_params *params = args;
if (!pSQLDescribeColW) return SQL_ERROR;
return pSQLDescribeColW(params->StatementHandle, params->ColumnNumber, params->ColumnName, return pSQLDescribeColW(params->StatementHandle, params->ColumnNumber, params->ColumnName,
params->BufferLength, params->NameLength, params->DataType, params->BufferLength, params->NameLength, params->DataType,
params->ColumnSize, params->DecimalDigits, params->Nullable); params->ColumnSize, params->DecimalDigits, params->Nullable);
...@@ -426,6 +455,7 @@ static NTSTATUS wrap_SQLDescribeParam( void *args ) ...@@ -426,6 +455,7 @@ static NTSTATUS wrap_SQLDescribeParam( void *args )
{ {
struct SQLDescribeParam_params *params = args; struct SQLDescribeParam_params *params = args;
if (!pSQLDescribeParam) return SQL_ERROR;
return pSQLDescribeParam(params->hstmt, params->ipar, params->pfSqlType, params->pcbParamDef, return pSQLDescribeParam(params->hstmt, params->ipar, params->pfSqlType, params->pcbParamDef,
params->pibScale, params->pfNullable); params->pibScale, params->pfNullable);
} }
...@@ -434,6 +464,7 @@ static NTSTATUS wrap_SQLDisconnect( void *args ) ...@@ -434,6 +464,7 @@ static NTSTATUS wrap_SQLDisconnect( void *args )
{ {
struct SQLDisconnect_params *params = args; struct SQLDisconnect_params *params = args;
if (!pSQLDisconnect) return SQL_ERROR;
return pSQLDisconnect(params->ConnectionHandle); return pSQLDisconnect(params->ConnectionHandle);
} }
...@@ -441,6 +472,7 @@ static NTSTATUS wrap_SQLDriverConnect( void *args ) ...@@ -441,6 +472,7 @@ static NTSTATUS wrap_SQLDriverConnect( void *args )
{ {
struct SQLDriverConnect_params *params = args; struct SQLDriverConnect_params *params = args;
if (!pSQLDriverConnect) return SQL_ERROR;
return pSQLDriverConnect(params->hdbc, params->hwnd, params->ConnectionString, params->Length, return pSQLDriverConnect(params->hdbc, params->hwnd, params->ConnectionString, params->Length,
params->conn_str_out, params->conn_str_out_max, params->conn_str_out, params->conn_str_out_max,
params->ptr_conn_str_out, params->driver_completion); params->ptr_conn_str_out, params->driver_completion);
...@@ -450,6 +482,7 @@ static NTSTATUS wrap_SQLDriverConnectW( void *args ) ...@@ -450,6 +482,7 @@ static NTSTATUS wrap_SQLDriverConnectW( void *args )
{ {
struct SQLDriverConnectW_params *params = args; struct SQLDriverConnectW_params *params = args;
if (!pSQLDriverConnectW) return SQL_ERROR;
return pSQLDriverConnectW(params->ConnectionHandle, params->WindowHandle, params->InConnectionString, return pSQLDriverConnectW(params->ConnectionHandle, params->WindowHandle, params->InConnectionString,
params->Length, params->OutConnectionString, params->BufferLength, params->Length, params->OutConnectionString, params->BufferLength,
params->Length2, params->DriverCompletion); params->Length2, params->DriverCompletion);
...@@ -459,6 +492,7 @@ static NTSTATUS wrap_SQLDrivers( void *args ) ...@@ -459,6 +492,7 @@ static NTSTATUS wrap_SQLDrivers( void *args )
{ {
struct SQLDrivers_params *params = args; struct SQLDrivers_params *params = args;
if (!pSQLDrivers) return SQL_ERROR;
return pSQLDrivers(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, return pSQLDrivers(params->EnvironmentHandle, params->fDirection, params->szDriverDesc,
params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes,
params->cbDriverAttrMax, params->pcbDriverAttr); params->cbDriverAttrMax, params->pcbDriverAttr);
...@@ -468,6 +502,7 @@ static NTSTATUS wrap_SQLDriversW( void *args ) ...@@ -468,6 +502,7 @@ static NTSTATUS wrap_SQLDriversW( void *args )
{ {
struct SQLDriversW_params *params = args; struct SQLDriversW_params *params = args;
if (!pSQLDriversW) return SQL_ERROR;
return pSQLDriversW(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, return pSQLDriversW(params->EnvironmentHandle, params->fDirection, params->szDriverDesc,
params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes,
params->cbDriverAttrMax, params->pcbDriverAttr); params->cbDriverAttrMax, params->pcbDriverAttr);
...@@ -477,6 +512,7 @@ static NTSTATUS wrap_SQLEndTran( void *args ) ...@@ -477,6 +512,7 @@ static NTSTATUS wrap_SQLEndTran( void *args )
{ {
struct SQLEndTran_params *params = args; struct SQLEndTran_params *params = args;
if (!pSQLEndTran) return SQL_ERROR;
return pSQLEndTran(params->HandleType, params->Handle, params->CompletionType); return pSQLEndTran(params->HandleType, params->Handle, params->CompletionType);
} }
...@@ -484,6 +520,7 @@ static NTSTATUS wrap_SQLError( void *args ) ...@@ -484,6 +520,7 @@ static NTSTATUS wrap_SQLError( void *args )
{ {
struct SQLError_params *params = args; struct SQLError_params *params = args;
if (!pSQLError) return SQL_ERROR;
return pSQLError(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, return pSQLError(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle,
params->Sqlstate, params->NativeError, params->MessageText, params->Sqlstate, params->NativeError, params->MessageText,
params->BufferLength, params->TextLength); params->BufferLength, params->TextLength);
...@@ -493,6 +530,7 @@ static NTSTATUS wrap_SQLErrorW( void *args ) ...@@ -493,6 +530,7 @@ static NTSTATUS wrap_SQLErrorW( void *args )
{ {
struct SQLErrorW_params *params = args; struct SQLErrorW_params *params = args;
if (!pSQLErrorW) return SQL_ERROR;
return pSQLErrorW(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, return pSQLErrorW(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle,
params->Sqlstate, params->NativeError, params->MessageText, params->Sqlstate, params->NativeError, params->MessageText,
params->BufferLength, params->TextLength); params->BufferLength, params->TextLength);
...@@ -502,6 +540,7 @@ static NTSTATUS wrap_SQLExecDirect( void *args ) ...@@ -502,6 +540,7 @@ static NTSTATUS wrap_SQLExecDirect( void *args )
{ {
struct SQLExecDirect_params *params = args; struct SQLExecDirect_params *params = args;
if (!pSQLExecDirect) return SQL_ERROR;
return pSQLExecDirect(params->StatementHandle, params->StatementText, params->TextLength); return pSQLExecDirect(params->StatementHandle, params->StatementText, params->TextLength);
} }
...@@ -509,6 +548,7 @@ static NTSTATUS wrap_SQLExecDirectW( void *args ) ...@@ -509,6 +548,7 @@ static NTSTATUS wrap_SQLExecDirectW( void *args )
{ {
struct SQLExecDirectW_params *params = args; struct SQLExecDirectW_params *params = args;
if (!pSQLExecDirectW) return SQL_ERROR;
return pSQLExecDirectW(params->StatementHandle, params->StatementText, params->TextLength); return pSQLExecDirectW(params->StatementHandle, params->StatementText, params->TextLength);
} }
...@@ -516,6 +556,7 @@ static NTSTATUS wrap_SQLExecute( void *args ) ...@@ -516,6 +556,7 @@ static NTSTATUS wrap_SQLExecute( void *args )
{ {
struct SQLExecute_params *params = args; struct SQLExecute_params *params = args;
if (!pSQLExecute) return SQL_ERROR;
return pSQLExecute(params->StatementHandle); return pSQLExecute(params->StatementHandle);
} }
...@@ -523,6 +564,7 @@ static NTSTATUS wrap_SQLExtendedFetch( void *args ) ...@@ -523,6 +564,7 @@ static NTSTATUS wrap_SQLExtendedFetch( void *args )
{ {
struct SQLExtendedFetch_params *params = args; struct SQLExtendedFetch_params *params = args;
if (!pSQLExtendedFetch) return SQL_ERROR;
return pSQLExtendedFetch(params->hstmt, params->fFetchType, params->irow, return pSQLExtendedFetch(params->hstmt, params->fFetchType, params->irow,
params->pcrow, params->rgfRowStatus); params->pcrow, params->rgfRowStatus);
} }
...@@ -531,6 +573,7 @@ static NTSTATUS wrap_SQLFetch( void *args ) ...@@ -531,6 +573,7 @@ static NTSTATUS wrap_SQLFetch( void *args )
{ {
struct SQLFetch_params *params = args; struct SQLFetch_params *params = args;
if (!pSQLFetch) return SQL_ERROR;
return pSQLFetch(params->StatementHandle); return pSQLFetch(params->StatementHandle);
} }
...@@ -538,6 +581,7 @@ static NTSTATUS wrap_SQLFetchScroll( void *args ) ...@@ -538,6 +581,7 @@ static NTSTATUS wrap_SQLFetchScroll( void *args )
{ {
struct SQLFetchScroll_params *params = args; struct SQLFetchScroll_params *params = args;
if (!pSQLFetchScroll) return SQL_ERROR;
return pSQLFetchScroll(params->StatementHandle, params->FetchOrientation, params->FetchOffset); return pSQLFetchScroll(params->StatementHandle, params->FetchOrientation, params->FetchOffset);
} }
...@@ -545,6 +589,7 @@ static NTSTATUS wrap_SQLForeignKeys( void *args ) ...@@ -545,6 +589,7 @@ static NTSTATUS wrap_SQLForeignKeys( void *args )
{ {
struct SQLForeignKeys_params *params = args; struct SQLForeignKeys_params *params = args;
if (!pSQLForeignKeys) return SQL_ERROR;
return pSQLForeignKeys(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName, return pSQLForeignKeys(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName,
params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName, params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName,
params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName, params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName,
...@@ -556,6 +601,7 @@ static NTSTATUS wrap_SQLForeignKeysW( void *args ) ...@@ -556,6 +601,7 @@ static NTSTATUS wrap_SQLForeignKeysW( void *args )
{ {
struct SQLForeignKeysW_params *params = args; struct SQLForeignKeysW_params *params = args;
if (!pSQLForeignKeysW) return SQL_ERROR;
return pSQLForeignKeysW(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName, return pSQLForeignKeysW(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName,
params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName, params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName,
params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName, params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName,
...@@ -567,6 +613,7 @@ static NTSTATUS wrap_SQLFreeConnect( void *args ) ...@@ -567,6 +613,7 @@ static NTSTATUS wrap_SQLFreeConnect( void *args )
{ {
struct SQLFreeConnect_params *params = args; struct SQLFreeConnect_params *params = args;
if (!pSQLFreeConnect) return SQL_ERROR;
return pSQLFreeConnect(params->ConnectionHandle); return pSQLFreeConnect(params->ConnectionHandle);
} }
...@@ -574,6 +621,7 @@ static NTSTATUS wrap_SQLFreeEnv( void *args ) ...@@ -574,6 +621,7 @@ static NTSTATUS wrap_SQLFreeEnv( void *args )
{ {
struct SQLFreeEnv_params *params = args; struct SQLFreeEnv_params *params = args;
if (!pSQLFreeEnv) return SQL_ERROR;
return pSQLFreeEnv(params->EnvironmentHandle); return pSQLFreeEnv(params->EnvironmentHandle);
} }
...@@ -581,6 +629,7 @@ static NTSTATUS wrap_SQLFreeHandle( void *args ) ...@@ -581,6 +629,7 @@ static NTSTATUS wrap_SQLFreeHandle( void *args )
{ {
struct SQLFreeHandle_params *params = args; struct SQLFreeHandle_params *params = args;
if (!pSQLFreeHandle) return SQL_ERROR;
return pSQLFreeHandle(params->HandleType, params->Handle); return pSQLFreeHandle(params->HandleType, params->Handle);
} }
...@@ -588,6 +637,7 @@ static NTSTATUS wrap_SQLFreeStmt( void *args ) ...@@ -588,6 +637,7 @@ static NTSTATUS wrap_SQLFreeStmt( void *args )
{ {
struct SQLFreeStmt_params *params = args; struct SQLFreeStmt_params *params = args;
if (!pSQLFreeStmt) return SQL_ERROR;
return pSQLFreeStmt(params->StatementHandle, params->Option); return pSQLFreeStmt(params->StatementHandle, params->Option);
} }
...@@ -595,6 +645,7 @@ static NTSTATUS wrap_SQLGetConnectAttr( void *args ) ...@@ -595,6 +645,7 @@ static NTSTATUS wrap_SQLGetConnectAttr( void *args )
{ {
struct SQLGetConnectAttr_params *params = args; struct SQLGetConnectAttr_params *params = args;
if (!pSQLGetConnectAttr) return SQL_ERROR;
return pSQLGetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, return pSQLGetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -603,6 +654,7 @@ static NTSTATUS wrap_SQLGetConnectAttrW( void *args ) ...@@ -603,6 +654,7 @@ static NTSTATUS wrap_SQLGetConnectAttrW( void *args )
{ {
struct SQLGetConnectAttrW_params *params = args; struct SQLGetConnectAttrW_params *params = args;
if (!pSQLGetConnectAttrW) return SQL_ERROR;
return pSQLGetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, return pSQLGetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -611,6 +663,7 @@ static NTSTATUS wrap_SQLGetConnectOption( void *args ) ...@@ -611,6 +663,7 @@ static NTSTATUS wrap_SQLGetConnectOption( void *args )
{ {
struct SQLGetConnectOption_params *params = args; struct SQLGetConnectOption_params *params = args;
if (!pSQLGetConnectOption) return SQL_ERROR;
return pSQLGetConnectOption(params->ConnectionHandle, params->Option, params->Value); return pSQLGetConnectOption(params->ConnectionHandle, params->Option, params->Value);
} }
...@@ -618,6 +671,7 @@ static NTSTATUS wrap_SQLGetConnectOptionW( void *args ) ...@@ -618,6 +671,7 @@ static NTSTATUS wrap_SQLGetConnectOptionW( void *args )
{ {
struct SQLGetConnectOptionW_params *params = args; struct SQLGetConnectOptionW_params *params = args;
if (!pSQLGetConnectOptionW) return SQL_ERROR;
return pSQLGetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); return pSQLGetConnectOptionW(params->ConnectionHandle, params->Option, params->Value);
} }
...@@ -625,6 +679,7 @@ static NTSTATUS wrap_SQLGetCursorName( void *args ) ...@@ -625,6 +679,7 @@ static NTSTATUS wrap_SQLGetCursorName( void *args )
{ {
struct SQLGetCursorName_params *params = args; struct SQLGetCursorName_params *params = args;
if (!pSQLGetCursorName) return SQL_ERROR;
return pSQLGetCursorName(params->StatementHandle, params->CursorName, params->BufferLength, return pSQLGetCursorName(params->StatementHandle, params->CursorName, params->BufferLength,
params->NameLength); params->NameLength);
} }
...@@ -633,6 +688,7 @@ static NTSTATUS wrap_SQLGetCursorNameW( void *args ) ...@@ -633,6 +688,7 @@ static NTSTATUS wrap_SQLGetCursorNameW( void *args )
{ {
struct SQLGetCursorNameW_params *params = args; struct SQLGetCursorNameW_params *params = args;
if (!pSQLGetCursorNameW) return SQL_ERROR;
return pSQLGetCursorNameW(params->StatementHandle, params->CursorName, params->BufferLength, return pSQLGetCursorNameW(params->StatementHandle, params->CursorName, params->BufferLength,
params->NameLength); params->NameLength);
} }
...@@ -641,6 +697,7 @@ static NTSTATUS wrap_SQLGetData( void *args ) ...@@ -641,6 +697,7 @@ static NTSTATUS wrap_SQLGetData( void *args )
{ {
struct SQLGetData_params *params = args; struct SQLGetData_params *params = args;
if (!pSQLGetData) return SQL_ERROR;
return pSQLGetData(params->StatementHandle, params->ColumnNumber, params->TargetType, return pSQLGetData(params->StatementHandle, params->ColumnNumber, params->TargetType,
params->TargetValue, params->BufferLength, params->StrLen_or_Ind); params->TargetValue, params->BufferLength, params->StrLen_or_Ind);
} }
...@@ -649,6 +706,7 @@ static NTSTATUS wrap_SQLGetDescField( void *args ) ...@@ -649,6 +706,7 @@ static NTSTATUS wrap_SQLGetDescField( void *args )
{ {
struct SQLGetDescField_params *params = args; struct SQLGetDescField_params *params = args;
if (!pSQLGetDescField) return SQL_ERROR;
return pSQLGetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, return pSQLGetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier,
params->Value, params->BufferLength, params->StringLength); params->Value, params->BufferLength, params->StringLength);
} }
...@@ -657,6 +715,7 @@ static NTSTATUS wrap_SQLGetDescFieldW( void *args ) ...@@ -657,6 +715,7 @@ static NTSTATUS wrap_SQLGetDescFieldW( void *args )
{ {
struct SQLGetDescFieldW_params *params = args; struct SQLGetDescFieldW_params *params = args;
if (!pSQLGetDescFieldW) return SQL_ERROR;
return pSQLGetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, return pSQLGetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier,
params->Value, params->BufferLength, params->StringLength); params->Value, params->BufferLength, params->StringLength);
} }
...@@ -665,6 +724,7 @@ static NTSTATUS wrap_SQLGetDescRec( void *args ) ...@@ -665,6 +724,7 @@ static NTSTATUS wrap_SQLGetDescRec( void *args )
{ {
struct SQLGetDescRec_params *params = args; struct SQLGetDescRec_params *params = args;
if (!pSQLGetDescRec) return SQL_ERROR;
return pSQLGetDescRec(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, return pSQLGetDescRec(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength,
params->StringLength, params->Type, params->SubType, params->Length, params->StringLength, params->Type, params->SubType, params->Length,
params->Precision, params->Scale, params->Nullable); params->Precision, params->Scale, params->Nullable);
...@@ -674,6 +734,7 @@ static NTSTATUS wrap_SQLGetDescRecW( void *args ) ...@@ -674,6 +734,7 @@ static NTSTATUS wrap_SQLGetDescRecW( void *args )
{ {
struct SQLGetDescRecW_params *params = args; struct SQLGetDescRecW_params *params = args;
if (!pSQLGetDescRecW) return SQL_ERROR;
return pSQLGetDescRecW(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, return pSQLGetDescRecW(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength,
params->StringLength, params->Type, params->SubType, params->Length, params->StringLength, params->Type, params->SubType, params->Length,
params->Precision, params->Scale, params->Nullable); params->Precision, params->Scale, params->Nullable);
...@@ -683,6 +744,7 @@ static NTSTATUS wrap_SQLGetDiagField( void *args ) ...@@ -683,6 +744,7 @@ static NTSTATUS wrap_SQLGetDiagField( void *args )
{ {
struct SQLGetDiagField_params *params = args; struct SQLGetDiagField_params *params = args;
if (!pSQLGetDiagField) return SQL_ERROR;
return pSQLGetDiagField(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, return pSQLGetDiagField(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier,
params->DiagInfo, params->BufferLength, params->StringLength); params->DiagInfo, params->BufferLength, params->StringLength);
} }
...@@ -691,6 +753,7 @@ static NTSTATUS wrap_SQLGetDiagFieldW( void *args ) ...@@ -691,6 +753,7 @@ static NTSTATUS wrap_SQLGetDiagFieldW( void *args )
{ {
struct SQLGetDiagFieldW_params *params = args; struct SQLGetDiagFieldW_params *params = args;
if (!pSQLGetDiagFieldW) return SQL_ERROR;
return pSQLGetDiagFieldW(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, return pSQLGetDiagFieldW(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier,
params->DiagInfo, params->BufferLength, params->StringLength); params->DiagInfo, params->BufferLength, params->StringLength);
} }
...@@ -699,6 +762,7 @@ static NTSTATUS wrap_SQLGetDiagRec( void *args ) ...@@ -699,6 +762,7 @@ static NTSTATUS wrap_SQLGetDiagRec( void *args )
{ {
struct SQLGetDiagRec_params *params = args; struct SQLGetDiagRec_params *params = args;
if (!pSQLGetDiagRec) return SQL_ERROR;
return pSQLGetDiagRec(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, return pSQLGetDiagRec(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate,
params->NativeError, params->MessageText, params->BufferLength, params->NativeError, params->MessageText, params->BufferLength,
params->TextLength); params->TextLength);
...@@ -708,6 +772,7 @@ static NTSTATUS wrap_SQLGetDiagRecA( void *args ) ...@@ -708,6 +772,7 @@ static NTSTATUS wrap_SQLGetDiagRecA( void *args )
{ {
struct SQLGetDiagRecA_params *params = args; struct SQLGetDiagRecA_params *params = args;
if (!pSQLGetDiagRecA) return SQL_ERROR;
return pSQLGetDiagRecA(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, return pSQLGetDiagRecA(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate,
params->NativeError, params->MessageText, params->BufferLength, params->NativeError, params->MessageText, params->BufferLength,
params->TextLength); params->TextLength);
...@@ -717,6 +782,7 @@ static NTSTATUS wrap_SQLGetDiagRecW( void *args ) ...@@ -717,6 +782,7 @@ static NTSTATUS wrap_SQLGetDiagRecW( void *args )
{ {
struct SQLGetDiagRecW_params *params = args; struct SQLGetDiagRecW_params *params = args;
if (!pSQLGetDiagRecW) return SQL_ERROR;
return pSQLGetDiagRecW(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, return pSQLGetDiagRecW(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate,
params->NativeError, params->MessageText, params->BufferLength, params->NativeError, params->MessageText, params->BufferLength,
params->TextLength); params->TextLength);
...@@ -726,6 +792,7 @@ static NTSTATUS wrap_SQLGetEnvAttr( void *args ) ...@@ -726,6 +792,7 @@ static NTSTATUS wrap_SQLGetEnvAttr( void *args )
{ {
struct SQLGetEnvAttr_params *params = args; struct SQLGetEnvAttr_params *params = args;
if (!pSQLGetEnvAttr) return SQL_ERROR;
return pSQLGetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, return pSQLGetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -734,6 +801,7 @@ static NTSTATUS wrap_SQLGetFunctions( void *args ) ...@@ -734,6 +801,7 @@ static NTSTATUS wrap_SQLGetFunctions( void *args )
{ {
struct SQLGetFunctions_params *params = args; struct SQLGetFunctions_params *params = args;
if (!pSQLGetFunctions) return SQL_ERROR;
return pSQLGetFunctions(params->ConnectionHandle, params->FunctionId, params->Supported); return pSQLGetFunctions(params->ConnectionHandle, params->FunctionId, params->Supported);
} }
...@@ -741,6 +809,7 @@ static NTSTATUS wrap_SQLGetInfo( void *args ) ...@@ -741,6 +809,7 @@ static NTSTATUS wrap_SQLGetInfo( void *args )
{ {
struct SQLGetInfo_params *params = args; struct SQLGetInfo_params *params = args;
if (!pSQLGetInfo) return SQL_ERROR;
return pSQLGetInfo(params->ConnectionHandle, params->InfoType, params->InfoValue, return pSQLGetInfo(params->ConnectionHandle, params->InfoType, params->InfoValue,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -749,6 +818,7 @@ static NTSTATUS wrap_SQLGetInfoW( void *args ) ...@@ -749,6 +818,7 @@ static NTSTATUS wrap_SQLGetInfoW( void *args )
{ {
struct SQLGetInfoW_params *params = args; struct SQLGetInfoW_params *params = args;
if (!pSQLGetInfoW) return SQL_ERROR;
return pSQLGetInfoW(params->ConnectionHandle, params->InfoType, params->InfoValue, return pSQLGetInfoW(params->ConnectionHandle, params->InfoType, params->InfoValue,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -757,6 +827,7 @@ static NTSTATUS wrap_SQLGetStmtAttr( void *args ) ...@@ -757,6 +827,7 @@ static NTSTATUS wrap_SQLGetStmtAttr( void *args )
{ {
struct SQLGetStmtAttr_params *params = args; struct SQLGetStmtAttr_params *params = args;
if (!pSQLGetStmtAttr) return SQL_ERROR;
return pSQLGetStmtAttr(params->StatementHandle, params->Attribute, params->Value, return pSQLGetStmtAttr(params->StatementHandle, params->Attribute, params->Value,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -765,6 +836,7 @@ static NTSTATUS wrap_SQLGetStmtAttrW( void *args ) ...@@ -765,6 +836,7 @@ static NTSTATUS wrap_SQLGetStmtAttrW( void *args )
{ {
struct SQLGetStmtAttrW_params *params = args; struct SQLGetStmtAttrW_params *params = args;
if (!pSQLGetStmtAttrW) return SQL_ERROR;
return pSQLGetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, return pSQLGetStmtAttrW(params->StatementHandle, params->Attribute, params->Value,
params->BufferLength, params->StringLength); params->BufferLength, params->StringLength);
} }
...@@ -773,6 +845,7 @@ static NTSTATUS wrap_SQLGetStmtOption( void *args ) ...@@ -773,6 +845,7 @@ static NTSTATUS wrap_SQLGetStmtOption( void *args )
{ {
struct SQLGetStmtOption_params *params = args; struct SQLGetStmtOption_params *params = args;
if (!pSQLGetStmtOption) return SQL_ERROR;
return pSQLGetStmtOption(params->StatementHandle, params->Option, params->Value); return pSQLGetStmtOption(params->StatementHandle, params->Option, params->Value);
} }
...@@ -780,6 +853,7 @@ static NTSTATUS wrap_SQLGetTypeInfo( void *args ) ...@@ -780,6 +853,7 @@ static NTSTATUS wrap_SQLGetTypeInfo( void *args )
{ {
struct SQLGetTypeInfo_params *params = args; struct SQLGetTypeInfo_params *params = args;
if (!pSQLGetTypeInfo) return SQL_ERROR;
return pSQLGetTypeInfo(params->StatementHandle, params->DataType); return pSQLGetTypeInfo(params->StatementHandle, params->DataType);
} }
...@@ -787,6 +861,7 @@ static NTSTATUS wrap_SQLGetTypeInfoW( void *args ) ...@@ -787,6 +861,7 @@ static NTSTATUS wrap_SQLGetTypeInfoW( void *args )
{ {
struct SQLGetTypeInfoW_params *params = args; struct SQLGetTypeInfoW_params *params = args;
if (!pSQLGetTypeInfoW) return SQL_ERROR;
return pSQLGetTypeInfoW(params->StatementHandle, params->DataType); return pSQLGetTypeInfoW(params->StatementHandle, params->DataType);
} }
...@@ -794,6 +869,7 @@ static NTSTATUS wrap_SQLMoreResults( void *args ) ...@@ -794,6 +869,7 @@ static NTSTATUS wrap_SQLMoreResults( void *args )
{ {
struct SQLMoreResults_params *params = args; struct SQLMoreResults_params *params = args;
if (!pSQLMoreResults) return SQL_ERROR;
return pSQLMoreResults(params->StatementHandle); return pSQLMoreResults(params->StatementHandle);
} }
...@@ -801,6 +877,7 @@ static NTSTATUS wrap_SQLNativeSql( void *args ) ...@@ -801,6 +877,7 @@ static NTSTATUS wrap_SQLNativeSql( void *args )
{ {
struct SQLNativeSql_params *params = args; struct SQLNativeSql_params *params = args;
if (!pSQLNativeSql) return SQL_ERROR;
return pSQLNativeSql(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, return pSQLNativeSql(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr,
params->cbSqlStrMax, params->pcbSqlStr); params->cbSqlStrMax, params->pcbSqlStr);
} }
...@@ -809,6 +886,7 @@ static NTSTATUS wrap_SQLNativeSqlW( void *args ) ...@@ -809,6 +886,7 @@ static NTSTATUS wrap_SQLNativeSqlW( void *args )
{ {
struct SQLNativeSqlW_params *params = args; struct SQLNativeSqlW_params *params = args;
if (!pSQLNativeSqlW) return SQL_ERROR;
return pSQLNativeSqlW(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, return pSQLNativeSqlW(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr,
params->cbSqlStrMax, params->pcbSqlStr); params->cbSqlStrMax, params->pcbSqlStr);
} }
...@@ -817,6 +895,7 @@ static NTSTATUS wrap_SQLNumParams( void *args ) ...@@ -817,6 +895,7 @@ static NTSTATUS wrap_SQLNumParams( void *args )
{ {
struct SQLNumParams_params *params = args; struct SQLNumParams_params *params = args;
if (!pSQLNumParams) return SQL_ERROR;
return pSQLNumParams(params->hstmt, params->pcpar); return pSQLNumParams(params->hstmt, params->pcpar);
} }
...@@ -824,6 +903,7 @@ static NTSTATUS wrap_SQLNumResultCols( void *args ) ...@@ -824,6 +903,7 @@ static NTSTATUS wrap_SQLNumResultCols( void *args )
{ {
struct SQLNumResultCols_params *params = args; struct SQLNumResultCols_params *params = args;
if (!pSQLNumResultCols) return SQL_ERROR;
return pSQLNumResultCols(params->StatementHandle, params->ColumnCount); return pSQLNumResultCols(params->StatementHandle, params->ColumnCount);
} }
...@@ -831,6 +911,7 @@ static NTSTATUS wrap_SQLParamData( void *args ) ...@@ -831,6 +911,7 @@ static NTSTATUS wrap_SQLParamData( void *args )
{ {
struct SQLParamData_params *params = args; struct SQLParamData_params *params = args;
if (!pSQLParamData) return SQL_ERROR;
return pSQLParamData(params->StatementHandle, params->Value); return pSQLParamData(params->StatementHandle, params->Value);
} }
...@@ -838,6 +919,7 @@ static NTSTATUS wrap_SQLParamOptions( void *args ) ...@@ -838,6 +919,7 @@ static NTSTATUS wrap_SQLParamOptions( void *args )
{ {
struct SQLParamOptions_params *params = args; struct SQLParamOptions_params *params = args;
if (!pSQLParamOptions) return SQL_ERROR;
return pSQLParamOptions(params->hstmt, params->crow, params->pirow); return pSQLParamOptions(params->hstmt, params->crow, params->pirow);
} }
...@@ -845,6 +927,7 @@ static NTSTATUS wrap_SQLPrepare( void *args ) ...@@ -845,6 +927,7 @@ static NTSTATUS wrap_SQLPrepare( void *args )
{ {
struct SQLPrepare_params *params = args; struct SQLPrepare_params *params = args;
if (!pSQLPrepare) return SQL_ERROR;
return pSQLPrepare(params->StatementHandle, params->StatementText, params->TextLength); return pSQLPrepare(params->StatementHandle, params->StatementText, params->TextLength);
} }
...@@ -852,6 +935,7 @@ static NTSTATUS wrap_SQLPrepareW( void *args ) ...@@ -852,6 +935,7 @@ static NTSTATUS wrap_SQLPrepareW( void *args )
{ {
struct SQLPrepareW_params *params = args; struct SQLPrepareW_params *params = args;
if (!pSQLPrepareW) return SQL_ERROR;
return pSQLPrepareW(params->StatementHandle, params->StatementText, params->TextLength); return pSQLPrepareW(params->StatementHandle, params->StatementText, params->TextLength);
} }
...@@ -859,6 +943,7 @@ static NTSTATUS wrap_SQLPrimaryKeys( void *args ) ...@@ -859,6 +943,7 @@ static NTSTATUS wrap_SQLPrimaryKeys( void *args )
{ {
struct SQLPrimaryKeys_params *params = args; struct SQLPrimaryKeys_params *params = args;
if (!pSQLPrimaryKeys) return SQL_ERROR;
return pSQLPrimaryKeys(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLPrimaryKeys(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szSchemaName, params->cbSchemaName,
params->szTableName, params->cbTableName); params->szTableName, params->cbTableName);
...@@ -868,6 +953,7 @@ static NTSTATUS wrap_SQLPrimaryKeysW( void *args ) ...@@ -868,6 +953,7 @@ static NTSTATUS wrap_SQLPrimaryKeysW( void *args )
{ {
struct SQLPrimaryKeysW_params *params = args; struct SQLPrimaryKeysW_params *params = args;
if (!pSQLPrimaryKeysW) return SQL_ERROR;
return pSQLPrimaryKeysW(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLPrimaryKeysW(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szSchemaName, params->cbSchemaName,
params->szTableName, params->cbTableName); params->szTableName, params->cbTableName);
...@@ -877,6 +963,7 @@ static NTSTATUS wrap_SQLProcedureColumns( void *args ) ...@@ -877,6 +963,7 @@ static NTSTATUS wrap_SQLProcedureColumns( void *args )
{ {
struct SQLProcedureColumns_params *params = args; struct SQLProcedureColumns_params *params = args;
if (!pSQLProcedureColumns) return SQL_ERROR;
return pSQLProcedureColumns(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLProcedureColumns(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szProcName, params->szSchemaName, params->cbSchemaName, params->szProcName,
params->cbProcName, params->szColumnName, params->cbColumnName); params->cbProcName, params->szColumnName, params->cbColumnName);
...@@ -886,6 +973,7 @@ static NTSTATUS wrap_SQLProcedureColumnsW( void *args ) ...@@ -886,6 +973,7 @@ static NTSTATUS wrap_SQLProcedureColumnsW( void *args )
{ {
struct SQLProcedureColumnsW_params *params = args; struct SQLProcedureColumnsW_params *params = args;
if (!pSQLProcedureColumnsW) return SQL_ERROR;
return pSQLProcedureColumnsW(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLProcedureColumnsW(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szProcName, params->szSchemaName, params->cbSchemaName, params->szProcName,
params->cbProcName, params->szColumnName, params->cbColumnName); params->cbProcName, params->szColumnName, params->cbColumnName);
...@@ -895,6 +983,7 @@ static NTSTATUS wrap_SQLProcedures( void *args ) ...@@ -895,6 +983,7 @@ static NTSTATUS wrap_SQLProcedures( void *args )
{ {
struct SQLProcedures_params *params = args; struct SQLProcedures_params *params = args;
if (!pSQLProcedures) return SQL_ERROR;
return pSQLProcedures(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLProcedures(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szProcName, params->szSchemaName, params->cbSchemaName, params->szProcName,
params->cbProcName); params->cbProcName);
...@@ -904,6 +993,7 @@ static NTSTATUS wrap_SQLProceduresW( void *args ) ...@@ -904,6 +993,7 @@ static NTSTATUS wrap_SQLProceduresW( void *args )
{ {
struct SQLProceduresW_params *params = args; struct SQLProceduresW_params *params = args;
if (!pSQLProceduresW) return SQL_ERROR;
return pSQLProceduresW(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLProceduresW(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szProcName, params->szSchemaName, params->cbSchemaName, params->szProcName,
params->cbProcName); params->cbProcName);
...@@ -913,6 +1003,7 @@ static NTSTATUS wrap_SQLPutData( void *args ) ...@@ -913,6 +1003,7 @@ static NTSTATUS wrap_SQLPutData( void *args )
{ {
struct SQLPutData_params *params = args; struct SQLPutData_params *params = args;
if (!pSQLPutData) return SQL_ERROR;
return pSQLPutData(params->StatementHandle, params->Data, params->StrLen_or_Ind); return pSQLPutData(params->StatementHandle, params->Data, params->StrLen_or_Ind);
} }
...@@ -920,6 +1011,7 @@ static NTSTATUS wrap_SQLRowCount( void *args ) ...@@ -920,6 +1011,7 @@ static NTSTATUS wrap_SQLRowCount( void *args )
{ {
struct SQLRowCount_params *params = args; struct SQLRowCount_params *params = args;
if (!pSQLRowCount) return SQL_ERROR;
return pSQLRowCount(params->StatementHandle, params->RowCount); return pSQLRowCount(params->StatementHandle, params->RowCount);
} }
...@@ -927,6 +1019,7 @@ static NTSTATUS wrap_SQLSetConnectAttr( void *args ) ...@@ -927,6 +1019,7 @@ static NTSTATUS wrap_SQLSetConnectAttr( void *args )
{ {
struct SQLSetConnectAttr_params *params = args; struct SQLSetConnectAttr_params *params = args;
if (!pSQLSetConnectAttr) return SQL_ERROR;
return pSQLSetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, return pSQLSetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value,
params->StringLength); params->StringLength);
} }
...@@ -935,6 +1028,7 @@ static NTSTATUS wrap_SQLSetConnectAttrW( void *args ) ...@@ -935,6 +1028,7 @@ static NTSTATUS wrap_SQLSetConnectAttrW( void *args )
{ {
struct SQLSetConnectAttrW_params *params = args; struct SQLSetConnectAttrW_params *params = args;
if (!pSQLSetConnectAttrW) return SQL_ERROR;
return pSQLSetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, return pSQLSetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value,
params->StringLength); params->StringLength);
} }
...@@ -943,6 +1037,7 @@ static NTSTATUS wrap_SQLSetConnectOption( void *args ) ...@@ -943,6 +1037,7 @@ static NTSTATUS wrap_SQLSetConnectOption( void *args )
{ {
struct SQLSetConnectOption_params *params = args; struct SQLSetConnectOption_params *params = args;
if (!pSQLSetConnectOption) return SQL_ERROR;
return pSQLSetConnectOption(params->ConnectionHandle, params->Option, params->Value); return pSQLSetConnectOption(params->ConnectionHandle, params->Option, params->Value);
} }
...@@ -950,6 +1045,7 @@ static NTSTATUS wrap_SQLSetConnectOptionW( void *args ) ...@@ -950,6 +1045,7 @@ static NTSTATUS wrap_SQLSetConnectOptionW( void *args )
{ {
struct SQLSetConnectOptionW_params *params = args; struct SQLSetConnectOptionW_params *params = args;
if (!pSQLSetConnectOptionW) return SQL_ERROR;
return pSQLSetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); return pSQLSetConnectOptionW(params->ConnectionHandle, params->Option, params->Value);
} }
...@@ -957,6 +1053,7 @@ static NTSTATUS wrap_SQLSetCursorName( void *args ) ...@@ -957,6 +1053,7 @@ static NTSTATUS wrap_SQLSetCursorName( void *args )
{ {
struct SQLSetCursorName_params *params = args; struct SQLSetCursorName_params *params = args;
if (!pSQLSetCursorName) return SQL_ERROR;
return pSQLSetCursorName(params->StatementHandle, params->CursorName, params->NameLength); return pSQLSetCursorName(params->StatementHandle, params->CursorName, params->NameLength);
} }
...@@ -964,6 +1061,7 @@ static NTSTATUS wrap_SQLSetCursorNameW( void *args ) ...@@ -964,6 +1061,7 @@ static NTSTATUS wrap_SQLSetCursorNameW( void *args )
{ {
struct SQLSetCursorNameW_params *params = args; struct SQLSetCursorNameW_params *params = args;
if (!pSQLSetCursorNameW) return SQL_ERROR;
return pSQLSetCursorNameW(params->StatementHandle, params->CursorName, params->NameLength); return pSQLSetCursorNameW(params->StatementHandle, params->CursorName, params->NameLength);
} }
...@@ -971,6 +1069,7 @@ static NTSTATUS wrap_SQLSetDescField( void *args ) ...@@ -971,6 +1069,7 @@ static NTSTATUS wrap_SQLSetDescField( void *args )
{ {
struct SQLSetDescField_params *params = args; struct SQLSetDescField_params *params = args;
if (!pSQLSetDescField) return SQL_ERROR;
return pSQLSetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, return pSQLSetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier,
params->Value, params->BufferLength); params->Value, params->BufferLength);
} }
...@@ -979,6 +1078,7 @@ static NTSTATUS wrap_SQLSetDescFieldW( void *args ) ...@@ -979,6 +1078,7 @@ static NTSTATUS wrap_SQLSetDescFieldW( void *args )
{ {
struct SQLSetDescFieldW_params *params = args; struct SQLSetDescFieldW_params *params = args;
if (!pSQLSetDescFieldW) return SQL_ERROR;
return pSQLSetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, return pSQLSetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier,
params->Value, params->BufferLength); params->Value, params->BufferLength);
} }
...@@ -987,6 +1087,7 @@ static NTSTATUS wrap_SQLSetDescRec( void *args ) ...@@ -987,6 +1087,7 @@ static NTSTATUS wrap_SQLSetDescRec( void *args )
{ {
struct SQLSetDescRec_params *params = args; struct SQLSetDescRec_params *params = args;
if (!pSQLSetDescRec) return SQL_ERROR;
return pSQLSetDescRec(params->DescriptorHandle, params->RecNumber, params->Type, params->SubType, return pSQLSetDescRec(params->DescriptorHandle, params->RecNumber, params->Type, params->SubType,
params->Length, params->Precision, params->Scale, params->Data, params->Length, params->Precision, params->Scale, params->Data,
params->StringLength, params->Indicator); params->StringLength, params->Indicator);
...@@ -996,6 +1097,7 @@ static NTSTATUS wrap_SQLSetEnvAttr( void *args ) ...@@ -996,6 +1097,7 @@ static NTSTATUS wrap_SQLSetEnvAttr( void *args )
{ {
struct SQLSetEnvAttr_params *params = args; struct SQLSetEnvAttr_params *params = args;
if (!pSQLSetEnvAttr) return SQL_ERROR;
return pSQLSetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, params->StringLength); return pSQLSetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, params->StringLength);
} }
...@@ -1003,6 +1105,7 @@ static NTSTATUS wrap_SQLSetParam( void *args ) ...@@ -1003,6 +1105,7 @@ static NTSTATUS wrap_SQLSetParam( void *args )
{ {
struct SQLSetParam_params *params = args; struct SQLSetParam_params *params = args;
if (!pSQLSetParam) return SQL_ERROR;
return pSQLSetParam(params->StatementHandle, params->ParameterNumber, params->ValueType, return pSQLSetParam(params->StatementHandle, params->ParameterNumber, params->ValueType,
params->ParameterType, params->LengthPrecision, params->ParameterScale, params->ParameterType, params->LengthPrecision, params->ParameterScale,
params->ParameterValue, params->StrLen_or_Ind); params->ParameterValue, params->StrLen_or_Ind);
...@@ -1012,6 +1115,7 @@ static NTSTATUS wrap_SQLSetPos( void *args ) ...@@ -1012,6 +1115,7 @@ static NTSTATUS wrap_SQLSetPos( void *args )
{ {
struct SQLSetPos_params *params = args; struct SQLSetPos_params *params = args;
if (!pSQLSetPos) return SQL_ERROR;
return pSQLSetPos(params->hstmt, params->irow, params->fOption, params->fLock); return pSQLSetPos(params->hstmt, params->irow, params->fOption, params->fLock);
} }
...@@ -1019,6 +1123,7 @@ static NTSTATUS wrap_SQLSetScrollOptions( void *args ) ...@@ -1019,6 +1123,7 @@ static NTSTATUS wrap_SQLSetScrollOptions( void *args )
{ {
struct SQLSetScrollOptions_params *params = args; struct SQLSetScrollOptions_params *params = args;
if (!pSQLSetScrollOptions) return SQL_ERROR;
return pSQLSetScrollOptions(params->statement_handle, params->f_concurrency, return pSQLSetScrollOptions(params->statement_handle, params->f_concurrency,
params->crow_keyset, params->crow_rowset); params->crow_keyset, params->crow_rowset);
} }
...@@ -1027,6 +1132,7 @@ static NTSTATUS wrap_SQLSetStmtAttr( void *args ) ...@@ -1027,6 +1132,7 @@ static NTSTATUS wrap_SQLSetStmtAttr( void *args )
{ {
struct SQLSetStmtAttr_params *params = args; struct SQLSetStmtAttr_params *params = args;
if (!pSQLSetStmtAttr) return SQL_ERROR;
return pSQLSetStmtAttr(params->StatementHandle, params->Attribute, params->Value, params->StringLength); return pSQLSetStmtAttr(params->StatementHandle, params->Attribute, params->Value, params->StringLength);
} }
...@@ -1034,6 +1140,7 @@ static NTSTATUS wrap_SQLSetStmtAttrW( void *args ) ...@@ -1034,6 +1140,7 @@ static NTSTATUS wrap_SQLSetStmtAttrW( void *args )
{ {
struct SQLSetStmtAttrW_params *params = args; struct SQLSetStmtAttrW_params *params = args;
if (!pSQLSetStmtAttrW) return SQL_ERROR;
return pSQLSetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, params->StringLength); return pSQLSetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, params->StringLength);
} }
...@@ -1041,6 +1148,7 @@ static NTSTATUS wrap_SQLSetStmtOption( void *args ) ...@@ -1041,6 +1148,7 @@ static NTSTATUS wrap_SQLSetStmtOption( void *args )
{ {
struct SQLSetStmtOption_params *params = args; struct SQLSetStmtOption_params *params = args;
if (!pSQLSetStmtOption) return SQL_ERROR;
return pSQLSetStmtOption(params->StatementHandle, params->Option, params->Value); return pSQLSetStmtOption(params->StatementHandle, params->Option, params->Value);
} }
...@@ -1048,6 +1156,7 @@ static NTSTATUS wrap_SQLSpecialColumns( void *args ) ...@@ -1048,6 +1156,7 @@ static NTSTATUS wrap_SQLSpecialColumns( void *args )
{ {
struct SQLSpecialColumns_params *params = args; struct SQLSpecialColumns_params *params = args;
if (!pSQLSpecialColumns) return SQL_ERROR;
return pSQLSpecialColumns(params->StatementHandle, params->IdentifierType, params->CatalogName, return pSQLSpecialColumns(params->StatementHandle, params->IdentifierType, params->CatalogName,
params->NameLength1, params->SchemaName, params->NameLength2, params->NameLength1, params->SchemaName, params->NameLength2,
params->TableName, params->NameLength3, params->Scope, params->Nullable); params->TableName, params->NameLength3, params->Scope, params->Nullable);
...@@ -1057,6 +1166,7 @@ static NTSTATUS wrap_SQLSpecialColumnsW( void *args ) ...@@ -1057,6 +1166,7 @@ static NTSTATUS wrap_SQLSpecialColumnsW( void *args )
{ {
struct SQLSpecialColumnsW_params *params = args; struct SQLSpecialColumnsW_params *params = args;
if (!pSQLSpecialColumnsW) return SQL_ERROR;
return pSQLSpecialColumnsW(params->StatementHandle, params->IdentifierType, params->CatalogName, return pSQLSpecialColumnsW(params->StatementHandle, params->IdentifierType, params->CatalogName,
params->NameLength1, params->SchemaName, params->NameLength2, params->NameLength1, params->SchemaName, params->NameLength2,
params->TableName, params->NameLength3, params->Scope, params->Nullable); params->TableName, params->NameLength3, params->Scope, params->Nullable);
...@@ -1066,6 +1176,7 @@ static NTSTATUS wrap_SQLStatistics( void *args ) ...@@ -1066,6 +1176,7 @@ static NTSTATUS wrap_SQLStatistics( void *args )
{ {
struct SQLStatistics_params *params = args; struct SQLStatistics_params *params = args;
if (!pSQLStatistics) return SQL_ERROR;
return pSQLStatistics(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLStatistics(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->SchemaName, params->NameLength2, params->TableName,
params->NameLength3, params->Unique, params->Reserved); params->NameLength3, params->Unique, params->Reserved);
...@@ -1075,6 +1186,7 @@ static NTSTATUS wrap_SQLStatisticsW( void *args ) ...@@ -1075,6 +1186,7 @@ static NTSTATUS wrap_SQLStatisticsW( void *args )
{ {
struct SQLStatisticsW_params *params = args; struct SQLStatisticsW_params *params = args;
if (!pSQLStatisticsW) return SQL_ERROR;
return pSQLStatisticsW(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLStatisticsW(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->SchemaName, params->NameLength2, params->TableName,
params->NameLength3, params->Unique, params->Reserved); params->NameLength3, params->Unique, params->Reserved);
...@@ -1084,6 +1196,7 @@ static NTSTATUS wrap_SQLTablePrivileges( void *args ) ...@@ -1084,6 +1196,7 @@ static NTSTATUS wrap_SQLTablePrivileges( void *args )
{ {
struct SQLTablePrivileges_params *params = args; struct SQLTablePrivileges_params *params = args;
if (!pSQLTablePrivileges) return SQL_ERROR;
return pSQLTablePrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLTablePrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szTableName, params->szSchemaName, params->cbSchemaName, params->szTableName,
params->cbTableName); params->cbTableName);
...@@ -1093,6 +1206,7 @@ static NTSTATUS wrap_SQLTablePrivilegesW( void *args ) ...@@ -1093,6 +1206,7 @@ static NTSTATUS wrap_SQLTablePrivilegesW( void *args )
{ {
struct SQLTablePrivilegesW_params *params = args; struct SQLTablePrivilegesW_params *params = args;
if (!pSQLTablePrivilegesW) return SQL_ERROR;
return pSQLTablePrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, return pSQLTablePrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName,
params->szSchemaName, params->cbSchemaName, params->szTableName, params->szSchemaName, params->cbSchemaName, params->szTableName,
params->cbTableName); params->cbTableName);
...@@ -1102,6 +1216,7 @@ static NTSTATUS wrap_SQLTables( void *args ) ...@@ -1102,6 +1216,7 @@ static NTSTATUS wrap_SQLTables( void *args )
{ {
struct SQLTables_params *params = args; struct SQLTables_params *params = args;
if (!pSQLTables) return SQL_ERROR;
return pSQLTables(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLTables(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->SchemaName, params->NameLength2, params->TableName,
params->NameLength3, params->TableType, params->NameLength4); params->NameLength3, params->TableType, params->NameLength4);
...@@ -1111,6 +1226,7 @@ static NTSTATUS wrap_SQLTablesW( void *args ) ...@@ -1111,6 +1226,7 @@ static NTSTATUS wrap_SQLTablesW( void *args )
{ {
struct SQLTablesW_params *params = args; struct SQLTablesW_params *params = args;
if (!pSQLTablesW) return SQL_ERROR;
return pSQLTablesW(params->StatementHandle, params->CatalogName, params->NameLength1, return pSQLTablesW(params->StatementHandle, params->CatalogName, params->NameLength1,
params->SchemaName, params->NameLength2, params->TableName, params->SchemaName, params->NameLength2, params->TableName,
params->NameLength3, params->TableType, params->NameLength4); params->NameLength3, params->TableType, params->NameLength4);
...@@ -1120,20 +1236,133 @@ static NTSTATUS wrap_SQLTransact( void *args ) ...@@ -1120,20 +1236,133 @@ static NTSTATUS wrap_SQLTransact( void *args )
{ {
struct SQLTransact_params *params = args; struct SQLTransact_params *params = args;
if (!pSQLTransact) return SQL_ERROR;
return pSQLTransact(params->EnvironmentHandle, params->ConnectionHandle, params->CompletionType); return pSQLTransact(params->EnvironmentHandle, params->ConnectionHandle, params->CompletionType);
} }
unixlib_entry_t __wine_unix_call_funcs[NB_ODBC_FUNCS] = const unixlib_entry_t __wine_unix_call_funcs[NB_ODBC_FUNCS] =
{ {
odbc_process_attach, odbc_process_attach,
odbc_process_detach, odbc_process_detach,
wrap_SQLAllocConnect,
wrap_SQLAllocEnv,
wrap_SQLAllocHandle,
wrap_SQLAllocHandleStd,
wrap_SQLAllocStmt,
wrap_SQLBindCol,
wrap_SQLBindParam,
wrap_SQLBindParameter,
wrap_SQLBrowseConnect,
wrap_SQLBrowseConnectW,
wrap_SQLBulkOperations,
wrap_SQLCancel,
wrap_SQLCloseCursor,
wrap_SQLColAttribute,
wrap_SQLColAttributeW,
wrap_SQLColAttributes,
wrap_SQLColAttributesW,
wrap_SQLColumnPrivileges,
wrap_SQLColumnPrivilegesW,
wrap_SQLColumns,
wrap_SQLColumnsW,
wrap_SQLConnect,
wrap_SQLConnectW,
wrap_SQLCopyDesc,
wrap_SQLDataSources,
wrap_SQLDataSourcesA,
wrap_SQLDataSourcesW,
wrap_SQLDescribeCol,
wrap_SQLDescribeColW,
wrap_SQLDescribeParam,
wrap_SQLDisconnect,
wrap_SQLDriverConnect,
wrap_SQLDriverConnectW,
wrap_SQLDrivers,
wrap_SQLDriversW,
wrap_SQLEndTran,
wrap_SQLError,
wrap_SQLErrorW,
wrap_SQLExecDirect,
wrap_SQLExecDirectW,
wrap_SQLExecute,
wrap_SQLExtendedFetch,
wrap_SQLFetch,
wrap_SQLFetchScroll,
wrap_SQLForeignKeys,
wrap_SQLForeignKeysW,
wrap_SQLFreeConnect,
wrap_SQLFreeEnv,
wrap_SQLFreeHandle,
wrap_SQLFreeStmt,
wrap_SQLGetConnectAttr,
wrap_SQLGetConnectAttrW,
wrap_SQLGetConnectOption,
wrap_SQLGetConnectOptionW,
wrap_SQLGetCursorName,
wrap_SQLGetCursorNameW,
wrap_SQLGetData,
wrap_SQLGetDescField,
wrap_SQLGetDescFieldW,
wrap_SQLGetDescRec,
wrap_SQLGetDescRecW,
wrap_SQLGetDiagField,
wrap_SQLGetDiagFieldW,
wrap_SQLGetDiagRec,
wrap_SQLGetDiagRecA,
wrap_SQLGetDiagRecW,
wrap_SQLGetEnvAttr,
wrap_SQLGetFunctions,
wrap_SQLGetInfo,
wrap_SQLGetInfoW,
wrap_SQLGetStmtAttr,
wrap_SQLGetStmtAttrW,
wrap_SQLGetStmtOption,
wrap_SQLGetTypeInfo,
wrap_SQLGetTypeInfoW,
wrap_SQLMoreResults,
wrap_SQLNativeSql,
wrap_SQLNativeSqlW,
wrap_SQLNumParams,
wrap_SQLNumResultCols,
wrap_SQLParamData,
wrap_SQLParamOptions,
wrap_SQLPrepare,
wrap_SQLPrepareW,
wrap_SQLPrimaryKeys,
wrap_SQLPrimaryKeysW,
wrap_SQLProcedureColumns,
wrap_SQLProcedureColumnsW,
wrap_SQLProcedures,
wrap_SQLProceduresW,
wrap_SQLPutData,
wrap_SQLRowCount,
wrap_SQLSetConnectAttr,
wrap_SQLSetConnectAttrW,
wrap_SQLSetConnectOption,
wrap_SQLSetConnectOptionW,
wrap_SQLSetCursorName,
wrap_SQLSetCursorNameW,
wrap_SQLSetDescField,
wrap_SQLSetDescFieldW,
wrap_SQLSetDescRec,
wrap_SQLSetEnvAttr,
wrap_SQLSetParam,
wrap_SQLSetPos,
wrap_SQLSetScrollOptions,
wrap_SQLSetStmtAttr,
wrap_SQLSetStmtAttrW,
wrap_SQLSetStmtOption,
wrap_SQLSpecialColumns,
wrap_SQLSpecialColumnsW,
wrap_SQLStatistics,
wrap_SQLStatisticsW,
wrap_SQLTablePrivileges,
wrap_SQLTablePrivilegesW,
wrap_SQLTables,
wrap_SQLTablesW,
wrap_SQLTransact,
}; };
static NTSTATUS error_func( void *args )
{
return SQL_ERROR;
}
static NTSTATUS load_odbc(void) static NTSTATUS load_odbc(void)
{ {
const char *s = getenv("LIB_ODBC_DRIVER_MANAGER"); const char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
...@@ -1148,7 +1377,7 @@ static NTSTATUS load_odbc(void) ...@@ -1148,7 +1377,7 @@ static NTSTATUS load_odbc(void)
} }
#define LOAD_FUNC(name) \ #define LOAD_FUNC(name) \
__wine_unix_call_funcs[unix_##name] = (p##name = dlsym( libodbc, #name )) ? wrap_##name : error_func p##name = dlsym( libodbc, #name );
LOAD_FUNC(SQLAllocConnect); LOAD_FUNC(SQLAllocConnect);
LOAD_FUNC(SQLAllocEnv); LOAD_FUNC(SQLAllocEnv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment