msg_file_lock.go 544 B

1234567891011121314151617181920212223242526272829303132
  1. package smb
  2. func init() {
  3. commandRequestMap[CommandLock] = func() DataI {
  4. return &LockRequest{}
  5. }
  6. }
  7. //CommandLock
  8. type LockRequest struct {
  9. Header
  10. StructureSize uint16
  11. Reserved1 uint16
  12. Reserved2 uint32
  13. FileId GUID
  14. }
  15. type LockResponse struct {
  16. Header
  17. StructureSize uint16
  18. Reserved uint16
  19. }
  20. func (data *LockRequest) ServerAction(ctx *DataCtx) (interface{}, error) {
  21. data.Header.Flags = SMB2_FLAGS_RESPONSE
  22. resp := LockResponse{
  23. Header: data.Header,
  24. StructureSize: 0x0004,
  25. }
  26. return &resp, nil
  27. }