⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smbpackets.h

📁 Windows CE 6.0 Server 源码
💻 H
📖 第 1 页 / 共 2 页
字号:
#define OPENX_ATTR_DIRECTORY 16
#define OPENX_ATTR_ARCHIVE   32

struct SMB_OPENX_CLIENT_REQUEST 
{   
    SMB_COM_ANDX_HEADER ANDX;
    USHORT Flags;
    USHORT Mode;
    USHORT SearchAttributes;
    USHORT FileAttributes;
    ULONG  Time;
    USHORT OpenFunction;
    ULONG FileSize;
    DWORD Timeout;
    DWORD Reserved;
    WORD ByteCount;
};

struct SMB_OPENX_SERVER_RESPONSE 
{
    SMB_COM_ANDX_HEADER ANDX;
    USHORT FileID;
    USHORT FileAttribute;
    ULONG LastModifyTime;
    ULONG  FileSize;
    USHORT OpenMode; //ie access
    USHORT FileType;
    USHORT DeviceState;
    USHORT ActionTaken;
    ULONG  ServerFileHandle;
    USHORT Reserved;
    USHORT ByteCount;
};

struct SMB_OPEN_CLIENT_REQUEST 
{   
    UCHAR WordCount;   
    USHORT Mode;
    USHORT FileAttributes;
    USHORT ByteCount;
};

struct SMB_OPEN_SERVER_RESPONSE 
{
    USHORT WordCount;
    USHORT FileID;
    USHORT FileAttribute;
    ULONG  LastModifyTime;  
    ULONG  FileSize;    
    USHORT OpenMode; //ie access
    USHORT ByteCount;
};



//from netmon
struct SMB_CLOSE_CLIENT_REQUEST 
{   
    UCHAR WordCount;
    USHORT FileID;
    ULONG FileTime;
};

struct SMB_CLOSE_SERVER_RESPONSE 
{
   BYTE WordCount;
   WORD ByteCount;   
};

#define LARGE_FILE_LOCK  0x10
#define BREAK_OPLOCK     0x2

struct SMB_LOCKX_CLIENT_REQUEST 
{   
    SMB_COM_ANDX_HEADER ANDX;
    USHORT FileID;
    USHORT LockType;
    ULONG OpenTimeout;
    USHORT NumUnlocks;
    USHORT NumLocks;
    USHORT ByteCount;
};

struct SMB_LOCKX_SERVER_RESPONSE 
{
    SMB_COM_ANDX_HEADER ANDX;
    WORD ByteCount;  
};

struct SMB_LOCK_RANGE {
    USHORT Pid;
    ULONG Offset;
    ULONG Length;
};
struct SMB_LARGELOCK_RANGE {
    SHORT Pid;
    USHORT Pad;
    ULONG OffsetHigh;
    ULONG OffsetLow;
    ULONG LengthHigh;
    ULONG LengthLow;
};


//
// Per spec in smbhlp.zip
struct SMB_SET_EXTENDED_ATTRIBUTE_CLIENT_REQUEST 
{
    BYTE WordCount;
    USHORT FileID;
    USHORT CreationDate;
    USHORT CreationTime;
    USHORT AccessDate;
    USHORT AccessTime;
    USHORT ModifyDate;
    USHORT ModifyTime;
    };

//
// Per spec in smbhlp.zip
struct SMB_SET_ATTRIBUTE_CLIENT_REQUEST 
{
    BYTE   WordCount;
    USHORT FileAttributes;
    USHORT ModifyDate;
    USHORT ModifyTime;    
    USHORT Reserved[5];
    USHORT ByteCount;
    //ASCII String (null terminated)
};


//
// Per spec in smbhlp.zip
struct SMB_FILE_FLUSH_CLIENT_REQUEST 
{
    BYTE WordCount;
    USHORT FileID;
};


// 
// Per spec in smbhlp.zip 
struct SMB_CREATE_DIRECTORY_CLIENT_REQUEST 
{   
    BYTE WordCount;
    USHORT ByteCount;
    //STRING of filename
};


// 
// Per spec in smbhlp.zip 
struct SMB_DELETE_DIRECTORY_CLIENT_REQUEST 
{   
    BYTE WordCount;
    USHORT ByteCount;
    //STRING of filename
};


// 
// Per spec in smbhlp.zip 
struct SMB_DELETE_FILE_CLIENT_REQUEST 
{   
    BYTE WordCount;
    USHORT Attributes;
    USHORT ByteCount;
    //array of bytes
};

