Quantcast
Browsing all 3085 articles
Browse latest View live

Creating an automatic-reset event from WaitOnAddress

Last time, we created a manual-reset event from Wait­On­Address. Today, it's an automatic-reset event. struct ALT_AEVENT { LONG State; }; void InitializeAltAutoEvent(ALT_AEVENT* Event, bool...

View Article


Combining the work queue of distinct events, order not important, with an...

Some time ago, I described a lock-free pattern for a work queue of distinct events, where the order of event processing is not important. A customer was using a variation of this pattern, where they...

View Article


Stuff my father-in-law says: On baking bread

No, this is not my attempt to get picked up as a television show. It's just that my father-in-law sometimes says funny stuff. When my mother came to visit, she brought some bread that she had made in...

View Article

How do I set the initial directory of the File Open dialog to a virtual...

A customer reported that they had been setting the lpstrInitialDir member of the OPENFILENAME structure to "::{645FF040-5081-101B-9F08-00AA002F954E}" in order to have the dialog's default directory be...

View Article

Why is Explorer opted out of Data Execution Prevention and termination on...

Every so often, somebody will report a security issue with the fact that Explorer is linked with /NXCOMPAT:NO, which opts it out of Data Execution Prevention (DEP), also known as no-execute (NX)....

View Article


Summertime, and the lemonade is easy

Back in my youth, my brother and I played many games of Lemonade Stand, a simple BASIC game that put you in charge of a virtual lemonade stand. You had to decide, based on the weather report and the...

View Article

When can GetSecurityInfo API return ERROR_INSUFFICIENT_BUFFER?

A customer reported that under stress testing, they found that when they call the Get­Security­Info function to get the DACL of a job object, the call randomly returns ERROR_INSUFFICIENT_BUFFER. They...

View Article

Trying to make the thread pool more responsive to a large queue of...

A customer had a question about the thread pool. Specifically, they found that when they queued a work item with the System.Threading.Thread­Pool.Queue­User­Work­Item method, the work item didn't...

View Article


Extracting pages from a PDF document and saving them as separate image files,...

Today's Little Program extracts the pages from a PDF document and saves them as separate image files. Why? Because I needed to do that. I'll start with the PDF Document sample program and change it so...

View Article


Extracting pages from a PDF document and saving them as separate image files,...

Last time, we converted the C# version of the PDF Document sample program so that it saved the pages to disk as image files. Today we'll port those changes to JavaScript with Promises. function...

View Article

Extracting pages from a PDF document and saving them as separate image files,...

Last time, we converted the JavaScript version of the PDF Document sample program so that it saved the pages to disk as image files. The asynchonous behavior was expressed via Promises. Today we'll...

View Article

Extracting pages from a PDF document and saving them as separate image files,...

At the start of this series, we converted the C# version of the PDF Document sample program so that it saved the pages to disk as image files. Today we'll port those changes to C++/CX with tasks. void...

View Article

Extracting pages from a PDF document and saving them as separate image files,...

Last time, we converted the C++/CX version of the PDF Document sample program so that it saved the pages to disk as image files, using PPL tasks. Today we'll do it again, but using the proposed...

View Article


2017 mid-year link clearance

The U.S. Department of Defense Office of General Counsel publishes and revises a quite readable training document titled "Encyclopedia of Ethical Failure". here's the September 2016 edition. In it,...

View Article

Emulating the C# using keyword in C++

C# has a very convenient using statement which ensures that an object is Dispose()d when control exits the block. C++ has a generalization of this concept with RAII types, but things get tricky when...

View Article


Urban and suburban camouflage

When you have a city, you also need infrastructure, but the buildings for that infrastructure tend to be ugly, so you now have the need to camouflage your infrastructure as something inoffensive. And...

View Article

How fair are SRW locks, particularly when there are both readers and writers?

A customer wanted to know about the order of lock acquisition in the SRWLOCK functions. They note that the documentation says, There is no guarantee about the order in which threads that request...

View Article


Debugging tip: Use .frame /r to recover nonvolatile registers from the stack...

A customer was debugging a crash dump (using a debugger that is based on the Windows debugger engine) and observed that when they used the k command, the "Args to Child" values didn't make any sense,...

View Article

How can I tell whether two paths reside on the same underlying volume, so I...

A customer wanted to know whether there was a way to determine whether two paths reside on the same underlying volume. They were concerned that due to tricks like SUBST and volume mount points, the...

View Article

On the circular path from RAII to crazy-town back to RAII: Thoughts on...

Some follow-up notes on Emulating the C# using keyword in C++, primarily for the benefit of people from reddit who stumbled into the series and didn't understand the context of the discussion, because...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>