Windows Phone开发需要了解的背景
摘要:在Windows Phone8.1之前,Windows Phone应用是基于Silverlight的,这些代码也不能在Windows上运行,从Windows Phone8.1开始,开发者多了一个选择,就是可以开发Univeral的应用,也就是一份代码,既可以在Windows上运行,又可以在Windo...
阅读全文
学习LCMapString和LCMapStringEx
摘要:LCMapStringEx: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318702(v=vs.85).aspxFor a locale specified by name, maps an input character string to another using a specified transformation, or generates a sort key for the input string.也就是说对某个指定的Locale,将一个输入的字符使用某种转换映射为另外一个字符,或者对输入的字符串产生一个
阅读全文
About Cryptography
摘要:Microsoft® CryptographyCSPsIn Microsoft Windows, a Cryptographic Service Provider (CSP) is a software library that implements the Microsoft CryptoAPI (CAPI). Each CSP has a key database in which it stores its persistent cryptographic keys. Each key database contains one or more key containers,
阅读全文
消失的字符(关于New CRT)
摘要:看看下面的代码有什么问题?int main( void ){ size_t MAX = 256; wchar_t * src = new wchar_t[MAX]; src[0] = L'H'; src[1] = L'i'; char *dest = new char[MAX]; size_t len = 0; wcstombs_s(&len,dest,MAX,src,MAX);}如果我们使用strlen(dest),得到的结果会是0,但是如果我们访问dst[1],其结果是i,是我们期望的,而且如果src的有效字符更多一些,除了第一个字符不在外,其他的都
阅读全文
ETW (Event Tracing for Windows)介绍
摘要:ETW主要包括3个component:Controller, Provider, and Consumer. Controller的主要任务有两个: 一是,用StartTrace在内存中创建一个event trace session。刚创建时,这个session是没有跟任何provider关联的,也就不会任何数据被写到这个session的buffer中,,当然这一步也是可以完成关联的,那就是把St...
阅读全文
Time/Timer in Linux vs. Windows
摘要:数据类型time_t: Calendar time#include <time.h>time_t time(time_t *t);[obsoleted by gettimeofday]获取自从1970.1.1 00:00:00到现在为止的时间,以秒为单位。#include <sys/timeb.h>int ftime(struct timeb *tp);[Obsoleted]#include <time.h>int clock_getres(clockid_t clk_id, struct timespec *res);int clock_gettime(c
阅读全文
Active Directory Basic Concept
摘要:Security principalSecurity principals include the following:Any entity that can be authenticated by the system, such as a user account, a computer account, or a thread or process that runs in the security context of a user or computer account.Security groups of these accounts.Every security principa
阅读全文
Public Symbols and Private Symbols
摘要:When you build a driver or other program, the program's symbols are usually stored in symbol files, although some older compilers store certain symbols in the executable file. When a debugger is analyzing a program, it needs to access the program's symbols. Typically, symbol files can includ
阅读全文
Dialog Boxes
摘要:Dialog 依其 与父窗口的关系,分为两类:Modal dialog: 在关闭对话框前,不能激活同一应用的其他窗口;Modeless dialog:创建Modal Dialog Box可以使用API函数DialogBox创建一个Modal Dialog Box。You must specify the identifier or name of a dialog box template resource and a pointer to the dialog box procedure. The DialogBox function loads the template, displays
阅读全文
Win32 编程入门
摘要:Win32 程序开发的流程message based, event drivenWin32程序是message based, event driven。也就是说Win32程序的运行是依靠外部不断发生的事件来驱动的,也就是说,程序不断等待(有一个while循环),等待任何可能的输入,然后做判断,再做适当的处理。因此Win32程序只需要做好如下几件事情就可以了:1. 定义窗口的外观;2. 定义当不同的事件发生时,程序做什么样的反应(定义窗口处理函数);3. 写一个While循环,不断检测新事件的发生,并将其发送给不同的窗口处理函数程序进入点WinMainmain是一般C程序的进入点:int mai
阅读全文
SOS debug
摘要:如果执行extension中的command时,没有managed code在执行,将会出现如下错误: Failed to find runtime DLL(clr.dll), 0x80004005 Extension commands need clr.dll in order to have something to do. SOS command list:http://msdn.microsoft.com/en-us/library/bb190764.aspx .load DLLName!DLLName.load.loadby DLLName ModuleName 使用load和...
阅读全文
Debugging WOW64
摘要:Applications running under WOW64 can be debugged two ways: Use an x86-hosted debugger such as NTSD, WinDbg, or Visual Studio. The 32-bit NTSD is installed to %systemroot%\syswow64 on retail installations. Note that x86 debuggers can be used to debug x86 code, but cannot be used to disassemble or se.
阅读全文
Hibernate vs. Sleep
摘要:Hibernate takes a snapshot of everything you got on RAM (including any windows and apps running) and saves it to a special hard disk file and then shuts the computer down, when you resume from hibernation the computer boots a bit faster than a normal power up bootup. This method does not consume any
阅读全文
Memory Leak - Tools
摘要:UMDH UMDH是基于trace或者dump想法的工具。在使用UMDH之前首先要使用GFlags enable stack trace。然后在leak之前和leak之后分别对stack trace做dump,然后对前后的trace做比较。下面是比较后结果的一个示例: 对各个数字的含义使用红字标出 + 25be880 [两次的数值差,表明在两次dump之间同样的call stack 又分配了多少内存]( 25ce890[第二次stace中分配的总byte数] – 10010[第一次strac中分配的总byte数]) 1c allocs BackTraceB30BBE0+ 1b [两个dump之
阅读全文
Memory Leak - General
摘要:If you think that you are experiencing a memory leak, be aware that memory leaks may not be what they appear to be. You may discover that a memory leak is not a true memory leak, but is a performance enhancement. For example, the Microsoft Jet database engine can consume large amounts of memory (up
阅读全文
Debug Heap
摘要:Two of the most common and intractable problems that programmers encounter are overwriting the end of an allocated buffer and leaking memory (failing to free allocations after they are no longer needed). The debug heap provides powerful tools to solve memory allocation problems of this kind. The de.
阅读全文
Working Set,Private Bytes, Virtual Bytes
摘要:The working set of a program is a collection of those pages in its virtual address space that have been recently referenced. It includes both shared and private data. The shared data includes pages that contain all instructions your application executes, including those in your DLLs and the system D
阅读全文
Heap Verifier Stops in Appverifier and The Structure of a Page Heap Block
摘要:Heap Verifier Stops Attempt To Destroy Process Heap It is incorrect to try to destroy the default process heap (the one returned by GetProcessHeap() interface). Corrupted End Stamp of Block Header This stop occurs when the end stamp of the header of the block is corrupted. This happens during buffe.
阅读全文
Introduction to Windows Tracing
摘要:Trace log 存储一个或者多个trace session中产生的trace message;系统会先把Trace message存放在trace session buffer中,然后将他们deliver到trace consumer或者写到一个trace log。这些message会被压缩。 Trace Provider Trace Provider是一个应用程序、操作系统组件或者Drive...
阅读全文
Win32 开发
摘要:Win32程序开发与执行流程Winows程序分为源程序和资源两部分。源程序经由C/C++编译器生成.obj文件;资源部分经由RC编译器,读取RC文件的描述后,将所有资源文件集中制作出一个.res文件.res文件与.obj文件结合在一起,集成为一个完整的.exe可以执行文件,该文件才是一个完整的Windows应用程序.其开发与执行流程如图:win32程序开发与执行流程图应用源程序编译链接,生成可执行文件之后,会在项目文件夹下生成一个Debug/Release文件夹,在该文件夹下面可以找到.obj文件、.exe文件等。.def文件指示连接程序如何产生最终的可执行文件.Win32 基本原理1. Wi
阅读全文
|