// 
// Per spec in smbhlp.zip 
struct SMB_DELETE_FILE_SERVER_RESPONSE 
{
    BYTE WordCount;
    WORD ByteCount;
};


// 
// Per spec in smbhlp.zip 
struct SMB_RENAME_FILE_CLIENT_REQUEST 
{   
    BYTE WordCount;
    USHORT Attributes;
    USHORT ByteCount;
};


struct SMB_COM_TREE_DISCONNECT_CLIENT_REQUEST
{
    UCHAR WordCount;
    USHORT ByteCount;
};

struct SMB_COM_TREE_DISCONNECT_CLIENT_RESPONSE
{
    UCHAR WordCount;
    USHORT ByteCount;
};


//
// Per spec in smbpub.zip
struct SMB_SEEK_CLIENT_REQUEST 
{
    BYTE WordCount;
    USHORT FileID;
    USHORT Mode;
    LONG Offset;
    USHORT ByteCount;
};

//
// Per spec in smbpub.zip
struct SMB_SEEK_SERVER_RESPONSE 
{
    BYTE WordCount;
    LONG Offset;
    USHORT ByteCount;
};


//
// Per spec in smbpub.zip
struct SMB_CHECKPATH_CLIENT_REQUEST 
{
    BYTE WordCount;
    USHORT ByteCount;
    //STRING path
};

//
// Per spec in smbpub.zip
struct SMB_CHECKPATH_SERVER_RESPONSE 
{
    BYTE WordCount;
    USHORT ByteCount;
};


struct SMB_SHARE_INFO_0 
{
    char shi1_netname[13];
};

struct SMB_NET_SHARE_GET_INFO_RESPONSE 
{
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT TotalRemainingBytes;
};


struct SMB_PRQINFO_1 
{
    USHORT JobID;
    char UserName[21];
    BYTE Pad;
    char NotifyName[16];
    char DataType[10];
    char *pParams;
    USHORT Position;
    USHORT Status;
    char *pStatus;
    ULONG ulSubmitted;
    ULONG ulSize;
    char *pComment;
};

struct SMB_PRQINFO_2 
{ 
    char Name[13];
    BYTE   Pad;
    USHORT Priority;
    USHORT StartTime;
    USHORT UntilTime;
    char  *pSepFile;
    char  *pPrProc;
    char  *pDest;
    char  *pParams;
    char  *pDontKnow; //BUGBUG: I dont know what this is!
    USHORT Status;
    USHORT AuxCount;
};

struct SMB_PRQINFO_3 
{
    char *pszName;
    USHORT Priority;
    USHORT StartTime;
    USHORT UntilTime;
    USHORT Pad1;
    char *pSepFile;
    char *pPrProc;
    char *pParams;
    char *pComment;
    USHORT Status;
    USHORT cJobs;
    char *pPrinters;
    char *pDriverName;
    char *pDriverData;
};


//
// Taken from cifsprt.doc
struct PrintQueueGetInfo_PARAM_STRUCT 
{
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT TotalBytes;
};

//
//Taken off netmon + figured out what it was from the 
//  WB21BB16B109zWWzDDz... according to cifsprt.doc there should only
//  be two kinds of PRJINFO's (0 and 
struct PRJINFO_1 
{
    USHORT JobID;
    char UserName[21];
    BYTE Pad;
    char NotifyName[16];
    char DataType[10];    
    char *pParams;
    USHORT Position;
    USHORT Status;
    char *pStatus;
    ULONG ulSubmitted;
    ULONG ulSize;
    char *pComment;
};



//
// Taken from cifsrap2.doc
struct ServerGetInfo_RESPONSE_PARAMS 
{
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT TotalBytes;
};

//
// Taken from cifsrap2.doc
struct WNetWkstaGetInfo_RESPONSE_PARAMS 
{
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT TotalBytes;
};

//
// Taken from cifsrap2.doc
struct SMB_USERINFO_11 
{ 
    char *pComputerName;
    char *pUserName;
    char *pLanGroup;
    UCHAR verMajor;
    UCHAR verMinor;
    char *pDomain;
    char *pOtherDomains;
};

struct SMB_PRQINFO_0  
{
    char Name[13];
};

struct SMB_PRQ_GETINFO_RESPONSE_PARMS 
{
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT AvailableBytes;
};

