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