What rights are needed to execute FindFirstVolumeMountPoint(
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
What rights are needed to execute FindFirstVolumeMountPoint(

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System
Author Message
Andy Raibeck
Guest





Posted: Fri May 28, 2004 6:56 pm    Post subject: What rights are needed to execute FindFirstVolumeMountPoint( Reply with quote

Hello,

I am trying to understand what privileges are necessary in order for
FindFirstVolumeMountPoint() to execute successfully. If I belong to the
"Administrators" group, it works fine. However, users belonging to (and only
to) "Backup Operators" fail with RC 5 (ERROR_ACCESS_DENIED).

I can not find any information on minimum privileges in the MSDN reference
information for FindFirstVolumeMountPoint(), any of the other related
information on volume management functions, or anywhere else in the MSDN.
Google and other internet searches have turned up nothing.

Apologies in advance if I am addressing the wrong newsgroup or if this
information is readily available elsewhere. Any pointers are greatly
appreciated.

The code that I am using appears below.

Thanks in advance.

Andy

///////////////////////////////////////////
#define UNICODE
#define _UNICODE
#define _WIN32_WINNT 0x0500

#include <windows.h>
#include <stdio.h>
#include <tchar.h>

#define DS_PATH_MAX 1024

int wmain(int argc, wchar_t *argv[])
{
TCHAR *lpszRootPathName = NULL;
TCHAR *lpszVolumeMountPoint = (TCHAR *)calloc(DS_PATH_MAX + 1,
sizeof(TCHAR));
DWORD cchBufferLength = DS_PATH_MAX;
HANDLE h = NULL;
int rc = 0;

if (argc == 1)
{
_tprintf(_T("Usage: VOLMPX rootpath1 [rootpath2 [rootpath3
[...] ] ]\n\n"));
_tprintf(_T(" Example: volmpx u:\\snapshots\\thu\\\n"));
return 1;
}

if (lpszVolumeMountPoint == NULL)
{
_tprintf(_T("Error: calloc() failed for lpszVolumeMountPoint.\n"));
return 1;
}

for (int i = 1; i < argc; i++)
{
lpszRootPathName = argv[i];

// Fails with ERROR_ACCESS_DENIED for backup operators.
h = FindFirstVolumeMountPoint(lpszRootPathName,
lpszVolumeMountPoint,
cchBufferLength);

if (h != INVALID_HANDLE_VALUE)
{
_tprintf(_T("FindFirstVolumeMountPoint() completed, ")
_T("lpszVolumeMountPoint = <%s>\n\n"),
lpszVolumeMountPoint);
FindVolumeMountPointClose(h);
}
else
{
_tprintf(_T("FindFirstVolumeMountPoint() failed, Win32 RC =
%lu\n\n"),
GetLastError());
rc = 1;
}
}

return rc;
}

///////////////////////////////////////////
Back to top
Tammy Culter [MSFT]
Guest





Posted: Wed Jun 02, 2004 1:44 am    Post subject: Re: What rights are needed to execute FindFirstVolumeMountPo Reply with quote

Hi Andy -- This might not be exactly the right newsgroup, but I'll try to
help you anyway! I can't find any documentation on privileges for this
function either. However, I do know that the Backup Operators group doesn't
have very many rights; IIRC, they can't even change the system time,
nevermind play around with volumes.

Hopefully, this isn't a big problem for you. You might try the Power Users
group and see what happens. Or if you need more expert advise, ask at one of
the microsoft.public.platformsdk.* newsgroups.

-Tammy Culter [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.



"Andy Raibeck" <storman@us.ibm.com> wrote in message
news:#DpzjRMREHA.3708@TK2MSFTNGP10.phx.gbl...
Quote:
Hello,

I am trying to understand what privileges are necessary in order for
FindFirstVolumeMountPoint() to execute successfully. If I belong to the
"Administrators" group, it works fine. However, users belonging to (and
only
to) "Backup Operators" fail with RC 5 (ERROR_ACCESS_DENIED).

I can not find any information on minimum privileges in the MSDN reference
information for FindFirstVolumeMountPoint(), any of the other related
information on volume management functions, or anywhere else in the MSDN.
Google and other internet searches have turned up nothing.

Apologies in advance if I am addressing the wrong newsgroup or if this
information is readily available elsewhere. Any pointers are greatly
appreciated.

The code that I am using appears below.

Thanks in advance.

Andy

///////////////////////////////////////////
#define UNICODE
#define _UNICODE
#define _WIN32_WINNT 0x0500

#include <windows.h
#include <stdio.h
#include <tchar.h

#define DS_PATH_MAX 1024

int wmain(int argc, wchar_t *argv[])
{
TCHAR *lpszRootPathName = NULL;
TCHAR *lpszVolumeMountPoint = (TCHAR *)calloc(DS_PATH_MAX + 1,
sizeof(TCHAR));
DWORD cchBufferLength = DS_PATH_MAX;
HANDLE h = NULL;
int rc = 0;

if (argc == 1)
{
_tprintf(_T("Usage: VOLMPX rootpath1 [rootpath2 [rootpath3
[...] ] ]\n\n"));
_tprintf(_T(" Example: volmpx u:\\snapshots\\thu\\\n"));
return 1;
}

if (lpszVolumeMountPoint == NULL)
{
_tprintf(_T("Error: calloc() failed for lpszVolumeMountPoint.\n"));
return 1;
}

for (int i = 1; i < argc; i++)
{
lpszRootPathName = argv[i];

// Fails with ERROR_ACCESS_DENIED for backup operators.
h = FindFirstVolumeMountPoint(lpszRootPathName,
lpszVolumeMountPoint,
cchBufferLength);

if (h != INVALID_HANDLE_VALUE)
{
_tprintf(_T("FindFirstVolumeMountPoint() completed, ")
_T("lpszVolumeMountPoint = <%s>\n\n"),
lpszVolumeMountPoint);
FindVolumeMountPointClose(h);
}
else
{
_tprintf(_T("FindFirstVolumeMountPoint() failed, Win32 RC =
%lu\n\n"),
GetLastError());
rc = 1;
}
}

return rc;
}

///////////////////////////////////////////

Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Storage System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB