1526
|
1 |
.. -*- coding: utf-8; -*-
|
|
2 |
.. include:: HEADER.rst
|
|
3 |
|
|
4 |
============================
|
|
5 |
Development under Windows.
|
|
6 |
============================
|
|
7 |
.. contents::
|
|
8 |
|
1528
|
9 |
Windows images.
|
|
10 |
===============
|
|
11 |
|
|
12 |
http://www.modern.ie/en-us/virtualization-tools#downloads
|
|
13 |
Test versions of IE using Virtual Machines that you download and
|
|
14 |
manage in your own development environment.
|
|
15 |
|
1526
|
16 |
Dependency Walker.
|
|
17 |
==================
|
|
18 |
|
|
19 |
Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows
|
|
20 |
module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of
|
|
21 |
all dependent modules. For each module found, it lists all the functions that
|
|
22 |
are exported by that module, and which of those functions are actually being
|
|
23 |
called by other modules. Another view displays the minimum set of required
|
|
24 |
files, along with detailed information about each file including a full path
|
|
25 |
to the file, base address, version numbers, machine type, debug information,
|
|
26 |
and more.
|
|
27 |
|
|
28 |
See:
|
|
29 |
|
|
30 |
* http://www.dependencywalker.com/
|
|
31 |
|
|
32 |
Windows 2000 Resource Kit Tools.
|
|
33 |
================================
|
|
34 |
|
|
35 |
http://support.microsoft.com/kb/927229
|
|
36 |
Windows 2000 Resource Kit Tools for administrative tasks
|
|
37 |
|
|
38 |
Sysinternals.
|
|
39 |
=============
|
|
40 |
|
|
41 |
TODO
|
|
42 |
|
|
43 |
Application verifier.
|
|
44 |
=====================
|
|
45 |
|
|
46 |
http://www.microsoft.com/downloads/en/details.aspx?familyid=c4a25ab9-649d-4a1b-b4a7-c9d8b095df18
|
|
47 |
download page
|
|
48 |
http://msdn.microsoft.com/en-us/library/ms220948.aspx
|
|
49 |
Application Verifier
|
|
50 |
|
|
51 |
Debugging with windbg.
|
|
52 |
======================
|
|
53 |
|
|
54 |
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
|
|
55 |
Download and Install Debugging Tools for Windows
|
|
56 |
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
|
|
57 |
Debugging Tools for Windows 32-bit Version
|
|
58 |
download page
|
|
59 |
http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx
|
|
60 |
Debugging Tools for Windows 64-bit Version
|
|
61 |
download page
|
|
62 |
|
|
63 |
Break on dll load/unload.
|
1527
|
64 |
-------------------------
|
1526
|
65 |
::
|
|
66 |
|
|
67 |
sxe ld <module>
|
|
68 |
sxe ud <module>
|
|
69 |
|
|
70 |
Set breakpoint by pattern and/or on specific module.
|
1527
|
71 |
----------------------------------------------------
|
1526
|
72 |
::
|
|
73 |
|
|
74 |
bm <module>!<name> # set breakpoints on 'module' with name 'name'
|
|
75 |
bm *!<prefix>* # set breakpoints on all names with prefix 'prefix'
|
|
76 |
bm <module>!* # set breakpoints on all names in module 'module'
|
|
77 |
|
|
78 |
``bp``, ``bm`` commands sets software breakpoints, debugger replaces the processor
|
|
79 |
instruction with a break instruction.
|
|
80 |
|
|
81 |
Clear breakpoints.
|
1527
|
82 |
------------------
|
1526
|
83 |
::
|
|
84 |
|
|
85 |
bc *
|
|
86 |
|
|
87 |
How to set WinDbg as a Default Windows Postmortem Debugger.
|
1527
|
88 |
-----------------------------------------------------------
|
1526
|
89 |
::
|
|
90 |
|
|
91 |
cmd> WinDbg -I
|
|
92 |
|
|
93 |
How analyse crash.
|
1527
|
94 |
------------------
|
1526
|
95 |
|
|
96 |
When program crash and use enter in WinDbg execute::
|
|
97 |
|
|
98 |
!analyze -v
|
|
99 |
|
|
100 |
Adding symbols from Symbol Server.
|
1527
|
101 |
----------------------------------
|
1526
|
102 |
|
|
103 |
Execute in WinDbg::
|
|
104 |
|
|
105 |
.sympath SRV*D:\srv\symcache*http://msdl.microsoft.com/download/symbols
|
|
106 |
|
|
107 |
or Ctrl+S and add::
|
|
108 |
|
|
109 |
SRV*D:\srv\symcache*http://msdl.microsoft.com/download/symbols
|
|
110 |
|
|
111 |
See:
|
|
112 |
|
|
113 |
http://support.microsoft.com/kb/311503
|
|
114 |
Use the Microsoft Symbol Server to obtain debug symbol files
|
|
115 |
|
|
116 |
Using the SymChk.exe utility to download symbols.
|
1527
|
117 |
-------------------------------------------------
|
1526
|
118 |
::
|
|
119 |
|
|
120 |
symchk /r c:\windows\system32 /s SRV*c:\symbols\*http://msdl.microsoft.com/download/symbols
|
|
121 |
|
|
122 |
Debugging child process.
|
1527
|
123 |
------------------------
|
1526
|
124 |
::
|
|
125 |
|
|
126 |
.childdbg 1
|
|
127 |
|
|
128 |
Running at startup.
|
|
129 |
===================
|
|
130 |
|
|
131 |
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
|
|
132 |
Launches a program automatically when a particular user logs
|
|
133 |
in. This key is used when you always want to launch a program
|
|
134 |
when a particular user is using a system.
|
|
135 |
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
|
|
136 |
Launches a program the next time the user logs in and removes
|
|
137 |
its value entry from the registry. This key is typically used
|
|
138 |
by installation programs.
|
|
139 |
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
|
|
140 |
Launches a program automatically at system startup. This key
|
|
141 |
is used when you always want to launch a program on a
|
|
142 |
particular system.
|
|
143 |
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
|
|
144 |
Launches a program the next time the system starts and removes
|
|
145 |
its value entry from the registry. This key is typically used
|
|
146 |
by installation programs.
|
|
147 |
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
|
|
148 |
Launches a service (a standard NT service or a background
|
|
149 |
process) automatically at startup. An example of a service is
|
|
150 |
a Web server such as Microsoft Internet Information Server.
|
|
151 |
HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
|
|
152 |
Launches a service (a standard NT service or a background
|
|
153 |
process) the next time the system is started, then removes its
|
|
154 |
value entry from the registry.
|
|
155 |
|
|
156 |
Values to registry on Windows XP can be added by::
|
|
157 |
|
|
158 |
cmd> reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v run.bat /t REG_SZ /d "path\to\run.bat"
|
|
159 |
cmd> reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run <-- see what done
|
|
160 |
|
|
161 |
Cabinet file (.cab).
|
|
162 |
====================
|
|
163 |
|
|
164 |
Extract content from .cab file::
|
|
165 |
|
|
166 |
cmd# expand my.cab
|
|
167 |
|
|
168 |
See:
|
|
169 |
|
|
170 |
http://support.microsoft.com/kb/198038
|
|
171 |
INFO: Useful Tools for Package and Deployment Issues
|
|
172 |
http://msdn.microsoft.com/en-us/library/aa367841%28VS.85%29.aspx
|
|
173 |
The Makecab.exe utility is included in the Windows SDK
|
|
174 |
Components for Windows Installer Developers.
|
|
175 |
http://web.archive.org/web/20070403215326/http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/cabsdk.exe
|
|
176 |
download link from web archive
|
|
177 |
http://msdn.microsoft.com/en-us/library/aa370834%28v=VS.85%29.aspx
|
|
178 |
The components of the Windows Installer Software Development
|
|
179 |
Kit are included in the Microsoft Windows Software Development
|
|
180 |
Kit (SDK).
|
|
181 |
http://msdn.microsoft.com/en-us/library/bb417343.aspx
|
|
182 |
Microsoft Cabinet Format
|
|
183 |
|
|
184 |
Internet Explorer.
|
|
185 |
==================
|
|
186 |
|
|
187 |
Debugging IE.
|
|
188 |
-------------
|
|
189 |
|
|
190 |
Install IE 8.0 and press 'F12' key.
|
|
191 |
|
|
192 |
http://msdn.microsoft.com/library/dd565626.aspx
|
|
193 |
Developer Tools User Interface Reference
|
|
194 |
|
|
195 |
Microsoft technologies.
|
|
196 |
=======================
|
|
197 |
|
|
198 |
COM.
|
|
199 |
----
|
|
200 |
|
|
201 |
The family of COM technologies includes COM+, Distributed COM (DCOM) and
|
|
202 |
ActiveX® Controls.
|
|
203 |
|
|
204 |
http://www.microsoft.com/com/default.mspx
|
|
205 |
home page
|
|
206 |
|
|
207 |
OLE.
|
|
208 |
----
|
|
209 |
|
|
210 |
OLE (Object Linking and Embedding) allows embedding and linking to documents and
|
|
211 |
other objects.
|
|
212 |
|
|
213 |
OLE 1.0 released in 1990, OLE 2.0 released in 1993, in 1994 OLE custom controls
|
|
214 |
(OCXs) were introduced.
|
|
215 |
|
|
216 |
OLE objects and containers are implemented on top of the Component Object Model.
|
|
217 |
|
|
218 |
Next release after 2.0 introdused in 1996 and named as ActiveX.
|
|
219 |
|
|
220 |
* http://en.wikipedia.org/wiki/Object_Linking_and_Embedding
|
|
221 |
|
|
222 |
ActiveX.
|
|
223 |
--------
|
|
224 |
|
|
225 |
Faced with the complexity of OLE 2.0 and with poor support for COM in MFC,
|
|
226 |
Microsoft rationalized the specifications to make them simpler, and rebranded
|
|
227 |
the technology as ActiveX in 1996.
|
|
228 |
|
|
229 |
http://msdn.microsoft.com/en-us/library/aa751968.aspx
|
|
230 |
ActiveX Controls.
|
|
231 |
http://en.wikipedia.org/wiki/ActiveX
|
|
232 |
Wikipedia article.
|
|
233 |
|
|
234 |
ATL.
|
|
235 |
----
|
|
236 |
|
|
237 |
The Active Template Library (ATL) is a set of template-based C++ classes
|
|
238 |
developed by Microsoft, intended to simplify the programming of Component Object
|
|
239 |
Model (COM) objects.
|
|
240 |
|
|
241 |
http://en.wikipedia.org/wiki/Active_Template_Library
|
|
242 |
|
|
243 |
MFC.
|
|
244 |
----
|
|
245 |
|
|
246 |
MFC (Microsoft Foundation Classes) is a library that wraps portions of the
|
|
247 |
Windows API in C++ classes, including functionality that enables them to use a
|
|
248 |
default application framework. Classes are defined for many of the
|
|
249 |
handle-managed Windows objects and also for predefined windows and common
|
|
250 |
controls.
|
|
251 |
|
|
252 |
A lightweight alternative to MFC is the Windows Template Library (WTL).
|
|
253 |
|
|
254 |
* http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library
|
|
255 |
* http://ru.wikipedia.org/wiki/Microsoft_Foundation_Classes
|
|
256 |
|
|
257 |
Can I link to MFC statically.
|
|
258 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
259 |
|
|
260 |
Yes, see:
|
|
261 |
|
|
262 |
* http://msdn.microsoft.com/en-us/library/f22wcbea%28VS.80%29.aspx
|
|
263 |
|
|
264 |
Microsoft Visual C++ Redistributable Package.
|
|
265 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
266 |
|
|
267 |
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displayLang=en
|
|
268 |
This package installs runtime components of C Runtime (CRT),
|
|
269 |
Standard C++, ATL, MFC, OpenMP and MSDIA libraries.
|
|
270 |
|
|
271 |
WTL.
|
|
272 |
====
|
|
273 |
|
|
274 |
WTL (Windows Template Library) is a free software, object-oriented C++ template
|
|
275 |
library for Win32 development.
|
|
276 |
|
|
277 |
WTL provides support for implementing various user interface elements, to MDI,
|
|
278 |
standard and common controls, common dialogs, property sheets and pages, GDI
|
|
279 |
objects, and other common UI elements, such as scrollable windows, splitter
|
|
280 |
windows, toolbars and command bars.
|
|
281 |
|
|
282 |
Most of the WTL API is a mirror of the standard Win32 calls.
|
|
283 |
|
|
284 |
* http://sourceforge.net/projects/wtl
|
|
285 |
* http://en.wikipedia.org/wiki/Windows_Template_Library
|
|
286 |
|
|
287 |
Windows style variable names.
|
|
288 |
=============================
|
|
289 |
::
|
|
290 |
|
|
291 |
Prefix | Data type
|
|
292 |
---------+-----------------------------------------
|
|
293 |
b | boolean
|
|
294 |
by | byte or unsigned char
|
|
295 |
c | char
|
|
296 |
cx / cy | short used as size
|
|
297 |
dw | DWORD, double word or unsigned long
|
|
298 |
fn | function
|
|
299 |
h | handle
|
|
300 |
i | int (integer)
|
|
301 |
l | Long
|
|
302 |
n | short int
|
|
303 |
p | a pointer variable containing the address of a variable
|
|
304 |
s | string
|
|
305 |
sz | ASCIIZ null-terminated string
|
|
306 |
w | WORD unsigned int
|
|
307 |
x, y | short used as coordinates
|
|
308 |
|
|
309 |
::
|
|
310 |
|
|
311 |
PrefixCategory | Mean
|
|
312 |
----------------+----------------
|
|
313 |
CS | Class style
|
|
314 |
CW | Create window
|
|
315 |
DT | Draw text
|
|
316 |
IDC | Cursor ID
|
|
317 |
IDI | Icon ID
|
|
318 |
WM | Window message
|
|
319 |
WS | Window style
|
|
320 |
|
|
321 |
::
|
|
322 |
|
|
323 |
Data type | Meaning
|
|
324 |
----------+-------------------------------------------------------------------
|
|
325 |
FAR | Same as far. Identifies an address that originally used the
|
|
326 |
| segment:offset addressing schema. Now FAR simply identifies a
|
|
327 |
| (default) 32-bit address but may be omitted entirely in many cases.
|
|
328 |
|
|
|
329 |
PASCAL | Same as Pascal. The Pascal convention demanded by Windows
|
|
330 |
| defines the order in which arguments are found in the stack when
|
|
331 |
| passed as calling parameters.
|
|
332 |
|
|
|
333 |
WORD | Unsigned integer (16 bits)
|
|
334 |
|
|
|
335 |
UINT | Unsigned integer, same as WORD
|
|
336 |
|
|
|
337 |
DWORD | Double word, unsigned long int (32 bits)
|
|
338 |
|
|
|
339 |
LONG | Signed long integer (32 bits)
|
|
340 |
|
|
|
341 |
LPSTR | Long (far) pointer to character string
|
|
342 |
|
|
|
343 |
NEAR | Obsolete, previously identified an address value within a 16KB
|
|
344 |
| memory block.
|
|
345 |
|
|
346 |
See:
|
|
347 |
|
|
348 |
http://www.tenouk.com/cnotation.html
|
|
349 |
C/C++ NOTATION STORY
|