Comments for The Old New Thinghttps://blogs.msdn.microsoft.com/oldnewthing
Fri, 09 Dec 2016 10:56:13 +0000hourly1Comment on What is this race condition that the OpenMutex documentation is trying to warn me about? by Karellenhttps://blogs.msdn.microsoft.com/oldnewthing/20161208-00/?p=94885#comment-1276465
Fri, 09 Dec 2016 10:56:13 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94885#comment-1276465Darnit! That was meant to be a reply to WvR
]]>Comment on What is this race condition that the OpenMutex documentation is trying to warn me about? by Karellenhttps://blogs.msdn.microsoft.com/oldnewthing/20161208-00/?p=94885#comment-1276366
Fri, 09 Dec 2016 10:55:25 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94885#comment-1276366Yo dawg, I heard you like race-free code, so I put a mutex in your mutex, so you can synchronise while you synchronise!
]]>Comment on How can I reset a PC if I forgot the administrator password? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161206-00/?p=94865#comment-1276455
Fri, 09 Dec 2016 10:13:24 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94865#comment-1276455You should be able to do it with bitlocker enabled too, as long as you typed in the recovery key.

The main problem with bitlocker is that if you have admin access to the computer before you turn it off then you can just disable it. Most people still run with admin access.

]]>Comment on How can I reset a PC if I forgot the administrator password? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161206-00/?p=94865#comment-1276445
Fri, 09 Dec 2016 10:04:26 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94865#comment-1276445“In case of BitLocker, Windows Setup or Windows PE will give you a chance to mount the partitions using their respective recovery keys.”

Allowing someone access to your hardware and the bitlocker recovery keys, is like locking your front door and then hanging the key on a hook next to the door.

Storing your bitlocker recovery keys on a bitlocker to go usb stick is a reasonable compromise.

]]>Comment on How can I reset a PC if I forgot the administrator password? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161206-00/?p=94865#comment-1276435
Fri, 09 Dec 2016 09:59:07 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94865#comment-1276435What risk do you want to mitigate?

If you want to protect your privacy then use bitlocker. However the thief can still remove the hard drive and wipe it, then replace it, install an OS and wipe the TPM. You can’t prevent the thief destroying your data as they could just crush it.

If your bios can display a bootup message then you can add your name and phone number, which can make it harder for the thief to sell the equipment on (or ensure they are caught quite quickly). If you have signature checking enabled in the bios then this can make it very tricky to remove.

It’s a pity that https://en.wikipedia.org/wiki/LoJack_for_Laptops opens up it’s own security issues, it’s also a pity that Microsoft haven’t included something in Windows where you can report your computer stolen and then any identifiable parts from it would flag up when Windows phones home for updates.

]]>Comment on How can I reset a PC if I forgot the administrator password? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161206-00/?p=94865#comment-1276425
Fri, 09 Dec 2016 09:37:22 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94865#comment-1276425“easy solution: from GNU/Linux, just enter “sudo rm -rf /mnt/sda1/Windows” (of course the windoze partition must be mounted at sda1 before…)”

Linux has a place, but it’s not a universal panacea like the zealots will have you believe.

]]>Comment on How can I reset a PC if I forgot the administrator password? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161206-00/?p=94865#comment-1276356
Fri, 09 Dec 2016 09:32:59 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94865#comment-1276356One simple trick to make F8 display the bootmenu in windows 10.

]]>Comment on The case of the unexpected ERROR_ACCESS_DENIED when calling MapViewOfFile by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161205-00/?p=94855#comment-1276415
Fri, 09 Dec 2016 09:28:35 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94855#comment-1276415“That particular implementation doesn’t help, as it (as far as I can tell) uses “operator int() const { return i; }” to return the value back to the rest of the application as an “int”… which completely defeats the goal of using an enum to distinguish between PAGE_* values and FILE_MAP_* values.”

Any type safe solution would require you to change the API calls to take an enum instead of an int, Then int() won’t be called.

“It’s also a bad overload of the enum abstraction, as the point of an enum is to enumerate all possible (and only those possible) values.”

No, that isn’t the point of an enum. However I agree that a type that contains bit fields (including enum bit fields) is a better solution.

]]>Comment on What is this race condition that the OpenMutex documentation is trying to warn me about? by smfhttps://blogs.msdn.microsoft.com/oldnewthing/20161208-00/?p=94885#comment-1276405
Fri, 09 Dec 2016 09:08:27 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94885#comment-1276405If the customer/manager is the type of person who trust a stranger third party over the person they have employed to do the work, then there is no hope of explaining anything to them.

The only thing you can blame the people further down the line for is continuing to work there.

]]>Comment on What is this race condition that the OpenMutex documentation is trying to warn me about? by alegr1https://blogs.msdn.microsoft.com/oldnewthing/20161208-00/?p=94885#comment-1276395
Fri, 09 Dec 2016 02:19:16 +0000https://blogs.msdn.microsoft.com/oldnewthing/?p=94885#comment-1276395“I have people skills! What’s wrong with you, people?”
]]>