Transact 1.82 KB
Newer Older
Stewart Brodie's avatar
Stewart Brodie committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
/* Copyright 1998 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
*
*  Transact.h  -- SMB Transact and Transact2 related support routines
*
*  08-12-98 sbrodie  Original
*
*/

#define SEARCH_ST_SIZE  21

typedef struct ActiveShare  *hSHARE;

union Transact_SearchContext {
  struct Transact1_SearchContext {
    bool NextSearchOK;
    BYTE SearchState[SEARCH_ST_SIZE];
    hSHARE SearchDrive;
  } t1;
  struct Transact2_SearchContext {
    struct Transact1_SearchContext t1;
    struct TransactParms tp;
    DWORD resume_key;
    WORD dir_handle;
    char last_filename[DOS_NAME_LEN];
  } t2;
};


extern void Transact_addword(struct TransactParms *TP, int value);
extern void Transact_addlong(struct TransactParms *TP, long value);
extern void Transact_addstring(struct TransactParms *TP, const char *str);

extern WORD Transact_getword(BYTE *p);
extern DWORD Transact_getlong(BYTE *p);
extern BYTE *Transact_getpointer(struct TransactParms *TP, BYTE *p);

extern void Transact_addsetupword(struct TransactParms *TP, int value);

/* The following function is used only by TRANSACT2_FSCTL - beware of
 * the length limit on path - see define for MAX_SETUPWORDS in SMB.h */
extern void Transact_addroutepath(struct TransactParms *TP, const char *path);

extern void Transact_init(struct TransactParms *TP, int ret_param_len);