struct SMB_NET_SERVER_GET_INFO
{    
    USHORT ReturnStatus;
    USHORT ConverterWord;
    USHORT AvailableBytes;
};

struct SMB_OPEN_PRINT_SPOOL_CLIENT_REQUEST 
{
    UCHAR WordCount;
    USHORT SpoolHeaderSize;
    USHORT SpoolMode;
    USHORT ByteCount; 
    //<STRING> fileName
};

struct SMB_OPEN_PRINT_SPOOL_SERVER_RESPONSE 
{
    UCHAR WordCount;
    USHORT FileID;
    BYTE ByteCount; //will be zero... subtract this out for WordCount
};


struct SMB_CLOSE_PRINT_SPOOL_CLIENT_REQUEST 
{
    UCHAR WordCount;
    USHORT FileID;
    USHORT ByteCount; 
};   

struct SMB_CLOSE_PRINT_SPOOL_SERVER_RESPONSE  
{
    UCHAR WordCount;
    USHORT ByteCount; 
};


struct SMB_WRITEX_CLIENT_REQUEST
{
    SMB_COM_ANDX_HEADER ANDX; 
    USHORT FID;
    ULONG Offset;
    ULONG Reserved;
    USHORT WriteMode;
    USHORT Remaining;
    USHORT Reserved2;
    USHORT DataLength;
    USHORT DataOffset;
    USHORT ByteCount;
    //BYTE[] -- data, please note that there may be padding, so make sure to use the dataoffset field     
};
struct SMB_WRITEX_CLIENT_REQUEST_NT
{
    SMB_COM_ANDX_HEADER ANDX; 
    USHORT FID;
    ULONG Offset;
    ULONG Reserved;
    USHORT WriteMode;
    USHORT Remaining;
    USHORT Reserved2;
    USHORT DataLength;
    USHORT DataOffset;
    ULONG OffsetHigh;
    USHORT ByteCount;
    //BYTE[] -- data, please note that there may be padding, so make sure to use the dataoffset field     
};

struct SMB_WRITEX_SERVER_RESPONSE 
{
    SMB_COM_ANDX_HEADER ANDX;
    USHORT Count;
    USHORT Remaining;
    ULONG Reserved;
    USHORT ByteCount;
};


struct SMB_WRITE_CLIENT_REQUEST 
{
    UCHAR WordCount;
    USHORT FileID;
    USHORT IOBytes;
    ULONG FileOffset;
    USHORT BytesLeft;
    USHORT ByteCount;
    BYTE Pad;
    USHORT IOBytes2;  //BUGBUG: I have no idea what the difference between these two are... got this struct from NETMON
    //BYTE[IOBytes] follows 
};   

struct SMB_WRITE_SERVER_RESPONSE 
{
    UCHAR WordCount;
    USHORT DataLength;
    USHORT ByteCount;
};


struct SMB_PRINT_JOB_PAUSE_SERVER_RESPONSE 
{
    USHORT ErrorCode;   
};

struct SMB_PRINT_JOB_SET_INFO_SERVER_RESPONSE 
{
    USHORT ErrorCode;   
    USHORT ConverterWord;
};

struct SMB_PRINT_JOB_DEL_SERVER_RESPONSE 
{
    USHORT ErrorCode;   
    USHORT ConverterWord;
};

//
// SMB TRANS2 -- TRANS2_QUERY_FS_INFORMATION
struct SMB_INFO_VOLUME_SERVER_RESPONSE 
{
    ULONG ulVolumeSerialNumber; 
    UCHAR NumCharsInLabel; //DOESNT include null, however put the NULLS in STRING!
    //STRING Label; 
};

//
// from cifs9f.doc
struct SMB_QUERY_FS_VOLUME_INFO_SERVER_RESPONSE {
    LARGE_INTEGER VolumeCreationTime;
    ULONG VolumeSerialNumber;
    ULONG LengthOfLabel;
    BYTE Reserved1;
    BYTE Reserved2;
    //STRING label
};
struct SMB_QUERY_FS_ATTRIBUTE_INFO_SERVER_RESPONSE 
{
    ULONG FileSystemAttributes;
    ULONG MaxFileNameComponent;
    ULONG NumCharsInLabel;
    //STRING Label
};

