_mkdir C runtime library function might return unexpected error values

by APIJunkie 22. December 2009 08:05

mkdir is a C runtime library function that creates directories.

In contrary to what could be understood from the MSDN documentation:

“…On an error, the function returns –1 and sets errno as follows.EEXIST Directory was not created because dirname is the name of an existing file, directory, or device.ENOENT Path was not found.For more information about these and other return codes, see _doserrno, errno, _sys_errlist, and _sys_nerr.”

mkdir might return other error values. For example when calling mkdir on an existing directory the function might return EEXIST but can also return EACCES (permission denied). The function error results seem to differ according to user access permissions on the system. This has been tested on Windows 2003/Vista/7. For more information and portability issues check out this discussion about mkdir portability in Kernel trap.

·         Note that this discussion applies to Microsoft’s implementation of the C run time library.

Tags:

C++ | C | Microsoft | Portability

Fix for SQL Server SSL Security error ConnectionOpen (SECDoClientHandshake())

by APIJunkie 31. July 2008 00:45

Having an SSL certificate that does not match the server name or expired or is invalid for any other reason can cause this error.

You will receive the above error message when connecting to your SQL server.

Very annoying and hard to find especially if the server hasn't been started for a few weeks since the certificate was installed  ( it seems like the certificate usage is refreshed only when the SQL server service is restarted).

After a little searching, I found an article about this SQL error and how to solve it.

In our case we used a SelfSSL generated certificate.

Note that to fix the problem we had to delete certificates from:

Certificates (local computer)
  Personal
     Certificates

After deleting the certificate you need to stop and start the SQL server service.

Tags:

Microsoft

Who said Microsoft can't predict the future?

by APIJunkie 8. March 2008 10:27

There have been a lot of talk lately about Microsoft losing the battle for new technology and its place as a market leader.

But as it turns out in a bold secret move Microsoft decided to incorporate cutting edge and even futuristic technology into some of its more popular products.

The technology is of course very processor intensive and is not recommend for use on single core machines with less then 1GB of RAM.

One of the best examples of the level of innovation can be seen in Microsoft Outlook.

Apparently it is now possible for Microsoft Outlook to predict what emails you will receive in the next foreseeable future.

Using a 2GHz dual core machine with 2GB of RAM I was actually able to see what emails I would receive in the next 24hr:

 

 

With a triple quad core machine I could actually see until next week and with a small Beowulf cluster running Wine I could actually see beyond next month:

 

 

BTW, if you really want to reproduce this phenomena simply take your Outlook client machine clock back in time until your server is at least 1 day ahead in time.

No pun intended and 2 much beer...:)

Tags:

Outlook | Microsoft | Pun

About the author

Name of author

My name is Bacon…James Bacon.

I am an API wars veteran. I was wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.