|
I'm getting my first taste of the nasty world of NT security issues, so please bare with me if this comes across as one of those newbie questions.
It is important that my program is allowed access to every file/folder on a volume. I realise to do this I must add an ACL into the file/folders' DACL. I am able to do this without any problems. But here is the problem, so far I have been adding the looged on users SID to the ACL, storing the old DACL and replacing it on program termination. But, it has come to my attention that this is opening a serious hole in NT's security.
If my program does not perform a clean exit, those DACLs will never be replaced, leaving the file/folders' wide open.
Is there any other way to do this? Is it possible to add an ACL for my current process and not need to re-adjust the objects security once finished? ie, once the process no longer exists, theoretically the SID would become invalid, would windows perform an auto cleanup?
All the examples I have found relate to taking ownership and completely re-writing the security, rather than updating it. Also I have found nothing regarding 'SID of current process'.
Waldermort
|
|
|
|
|
i need to write a short C++ program that outputs all possible strings formed by using each the characters 'a', 'b', 'c', 'd', 'e', and 'f' exactly once. But I can't find a way to solve the problem.... plz help me, thank u
|
|
|
|
|
do you mean only a to f or a to z.
if you can just narrate an example,
i can write the code for you.
|
|
|
|
|
it's only from a to f...
thank you
|
|
|
|
|
And if you look for in the forum you will probably find something. This question was already asked days ago.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
i tried to search the topic, but i can't find anything that's related
|
|
|
|
|
Try something list this:
------------------------
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void main()
{
string s = "abcdef";
sort(s.begin(), s.end());
cout << s << endl;
while (next_permutation(s.begin(), s.end()))
{
cout << s << endl;
}
}
Steve
|
|
|
|
|
Thank you very much.
is it possible not using the "next_permutation" function?
|
|
|
|
|
Look at its source code, it comes with your compiler.
Steve
|
|
|
|
|
nethp1020 wrote: is it possible not using the "next_permutation" function?
Yes, but why?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: but why?
Because the professor may know it came from an outside source?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
When seeing in menu, there is no shortcut for increse/decrease indent.
If there is shortcut, it will be handy while coding.
Does anyone know there is any shortcut for this?
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: If there is shortcut
Select those text and press tab or shift + tab
|
|
|
|
|
nice naveen.
there is one more technique to auto indent the code.
that is, select the whole file (ctrl +A) or a portion of the code(obviously a block) and press Alt + F8 key.
this will automatically indent the code snippet.
|
|
|
|
|
Hi, Thanks for the help.
In my system, Tab & Shift + tab works well but Alt + F8 opens Macro explorer.
Best Regards,
Suman
|
|
|
|
|
r u using visual studio 6.0?
if that is so then alt+f8 should work.
|
|
|
|
|
chandu004 wrote: if that is so then alt+f8 should work.
But only if Smart indent is enabled.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi!!
I am using VC++ .Net 2003.
As tab and shift + tab are working, it is well enough for coding.
Thanks for the help.
Best Regards,
Suman
|
|
|
|
|
Hi Naveen,
Thanks for your help!!
Best Regards,
Suman
|
|
|
|
|
I've returned to using MFC after a long absence. I've been writing some custom controls for a project. As I recall there are steps you can take to use double buffering. I think they're set in PreCreateWindow. I've been googling and looking through old projects of mine, but I just can't seem to discover what I'm looking for.
Maybe my memory is playing tricks on me, but it seems like there were flags you could set that could control painting to enable double buffering.
Anyway, any help is appreciated for this prodigal MFC programmer.
[EDIT]
The System.Windows.Forms.Control equivalent is SetStyle.
[/EDIT]
-- modified at 18:44 Sunday 30th September, 2007
|
|
|
|
|
I don't think it's built into MFC like it is WinForms. You need to do all your drawing on a compatible memory DC, then BitBlt it to the device context in WM_PAINT (OnPaint).
This might help: http://www.codeproject.com/gdi/flickerfree.asp
[^]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Were you thinking of the WS_EX_COMPOSITED extended window style?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Were you thinking of the WS_EX_COMPOSITED extended window style?
That doesn't ring a bell. At this point, I think my memory may just be playing tricks on me; I'm misremembering some C# custom controls I created a couple of years ago where I used SetStyle to enable double buffering. I thought that there was an MFC equivalent, but I think I may be mistaken.
I will investigate the WS_EX_COMPOSITED style.
|
|
|
|
|
Hi,
I am programming something for school and I have a dialog based MFC application. But in the first screen some date is saved in an array that contains variables from a certain structure. The problem is that a second window has to be opened to make a mathematical calculation after having insered some numbers. But I can't get it to work. I can't acces the data from the other dialog.
Could someone please help me?
Already a lot of thanks in advance,
Steven
|
|
|
|
|
minike wrote: I can't acces the data from the other dialog.
Some how you need pass the pointer of the first dialog to the second dialog so that the second dialog can access data from the first dialog through that pointer.
|
|
|
|