struct SMB_QUERY_INFO_ALLOCATION_SERVER_RESPONSE 
{
   ULONG idFileSystem;
   ULONG cSectorUnit;
   ULONG cUnit;
   ULONG cUnitAvail;
   USHORT cbSector;
};

struct SMB_DISK_ALLOCATION_NT
{
   ULARGE_INTEGER TotalAllocationUnits;
   ULARGE_INTEGER AvailableAllocationUnits;
   ULONG BlocksPerUnit;
   ULONG BytesPerBlock;
};

//
// Spec in cifs9f.doc
struct SMB_QUERY_FILE_ALL_INFO 
{
    LARGE_INTEGER CreationTime;
    LARGE_INTEGER LastAccessTime;
    LARGE_INTEGER LastWriteTime;
    LARGE_INTEGER ChangeTime;
    ULONG Attributes;
    ULONG Pad;
    LARGE_INTEGER AllocationSize;
    LARGE_INTEGER EndOfFile;
    ULONG NumberOfLinks;
    BOOLEAN DeletePending;
    BOOLEAN Directory;
    LARGE_INTEGER Index_Num;
    ULONG EASize;
    ULONG AccessFlags;
    LARGE_INTEGER IndexNumber;
    LARGE_INTEGER CurrentByteOffset;
    ULONG Mode;
    ULONG AlignmentRequirement;
    ULONG FileNameLength;
    //STRING FileName;
};

//
// Spec in dfaft-leach-cifs-v1-spec-01.txt
struct SMB_FILE_BASIC_INFO 
{
    LARGE_INTEGER CreationTime;
    LARGE_INTEGER LastAccessTime;
    LARGE_INTEGER LastWriteTime;
    LARGE_INTEGER ChangeTime;
    USHORT Attributes;   
};

//
// Spec from cifs9f.doc
struct SMB_QUERY_FILE_STANDARD_INFO 
{
    LARGE_INTEGER AllocationSize;
    LARGE_INTEGER EndofFile;
    ULONG NumberOfLinks;
    BOOLEAN DeletePending;
    BOOLEAN Directory;
};


struct SMB_QUERY_FILE_EA_INFO
{
    ULONG EASize;
};


struct SMB_QUERY_FILE_STREAM_INFO
{
    ULONG NextEntryOffset;
    ULONG StreamNameLength;
    LARGE_INTEGER StreamSize;
    LARGE_INTEGER StreamAllocationSize;
    //STRING filename
};

struct SMB_FILE_END_OF_FILE_INFO
{
    LARGE_INTEGER EndOfFile;
};

struct SMB_FILE_ALLOCATION_INFO
{
    LARGE_INTEGER EndOfFile;
};

struct SMB_FILE_DISPOSITION_INFO
{
    BOOLEAN FileIsDeleted;
};



struct SMB_READX_CLIENT_REQUEST  
{
    SMB_COM_ANDX_HEADER ANDX;
    USHORT FileID;
    ULONG  FileOffset;
    USHORT MaxCount;
    USHORT MinCount;
    ULONG  OpenTimeout;
    USHORT BytesLeft;
    USHORT ByteCount;  
};

struct SMB_READX_CLIENT_REQUEST_NT
{
    SMB_COM_ANDX_HEADER ANDX;
    USHORT FileID;
    ULONG  FileOffset;
    USHORT MaxCount;
    USHORT MinCount;
    ULONG  OpenTimeout;
    USHORT BytesLeft;
    ULONG  OffsetHigh;
    USHORT ByteCount;  
};


struct SMB_READX_SERVER_RESPONSE 
{ 
    SMB_COM_ANDX_HEADER ANDX;
    USHORT  BytesLeft;
    ULONG   Reserved;
    USHORT  DataLength;
    USHORT  DataOffset;
    USHORT  Reserved1; 
    ULONG   Reserved2;
    ULONG   Reserved3; 
    USHORT  ByteCount;
};


//from SMBPUB.DOC
struct SMB_READ_CLIENT_REQUEST  
{
    UCHAR  WordCount;
    USHORT FileID;
    USHORT MaxCount;
    ULONG  FileOffset;    
    USHORT Remaining;
    USHORT ByteCount;  
};

//from SMBPUB.DOC
struct SMB_READ_SERVER_RESPONSE 
{
    UCHAR  WordCount;
    USHORT Count;
    USHORT Reserved[4];
    USHORT ByteCount;
    UCHAR  BufferFormat;
    USHORT DataLength;
};


#pragma pack()

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -