text: /*
   * ----------------------------------------------------------------------------
   * Copyright (c) 2014-2015 BigObject Inc.
   * All Rights Reserved.
   *
   * Use of, copying, modifications to, and distribution of this software
   * and its documentation without BigObject's written permission can
   * result in the violation of U.S., Taiwan and China Copyright and Patent laws.
   * Violators will be prosecuted to the highest extent of the applicable laws.
   *
   * BIGOBJECT MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
   * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
   * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   * PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
   * ----------------------------------------------------------------------------
   */
  
  #include "Driver.hpp"
  
  /*
  https://msdn.microsoft.com/en-us/library/ms713591%28v=vs.85%29.aspx
  */
  
  SQLRETURN SQL_API SQLExtendedFetch(
   SQLHSTMT StatementHandle, SQLUSMALLINT FetchOrientation,
   SQLLEN FetchOffset, SQLULEN *RowCountPtr, SQLUSMALLINT *RowStatusArray)
  {
   HDRVSTMT hStmt = (HDRVSTMT)StatementHandle;
  
   LOG_DEBUG_F_FUNC(
    TEXT("%s: StatementHandle = 0x%08lX, ")
    TEXT("FetchOrientation = %d, FetchOffset = %d, ")
    TEXT("RowCountPtr = 0x%08lX, RowStatusArray = 0x%08lX"),
    LOG_FUNCTION_NAME, 
    (long)StatementHandle, FetchOrientation, FetchOffset, 
    (long)RowCountPtr, (long)RowStatusArray);
  
   /* SANITY CHECKS */
   ODBCAPIHelper helper(hStmt, SQL_HANDLE_STMT);
   if(!helper.IsValid())
    return SQL_INVALID_HANDLE;
  
   API_HOOK_ENTRY(SQLExtendedFetch, 
    StatementHandle, FetchOrientation, FetchOffset, RowCountPtr, RowStatusArray);
   
   API_HOOK_RETURN(helper.FetchScroll(FetchOrientation, FetchOffset, 
                                      RowCountPtr, RowStatusArray));
  }
  