|
Errr... thanks?!?
just kidding, in fact that what I was getting to that you can improve your premission state. well, it's interesting to hear about the account thing, but if I use two processes at the same account and one has less premmission by definition of the programmer at the creation time, I think it will be able to get the maximum premissions of the user that is now logged on.
I guess we will have to try and learn
thanks,
Guy.
|
|
|
|
|
Oh, seems I have confused you a bit by all this security stuff
Sorry about that, but here we have to go on
Anonymous wrote:
but if I use two processes at the same account and one has less premmission by definition of the programmer at the creation time, I think it will be able to get the maximum premissions of the user that is now logged on.
Uh, oh no I am a bit confused. The thing is, there is no "limitation of permissions at creation time". NT security is completly user related. Of course, the programer decides which kind of access rights his program code utilizes e.g. by simply not doing any write operations. But thats not a limitation of the access rights of the process which executes the program.
It's simply the difference between beeing forbidden to do something and just not doing it. Only the user context of the process defines what is allowed and forbidden.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
Hi all,
I have a basic question regarding size of struct.
I have following code:
struct MyStruct
{
int PortAddress;
char onmask;
char offmask;
int *PortData;
};
void main(void)
{
struct MyStruct m_struct;
int* pInt;
printf("size of char = %d\n",sizeof(char));
printf("size of int = %d\n",sizeof(int));
printf("size of int Pointer= %d\n",sizeof(pInt));
printf("size of MyStruct= %d\n",sizeof(m_struct));
}
Out put looks like:
size of char = 1
size of int = 4
size of int Pointer = 4
size of MyStruct= 12
Now my question is why I get the size of Mystruct = 12 instead of 10 (4 + 1 +1 + 4) ?
thanks for help
regards
/rsasalm
|
|
|
|
|
Struct member alignment in the compiler options.
Normski. - the next bit of code is self modifying ... jmp 0xCODE
|
|
|
|
|
I try to intercept some message coming from a menu item.
I get correct values for nID and nCode when rolling over the menu item. When clicking, nID points to something that seems unrecognizable.
How should i get the click?
rechi
|
|
|
|
|
I think nID is the handle of the menu...
|
|
|
|
|
Is there any special requirement that stops you from using message map and handler for nID?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Yes, it is. I have to handle dinamically added menus, in the main frame's queue. Thus, i cannot provide message map entries because i don't use static menu structure. Also i have to filter the menu messages before they reach the view's queue.
Anyway, PreTranslateMessage solved the problem.
rechi
|
|
|
|
|
Assuming that your dynamic ids are located in predefined range, you may also use ON_COMMAND_RANGE.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hai ...
I just want to know what is the reason to display exception error of this simple code ?
CFileDialog cfdlg(true, NULL, NULL, 0,"Sound Files (*.wav; *.mp3)|*.wav;*.mp3||", this);
end exception is :
-------
First-chance exception in kTalk.exe (KERNEL32.DLL): 0x000006B5: (none)
First-chance exception in kTalk.exe (KERNEL32.DLL): 0x000006B5: (none)
-------
it does not occures if opendlg.Flags &= ~OFN_EXPLORER is set ...
i am running w2k Advanced Server ... and have not any probles with other apps.
Downloading some demos from here I also have this exceptions .. ):
maybe somebody knows, how to thix this bug !??
thanks.
----------------------------
my eng is bad, so am i .. (:
|
|
|
|
|
|
Are you sure to do this !??
Is this OK for W2k !? (-:
but i want to get app without any exceptions ... (:
----------------------------
my eng is bad, so am i .. (:
|
|
|
|
|
Your program actually crashes, or you're just getting 'first-chance exception' in output pane when running under debugger?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Yee .. a have just exception in debuger pane....
but program still works correctly and all vars are correctly written ...
just when changing filter, this exception occures ...
- when changing to old style dialog (win95), everything is OK !!
----------------------------
my eng is bad, so am i .. (:
|
|
|
|
|
Don't worry about these first-chance exceptions - they're used as signaling mechanism by Windows itself. See KB article Q105675 for more details.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I want to capture file system events.eg when one copies a file from one folder to another,I want to be able to capture this event. Or someone deletes a particular file. Which events I need to capture for that?
It would be gr8 if someone can atleast give some pointers to that
Thanks
sunil
|
|
|
|
|
See: FindFirstChangeNotification, FindNextChangeNotification, FindCloseChangeNotification; ReadDirectoryChangesW.
|
|
|
|
|
I want to add links in the system pop up menus.eg When u right click any file icon on windows,a pop up menus appear having options (Open,Print,Sendto,Cut,Copy ...) .So how can i add my own options to this?
Thanks
Sunil
|
|
|
|
|
|
Hi all,
I want my constructors (default, overloaded, and copy) to throw an exception if they fail.
My questions are
1) How can I test to see if the constructor has failed?
2) Should I create an exception class to throw exception objects rather than using text strings/integer codes?
3) Where does the catch block go? In the constructor body, or after creating an object in the .cpp file?
Thanks,
Daniel
Obseve everything, remember more...
|
|
|
|
|
|
That's very handy, thank you.
I'm going to play with one of the examples to see how I go. Annoyingly the bits I need are not written in, it's just //...
Grrr!
Daniel
Obseve everything, remember more...
|
|
|
|
|
Hello,
I'm trying to redirect text, so that all text printed with printf would go to an edit control. I've seen a couple of examples (one by Microsoft and another by Codeguru) but those are done in a slightly different way.
What I want is to redirect text in my application, but those two examples use another application, whose printf commads they redirect. If I understood it right, an important thing in these applications is that they open a new window (well, sometimes they open it hidden) of the other application as the main application's child process.
Here's something that I've tried:
SECURITY_ATTRIBUTES sa;
::ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
sa.nLength= sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
HANDLE hStdOutOld = GetStdHandle(STD_OUTPUT_HANDLE);
HANDLE hStdOutReadTmp;
if ( !::CreatePipe(&hStdOutReadTmp, &m_hStdOut, &sa, 0) )
{
MessageBox("Error: CreatePipe");
return;
}
if( !::SetStdHandle(STD_OUTPUT_HANDLE, m_hStdOut) )
{
::CloseHandle( hStdOutReadTmp );
::CloseHandle( m_hStdOut );
MessageBox("Error: SetStdHandle");
return;
}
BOOL fSuccess = DuplicateHandle(GetCurrentProcess(), hStdOutReadTmp,
GetCurrentProcess(), &m_hStdOutRead, 0, FALSE, DUPLICATE_SAME_ACCESS);
if ( !fSuccess )
{
MessageBox("Error: DuplicateHandle");
return;
}
CloseHandle(hStdOutReadTmp);
After this there should be the child process creation. But do I have to make it? There's also another thing that I don't understand: how do I connect the other end of the pipe to the edit control?
I tried to connect the edit control and stdout straight without a pipe like:
CEdit *pEdit = (CEdit*)(this->GetDlgItem(IDC_EDIT));
m_hStdOut = (HANDLE)pEdit->GetSafeHwnd();
if( !::SetStdHandle(STD_OUTPUT_HANDLE, m_hStdOut) )
{
::CloseHandle( m_hStdOut );
MessageBox("Error: SetStdHandle");
return;
}
The result is that nothing happens.
I also thought of doing it in the same way as in examples, but before creating windows. The problem is, that I have a console in the beginning (the starting point of this app is main() and in there the app is started using InitInstance() and Run()). If I understood those examples right all that creating pipes and so on needs to be done before creating windows. Does console count as a window?
What would be the best way to go?
-Janetta
|
|
|
|
|
Forget printf ( unless you have no choice ), your best bet is to define your own unbuffered iostream, and pass the text to the edit control from there.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I do have a choice, but if I don't use printf, I have a very long way to go... I think that redirecting would be an easier way.
-Janetta
|
|
|
|