security/sandbox/win/src/filesystem_dispatcher.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/win/src/filesystem_dispatcher.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#ifndef SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__
     1.9 +#define SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__
    1.10 +
    1.11 +#include "base/basictypes.h"
    1.12 +#include "sandbox/win/src/crosscall_server.h"
    1.13 +#include "sandbox/win/src/sandbox_policy_base.h"
    1.14 +
    1.15 +namespace sandbox {
    1.16 +
    1.17 +// This class handles file system-related IPC calls.
    1.18 +class FilesystemDispatcher : public Dispatcher {
    1.19 + public:
    1.20 +  explicit FilesystemDispatcher(PolicyBase* policy_base);
    1.21 +  ~FilesystemDispatcher() {}
    1.22 +
    1.23 +  // Dispatcher interface.
    1.24 +  virtual bool SetupService(InterceptionManager* manager, int service);
    1.25 +
    1.26 + private:
    1.27 +  // Processes IPC requests coming from calls to NtCreateFile in the target.
    1.28 +  bool NtCreateFile(IPCInfo* ipc, std::wstring* name, DWORD attributes,
    1.29 +                    DWORD desired_access, DWORD file_attributes,
    1.30 +                    DWORD share_access, DWORD create_disposition,
    1.31 +                    DWORD create_options);
    1.32 +
    1.33 +  // Processes IPC requests coming from calls to NtOpenFile in the target.
    1.34 +  bool NtOpenFile(IPCInfo* ipc, std::wstring* name, DWORD attributes,
    1.35 +                  DWORD desired_access, DWORD share_access,
    1.36 +                  DWORD create_options);
    1.37 +
    1.38 +    // Processes IPC requests coming from calls to NtQueryAttributesFile in the
    1.39 +  // target.
    1.40 +  bool NtQueryAttributesFile(IPCInfo* ipc, std::wstring* name, DWORD attributes,
    1.41 +                             CountedBuffer* info);
    1.42 +
    1.43 +  // Processes IPC requests coming from calls to NtQueryFullAttributesFile in
    1.44 +  // the target.
    1.45 +  bool NtQueryFullAttributesFile(IPCInfo* ipc, std::wstring* name,
    1.46 +                                 DWORD attributes, CountedBuffer* info);
    1.47 +
    1.48 +  // Processes IPC requests coming from calls to NtSetInformationFile with the
    1.49 +  // rename information class.
    1.50 +  bool NtSetInformationFile(IPCInfo* ipc, HANDLE handle, CountedBuffer* status,
    1.51 +                            CountedBuffer* info, DWORD length,
    1.52 +                            DWORD info_class);
    1.53 +
    1.54 +  PolicyBase* policy_base_;
    1.55 +  DISALLOW_COPY_AND_ASSIGN(FilesystemDispatcher);
    1.56 +};
    1.57 +
    1.58 +}  // namespace sandbox
    1.59 +
    1.60 +#endif  // SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__

mercurial