|
I want to check whether the current user has the rights to delete a file.
I've looked at two approaches. The first is to call CreateFile with the creation disposition flags set to OPEN_EXISTING. This would give the right answer most of time, apart from when the user has the delete permission explicitly disabled.
I've also looked at GetEffectiveRightsFromAcl. This looks as if this would do it for local files, but the documentation states A trustee's group rights are enumerated by GetEffectiveRightsFromAcl on the local computer, even if the trustee is accessing objects on a remote computer. This function does not evaluate group rights on remote computers. which implies that it's not going to be reliable on a network drive, which may be hosted on a different OS anyway.
Could someone suggest a better way of doing this?
|
|
|
|
|
Hello
I am doing computer engineering and i needed some guidance
regarding my project.
1st of all i want to know whether it is possible to disable usb ports
and CD rom "POWER" through VC++.
If yes then could you please guide me on it?
Thanks
|
|
|
|
|
I don't know about removing power but you can lock volumes with DeviceIoControl() with the FSCTL_LOCK_VOLUME which means that your process has exclusive access to that volume. Take a look at the documentation here. You could do this with the CD drive.
You can disable USB ports from the registry (which can be done programatically); take a look at this article for more info.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
modified on Friday, August 22, 2008 8:44 AM
|
|
|
|
|
thank you so much for ur replies Perspx, Jijo raj and Vikas..
but r u sure that after disabling the ports from registry , the power to the port will b cut??
|
|
|
|
|
ameyakoshti wrote: 1st of all i want to know whether it is possible to disable usb ports
To disable USB ports, check this[^]. You have to programatically access the registry and set the key.
ameyakoshti wrote: and CD rom "POWER" through VC++.
I hope someone else will shed light on this.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
|
Hello everyone,
I want to find some sample codes about how to do .Net passport authentication if I am writing a client using native unmanaged C++. But nothing found during search.
Does anyone have any referred samples or documents?
thanks in advance,
George
|
|
|
|
|
George_George wrote: But nothing found during search.
Does anyone have any referred samples or documents?
Well I don't and I am not going to do your Googling for you today. I have more interesting things to do.
led mike
|
|
|
|
|
Hi led mike,
I have Googled for quite some time but find nothing about prorgamming with .Net passport authentication (all I found is dealing with how to register a .Net passport), it is why I come here to ask for referred documents. Any ideas?
regards,
George
|
|
|
|
|
George_George wrote: I have Googled for quite some time but find nothing about prorgamming with .Net passport authentication
So did you find this yet George?[^]
led mike
|
|
|
|
|
Hi led mike,
Good document! Is Windows Live ID authentication the same as .Net passport authentication?
regards,
George
|
|
|
|
|
Hi led mike,
I read through the document and it looks like an SDK for a web site. But my application is not web site, it is a client side C++ program, which access some web page for data rendering, and I need to use the passport/Live ID to access the web page.
Any ideas or comments?
regards,
George
|
|
|
|
|
George_George wrote: But my application is not web site, it is a client side C++ program, which access some web page for data rendering, and I need to use the passport/Live ID to access the web page.
George, in my opinion explaining all this to you is beyond the scope of an internet forum conversation. Maybe you should spend some time studying the materials that Microsoft has made available to developers for integrating Windows Live Authentication.[^]
At the end of the day, these are all services provided by Microsoft and they work the way they made them work, period. That's what you must deal with rather than what you might want it to be. Obviously the most prevalent use of integration is for Web Sites. This does not necessarily mean that C++ integration is not possible but, if it is possible, you may have to develop it yourself rather than being provided with a function that does it for you.
"Web Authentication works by sending your users to the Windows Live ID sign-in page by means of a specially formatted link."
led mike
|
|
|
|
|
Thanks for your advice, led mike! For the link you provided, which one(s) are dealing with authentication? I checked a few, but not dedicated for authentication purpose. Any comments?
regards,
George
|
|
|
|
|
George_George wrote: For the link you provided, which one(s) are dealing with authentication? I checked a few, but not dedicated for authentication purpose.
I don't that any are dedicated to authentication. You seem to need an overall better understanding of the Platform you are trying to interface with.
led mike
|
|
|
|
|
Thanks all the same led mike!
regards,
George
|
|
|
|
|
Iam Developed one application(With some Data Base) in VC++ 6.0 environment.
The Exe(in Release mode)is working fine in VC++, .NET systems either
the system OS is XP or 2000.
But i was Stucked at some systems that are not had VC++ and .NET.
here iam not able open Database connection.
iam not able to get the bug.is it any DLL problem?
|
|
|
|
|
There is missing some stuff for the database access as drivers or dll. You got to find where the errors happen. For that it is essential to make error handling in your app: writing a log or giving out messageboxes on errors.
Greetings from Germany
|
|
|
|
|
Mr.KarstenK,
Thank you.
I have to Access Some database window after clicking some button in GUI.
its working properly in VC and .NET based systems.
iam facing some problem in non VC and .NET based systems.Here iam not able to access the database window after clicking the button where as in VC n .Net systems...its working fine
|
|
|
|
|
krishna Vuppala wrote: But i was Stucked at some systems that are not had VC++ and .NET.
Is part of your application written for .NET?
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
no its written for VC++.
but i tested the EXE(in release mode) file in Various systems in my office.
|
|
|
|
|
Hi all
I met a confusing issue, just as the title says.
There's a network printer installed in my machine. And in my code when I open this printer with "OpenPrinter" API, it will failed. But, in fact the printer is OK, because I can use it to print in Notepad.
My code is:
HANDLE hPrinter = NULL;
PRINTER_DEFAULTS PDef;
PDef.pDatatype = NULL;
PDef.pDevMode = NULL;
BOOL bRet = OpenPrinter(_T("\\\\172.xx.xxx.xx\\HP LaserJet 1020"), &hPrinter, &PDef);
What confuses me most is that, the "OpenPrinter" API doesn't faill in all test machines. Only in some machines it fails. In most test machines, it is OK to open the printer.
I checked the printer and the test machines, however nothing wrong was found.
And what's more, when OpenPrinter fails, the error code is 5, which means "Access is denied". It seems that the test machines can't access the printer. But it does printing operation OK!
What's the problem with my machine?
Any response will be appreciated very much!
|
|
|
|
|
Unfortunately their are 2 OpenPrinter APIs, one in Winspool.lib and one in SpoolSS.dll. If you use the wrong one then horrible, and not easily predictable, things occur. I suggest you check this out first, determine which one you're calling, try the other one and if things are no better or worse then feel free to vote this a bad answer.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Matthew Faithfull wrote: Unfortunately their are 2 OpenPrinter APIs, one in Winspool.lib and one in SpoolSS.dll. If you use the wrong one then horrible, and not easily predictable, things occur. I suggest you check this out first, determine which one you're calling, try the other one and if things are no better or worse then feel free to vote this a bad answer.
Matthew Faithfull, thank you very much.
I will check it.
|
|
|
|
|