Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kasra Jamshidi
slapos.package
Commits
33494024
Commit
33494024
authored
May 29, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not retrieve TotalNumberOfFreeBytes to improve performance.
parent
ba04f114
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
windows/netreport/src/netuse.c
windows/netreport/src/netuse.c
+18
-5
No files found.
windows/netreport/src/netuse.c
View file @
33494024
...
@@ -137,7 +137,21 @@ netuse_map_drive(PyObject *self, PyObject *args)
...
@@ -137,7 +137,21 @@ netuse_map_drive(PyObject *self, PyObject *args)
PyErr_SetString
(
PyExc_RuntimeError
,
"Not Implemented"
);
PyErr_SetString
(
PyExc_RuntimeError
,
"Not Implemented"
);
return
NULL
;
return
NULL
;
}
}
/*
* Travel all the mapped drive to check whether there is duplicated
* shared folder:
*
* Return 1 if current share folder is same or sub-folder of the
* mapped folder;
*
* Return -1 if unknown exception occurs;
*
* Remove mapped item from list if the mapped folder is sub-folder
* of current share folder.
*
* Return 0 if it's new share folder.
*
*/
static
int
static
int
check_duplicate_shared_folder
(
PyObject
*
retvalue
,
const
char
*
folder
)
check_duplicate_shared_folder
(
PyObject
*
retvalue
,
const
char
*
folder
)
{
{
...
@@ -150,7 +164,7 @@ check_duplicate_shared_folder(PyObject *retvalue, const char *folder)
...
@@ -150,7 +164,7 @@ check_duplicate_shared_folder(PyObject *retvalue, const char *folder)
PyObject
*
item
;
PyObject
*
item
;
char
*
s
;
char
*
s
;
while
(
size
)
{
while
(
size
>
0
)
{
size
--
;
size
--
;
item
=
PySequence_GetItem
(
retvalue
,
size
);
item
=
PySequence_GetItem
(
retvalue
,
size
);
if
(
!
PySequence_Check
(
item
))
if
(
!
PySequence_Check
(
item
))
...
@@ -275,13 +289,12 @@ netuse_usage_report(PyObject *self, PyObject *args)
...
@@ -275,13 +289,12 @@ netuse_usage_report(PyObject *self, PyObject *args)
if
(
GetDiskFreeSpaceEx
(
drivepath
,
if
(
GetDiskFreeSpaceEx
(
drivepath
,
&
lFreeBytesAvailable
,
&
lFreeBytesAvailable
,
&
lTotalNumberOfBytes
,
&
lTotalNumberOfBytes
,
&
lTotalNumberOfFreeBytes
NULL
))
{
))
{
PyObject
*
pobj
=
Py_BuildValue
(
"ssLLL"
,
PyObject
*
pobj
=
Py_BuildValue
(
"ssLLL"
,
drivename
,
drivename
,
szRemoteName
,
szRemoteName
,
lFreeBytesAvailable
,
lFreeBytesAvailable
,
lTotalNumberOfFreeBytes
,
lTotalNumberOfBytes
lTotalNumberOfBytes
);
);
if
(
PyList_Append
(
retvalue
,
pobj
)
==
-
1
)
{
if
(
PyList_Append
(
retvalue
,
pobj
)
==
-
1
)
{
...
@@ -329,7 +342,7 @@ static PyMethodDef NetUseMethods[] = {
...
@@ -329,7 +342,7 @@ static PyMethodDef NetUseMethods[] = {
(
(
"usagereport(servername='')
\n\n
"
"usagereport(servername='')
\n\n
"
"Return a tuple to report all the net drive information:
\n
"
"Return a tuple to report all the net drive information:
\n
"
"
(drive, remote, available, free, total).
\n
"
"
[ (drive, remote, available, total), ... ]
\n
"
"If servername is not empty, then only net drives in the specified server
\n
"
"If servername is not empty, then only net drives in the specified server
\n
"
"are returned.
\n
"
"are returned.
\n
"
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment