Ignore:
Timestamp:
01/16/09 13:36:04 (15 years ago)
Author:
tim
Message:

rewrote winsec library, stripping out Samba dependencies

eliminated remaining Samba prs functions

added support for 'li' subkey list records

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/smb_deps.h

    r132 r134  
    2929#include <stdlib.h>
    3030#include <stdbool.h>
     31#include <stdint.h>
    3132#include <stdio.h>
    3233#include <string.h>
     
    4647/* From includes.h */
    4748
    48 #define uint8 unsigned char
    49 #define int16 short
    50 #define uint16 unsigned short
    51 #define int32 int
    52 #define uint32 unsigned int
    53 
    54 #define SMB_STRUCT_STAT struct stat
    55 #define QSORT_CAST (int (*)(const void *, const void *))
     49#define uint8  uint8_t
     50#define int16  int8_t
     51#define uint16 uint16_t
     52#define int32  int32_t
     53#define uint32 uint32_t
    5654
    5755#define MIN(a,b) ((a)<(b)?(a):(b))
     
    5957
    6058extern int DEBUGLEVEL;
    61 
    62 #define DLIST_ADD(list, p) \
    63 { \
    64         if (!(list)) { \
    65                 (list) = (p); \
    66                 (p)->next = (p)->prev = NULL; \
    67         } else { \
    68                 (list)->prev = (p); \
    69                 (p)->next = (list); \
    70                 (p)->prev = NULL; \
    71                 (list) = (p); \
    72         }\
    73 }
    7459
    7560/* End of stuff from includes.h */
     
    8469
    8570/* End of stuff from smb.h */
    86 
    87 /* From smb_macros.h */
    88 
    89 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
    90 #define SMB_MALLOC_P(type) (type *)malloc_(sizeof(type))
    91 #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
    92 #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
    93 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
    94 
    95 /* End of stuff from smb_macros.h */
    96 
    97 /* From ntdomain.h */
    98 
    99 struct uuid {
    100        uint32 time_low;
    101        uint16 time_mid;
    102        uint16 time_hi_and_version;
    103        uint8  clock_seq[2];
    104        uint8  node[6];
    105 };
    106 
    107 typedef struct _prs_struct {
    108         bool io; /* parsing in or out of data stream */
    109         /*
    110          * If the (incoming) data is big-endian. On output we are
    111           * always little-endian.
    112            */
    113            bool bigendian_data;
    114            uint8 align; /* data alignment */
    115            bool is_dynamic; /* Do we own this memory or not ? */
    116            uint32 data_offset; /* Current working offset into data. */
    117            uint32 buffer_size; /* Current allocated size of the buffer. */
    118            uint32 grow_size; /* size requested via prs_grow() calls */
    119            char *data_p; /* The buffer itself. */
    120            void *mem_ctx; /* When unmarshalling, use this.... */
    121 } prs_struct;
    122 
    123 #define MARSHALL 0
    124 #define UNMARSHALL 1
    125 
    126 #define RPC_LITTLE_ENDIAN  0
    127 #define RPC_PARSE_ALIGN    4
    128 
    129 /* End of stuff from ntdomain.h */
    130 
    13171
    13272/* From lib/time.c */
     
    14383/* End of stuff from lib/time.c */
    14484
    145 /* From rpc_dce.h */
    146 
    147 #define MAX_PDU_FRAG_LEN 0x10b8 /* this is what w2k sets */
    148 
    149 /* End of stuff from rpc_dce.h */
    150 
    151 /* From parse_prs.h */
    152 
    153 bool prs_grow(prs_struct *ps, uint32 extra_space);
    154 bool prs_align(prs_struct *ps);
    155 bool prs_init(prs_struct *ps, uint32 size, void *ctx, bool io);
    156 char *prs_mem_get(prs_struct *ps, uint32 extra_size);
    157 bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32);
    158 bool prs_uint32s(const char *name, prs_struct *ps,
    159                  int depth, uint32 *data32s, int len);
    160 bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16);
    161 bool prs_uint16_pre(const char *name, prs_struct *ps, int depth,
    162                     uint16 *data16, uint32 *offset);
    163 bool prs_uint16_post(const char *name, prs_struct *ps, int depth,
    164                      uint16 *data16, uint32 ptr_uint16, uint32 start_offset);
    165 bool prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8);
    166 bool prs_uint8s(const char *name, prs_struct *ps, int depth,
    167                 uint8* data8s, int len);
    168 bool prs_set_offset(prs_struct *ps, uint32 offset);
    169 
    170 /* End of stuff from parse_prs.h */
    171 
    172 
    173 /* From pstring.h */
    174 
    175 #define FSTRING_LEN 256
    176 typedef char fstring[FSTRING_LEN];
    177 
    178 /* End of stuff from pstring.h */
    179 
    180 /* From rpc_parse/parse_misc.c */
    181 
    182 bool smb_io_uuid(const char *desc, struct uuid *uuid,
    183                  prs_struct *ps, int depth);
    184 bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth);
    185 
    186 /* End of stuff from rpc_parse/parse_misc.c */
    187 
    18885#endif /* _SMB_DEPS_H */
Note: See TracChangeset for help on using the changeset viewer.