1 | /* $Id: VBoxServiceControlDir.cpp 37375 2011-06-08 10:51:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxServiceControlDir - Utility functions for guest directory handling.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #include <iprt/assert.h>
|
---|
23 | #include <VBox/VBoxGuestLib.h>
|
---|
24 | #include <VBox/HostServices/GuestControlSvc.h>
|
---|
25 |
|
---|
26 | #include "VBoxServiceInternal.h"
|
---|
27 | #include "VBoxServiceUtils.h"
|
---|
28 |
|
---|
29 | using namespace guestControl;
|
---|
30 |
|
---|
31 | int VBoxServiceGCtrlDirClose(uint32_t u32ClientId, uint32_t uNumParms)
|
---|
32 | {
|
---|
33 | uint32_t uContextID;
|
---|
34 | uint32_t uHandle;
|
---|
35 |
|
---|
36 | int rc = VbglR3GuestCtrlGetCmdDirClose(u32ClientId, uNumParms,
|
---|
37 | &uContextID, &uHandle);
|
---|
38 | if (RT_SUCCESS(rc))
|
---|
39 | {
|
---|
40 |
|
---|
41 | }
|
---|
42 | else
|
---|
43 | VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve close command! Error: %Rrc\n", rc);
|
---|
44 | VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirClose returned with %Rrc\n", rc);
|
---|
45 | return rc;
|
---|
46 | }
|
---|
47 |
|
---|
48 | int VBoxServiceGCtrlDirOpen(uint32_t u32ClientId, uint32_t uNumParms)
|
---|
49 | {
|
---|
50 | uint32_t uContextID;
|
---|
51 | char szDir[_1K];
|
---|
52 | char szFilter[_1K];
|
---|
53 | uint32_t uFlags;
|
---|
54 | char szUser[128];
|
---|
55 | char szPassword[128];
|
---|
56 |
|
---|
57 | int rc = VbglR3GuestCtrlGetCmdDirOpen(u32ClientId, uNumParms,
|
---|
58 | &uContextID,
|
---|
59 | szDir, sizeof(szDir),
|
---|
60 | szFilter, sizeof(szFilter),
|
---|
61 | &uFlags,
|
---|
62 | szUser, sizeof(szUser),
|
---|
63 | szPassword, sizeof(szPassword));
|
---|
64 | if (RT_SUCCESS(rc))
|
---|
65 | {
|
---|
66 |
|
---|
67 | }
|
---|
68 | else
|
---|
69 | VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve open command! Error: %Rrc\n", rc);
|
---|
70 | VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirOpen returned with %Rrc\n", rc);
|
---|
71 | return rc;
|
---|
72 | }
|
---|
73 |
|
---|
74 | int VBoxServiceGCtrlDirRead(uint32_t u32ClientId, uint32_t uNumParms)
|
---|
75 | {
|
---|
76 | uint32_t uContextID;
|
---|
77 | uint32_t uHandle;
|
---|
78 |
|
---|
79 | int rc = VbglR3GuestCtrlGetCmdDirRead(u32ClientId, uNumParms,
|
---|
80 | &uContextID, &uHandle);
|
---|
81 | if (RT_SUCCESS(rc))
|
---|
82 | {
|
---|
83 |
|
---|
84 | }
|
---|
85 | else
|
---|
86 | VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve read command! Error: %Rrc\n", rc);
|
---|
87 | VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirRead returned with %Rrc\n", rc);
|
---|
88 | return rc;
|
---|
89 | }
|
---|
90 |
|
---|