|
Winlogon and GINA[^]
MSDN: "Winlogon has special hooks into the User32 server that allow it to monitor CTRL+ALT+DEL secure attention sequence (SAS) events. Winlogon makes this SAS event information available to GINAs to use as their SAS, or as part of their SAS. In general, GINAs should monitor SASs on their own; however, any GINA that has the standard CTRL+ALT+DEL SAS as one of the SASs it recognizes should use the Winlogon support provided for this purpose." AND "When Winlogon encounters an SAS event or when an SAS is delivered to Winlogon by the GINA, Winlogon sets the state accordingly, changes to the Winlogon desktop, and calls one of the GINA's SAS processing functions."
This may be of interest to you:
WlxLoggedOutSAS[^]..."The WlxLoggedOutSAS function must be implemented by a replacement GINA DLL. Winlogon calls this function when it receives a secure attention sequence (SAS) event while no user is logged on."
|
|
|
|
|
|
is your computer is on the network?
r00d0034@yahoo.com
|
|
|
|
|
|
Hi,
Can I start a thread in a function and keep it runnig even if app runs out of the function space?
Thanks in advance.
Extreme programming. Do the No.1
|
|
|
|
|
Do you mean when the function exits? sure.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Then how to start a thread and it can keep alive even after the function which started the thread return?
Extreme programming. Do the No.1
|
|
|
|
|
stevenson wrote:
Can I start a thread in a function and keep it runnig even if app runs out of the function space?
Yes,
use _beginthreadex or CreateThread depending on what you are doing.
_beginthreadex will initialize the C-runtime library on the new thread that you create.
CreateThread is the Win32 version and you will need to initialize the C-runtime yourself for this thread if you plan on using it.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hello I'd like to declare a char* that points to a void* but i dont know the best way to do this, I thought i could use type casting but it appears not.
I'm trying to use strcmp to compare 2 char* pointing to buffers the code is this...
void * __cdecl buffer= malloc(100);<br />
void * __cdecl buffer2 = malloc (100);<br />
__int64 filel1 =_filelengthi64( firstfiledone);<br />
__int64 filel2 =_filelengthi64( firstfiledtwo);<br />
if (filel1!=filel2)<br />
return 1;<br />
char* b,b2;<br />
int trys1=filel1/100,count;<br />
for (count=0;count<filel1;count=count+trys1)<br />
{<br />
fread( buffer, 1, 100, s1 );<br />
fread( buffer2, 1, 100, s2 );<br />
b= (char*) static_cast <char*> (void * __cdecl) buffer;<br />
b2= (char*) static_cast <char*> (void * __cdecl) buffer2;<br />
if ((strcmp (b,b2))==0)<br />
{<br />
printf ("ok");<br />
}<br />
}
But that way doesnt work so is there any way of easily doing this?
Also what is a volatile pointer. As i've previously copied a supposedly volatile pointer bit by bit, then re-used it later with no bad effects, is this method sloppy code?
Thanks hope you can help ! - Jason
ps tried to get rid of them errors in the code with the boolean expression things dont know if it worked
|
|
|
|
|
Jay2 wrote:
I'm trying to use strcmp to compare 2 char* pointing to buffers the code is this...
Not sure that this will fix things, however you need to check your declaration of your two character pointers. It should look something like this( you have char* b,b2; ):
char *b, *2;
Jay2 wrote:
Also what is a volatile pointer
Here is a link to save space. Data Type Qualifiers[^]
Hope this helps.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Wow, you really have to work on formatting your code a little bit.
Your casts are odd as well and you'll have problems because strcmp expects strings to be NULL (0) terminated, you are better off using strncmp so you can set a max comparison size (in your case 100.) Also, what happens if fread reads less than 100 bytes or past the end of a either file? MSDN states "The file-pointer position is indeterminate if an error occurs. The value of a partially read item cannot be determined."
If you malloc you better free ! You allocate memory, but then you do a return without ever freeing the memory, you also return without ever _close ing the file handles (or is this done somewhere else?)
Do you really need to use a void pointer? Take a look at the following example on MSDN: fread()[^]
If you just use a buffer of char, you should be on your way.
You should also check for end of files (using feof ), and read errors (fread returning 0). Error handling is extremely important, and should never never never ever be omitted for production code (ever.) For illustrative purposes, many people do omit error handling, usually with a caveat that they've done so, or that the lack thereof is implied
Hopefully this will help you on your way.
|
|
|
|
|
Hi, I know the casts are odd! I couldnt think of any other way of thinking about it... not sure even if it is the correct cast but as a char* and void* are stored in memory (I think) the same way then I decided it would be possible.
I have to use a void* for fread to read from the file into the buffer which is void*, I think your strncmp looks like what i need to use but will this still assume there is a NULL character to terminate the string?
Incase that doesnt work maybe i can use sprintf to write from the buffer into a string, but i never like doing that kind of thing as i'm not really a fan of sprintf, and as the buffer is in binary i'm not even sure if it will work fully, is there no way of comparing 2 buffers or arreas of allocated memory, how about taking one from the other and seeing if the result is zero as this would save me a lot of messing around!
Ok thanks the code i showed you was only a small section of the program and i have closed the files, but not free'd the allocate memory yet.
Oh is that link the one used in msdn v6.0 i know as thats the version i have it's old but thats all i have, and when i click the link i dont get anything at all!
Thanks i'll have a play around with msdn.. - Jason
|
|
|
|
|
strncmp doesn't require a NULL terminator. fread will accept char pointers for the buffer as well.
|
|
|
|
|
sorry to spam your email like this... i think fscanf is the thing to use.;P
|
|
|
|
|
Why do you need to do things this way ? Are you using C rather than C++ ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi no i'm not using c, using c++ but for console applications, i'm comparing 2 different system files (actually i'm backing up windows installing some bits and pieces then comparing the new files with the backed up copies).
|
|
|
|
|
If you're using C++, you should use C++. Use new and delete instead of malloc and free, iostreams instead of fread. You'll find that the iostreams in particular greatly simplify what you're trying to do, and your code will be a lot nicer to read, also.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Each pop-up menu item has an arrow on the right, even when we override the menu item to be ownerdrawn. Windows seems to pull drawing for the right pointing triangle outside drawing context for pop-up menu items Does anybody know how to override this windows restriction and yet draw the triangle ourselves
Regards,
Vitaly
P.S. None of the articles about menus on this website has such feature as i could see.
|
|
|
|
|
Hi guys,
I'm developing an app and having a complete nightmare trying to support Windows 98! It runs solid like a rock on Windows 2000 and Xp, but with 98 it just crashes in the oddest of places. One of these is inside the AlphaBlend() function, which is a new function included in the November 2001 Platform Sdk. It is supposed to work under 98 no problem.
The AlphaBlend() code crashes inside msimg32.dll, and I read somewhere that you must not package this dll with your product... I am currently not doing this, but wonder if perhaps I should anyway ?
Does anyone have any ideas what could be going wrong? I'm debating just adding fine print saying something like "Run on Windows 98 at your own risk"
swinefeaster
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Thanks! It's good to know the version numbers... Perhaps I'll combine that with Christian's code and together it might just be a fix .
Cheers,
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Alphablend is known to leak memory, I wrote a replacement, it's availble on the wdj site, sorry I forget when but if you search for my surname, it's the only article of mine that was the feature article ( so the text is online as well as the code ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Thanks very much Christian! I found it . I'm going to try it out and see what I can come up with. Hopefully that will solve most of my problems... Just a few more questions, please...
1. Does AlphaBlend() leak memory on Windows 2000 and Xp as well, or just Windows 98 or Me? (I don't get any crashes on 2000/Xp)
2. I found your article at:
http://www.windevnet.com/documents/s=7628/wdj0109b/
It says "If you download this month’s source code from the WDJ website, you will find an example project, which illustrates the use of these functions and also shows you the steps taken by TransparentBltU(), as shown also in the examples here."
...but unfortunately it which month nor where I can get this example code. Where is that stuff?
Again thanks a lot.
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
I've used your code for the Windows 98 implementation, and it fixed the bug! Thanks .
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Hi,
I am a student who doing a project useing MFC. I had creade a single document project. But forget to fill the Document Template Strings, such as the filter name and file extension.
Now I can save and load fuiles but they have not an extension. And when clicks Open, all types of fill is shown.
Can any one tell me whether there is a method can add these functions to a project?
Thanks,
Tom
|
|
|
|
|
I believe these values are all in the string table.
Easiest way to deal with these sort of problems is to create another empty project, set the values to something that is unique and then search the files for it. simmilarly, if you want to change an option you set in the wizard, generate two empty projects of the same name, and make that option the only difference between the two, then run windiff over the directories.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|