From 933bc7f0ddfa161bdac654bc67560553e2b83fe3 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 26 Jun 2016 19:03:10 +0200 Subject: [PATCH] Convert files to unix line ends in the repo These files were aded with windows line ends before we did set the text=auto attribute for all files in .gitattributes, and this caused phantom changes on linux workspaces after .gitattributes was introduced. Now these files appear with linux line ends on linux workspaces and with windows line ends on windows workspaces, like all source files. --- .../installer/information/WinLangCode.htm | 1160 +++++----- development/Win32/vld/src/crtmfcpatch.h | 1930 ++++++++--------- development/Win32/vld/src/resource.h | 28 +- development/Win32/vld/src/vld.h | 194 +- 4 files changed, 1656 insertions(+), 1656 deletions(-) diff --git a/development/Win32/packaging/installer/information/WinLangCode.htm b/development/Win32/packaging/installer/information/WinLangCode.htm index 9660cebe6f..c30e0702d8 100644 --- a/development/Win32/packaging/installer/information/WinLangCode.htm +++ b/development/Win32/packaging/installer/information/WinLangCode.htm @@ -1,580 +1,580 @@ -Regional and Language Settings
Microsoft Office SharePoint Portal Server 2003
HomeBackForwardPrint

Regional and Language Settings

- - - - - - -

This topic lists the regional and language settings you can specify -from the command line by using operations in Stsadm.exe and by using -HTML Administration pages. For more information about specifying -regional and language settings, see Language Considerations. For more information about the syntax for command-line operations, see Command-Line Operations. -

The following types of regional and language settings are used in Microsoft Windows SharePoint Services:

- - -

Language IDs

The -Language ID determines the language used for text on pages in the Web -site (such as the text on the Site Settings page). The languages -available for site creation depend on the language template packs you -have installed to your server or server farm. Web sites based on -Windows SharePoint Services can be created in the following languages.

IDLanguage -IDLanguage -
1025Arabic -1041 -Japanese -
1028 -Chinese - Traditional -1042 -Korean
1029 -Czech1043Dutch -
1030 -Danish -1044 -Norwegian -
1031 -German -1045 -Polish -
1032 -Greek -1046 -Portuguese - Brazilian -
1033 -English -1049 -Russian -
1034 -Spanish -1053 -Swedish -
1035 -Finnish -1054 -Thai -
1036 -French -1055 -Turkish -
1037 -Hebrew -2052 -Chinese - Simplified -
1038 -Hungarian -2070 -Portuguese -
1040 -Italian -3076Chinese - Hong Kong

Windows SharePoint Services also supports input and display of text in the following languages, but not site creation.

IDLanguage -IDLanguage -
1026Bulgarian1048Romanian
1050Croatian -2074Serbian
1061Estonian -1051Slovak
1081Hindi with Indic PT1060Slovenian
1062Latvian1058Ukrainian
1063Lithuanian

Locale IDs

The -Locale ID controls the numbering, sorting, calendar, and time -formatting for the Web site. You can change the locale for a Web site -by using the Regional Settings page. Web sites based on Windows -SharePoint Services can be set to the following Locale IDs.

IDLocaleIDLocale
1078Afrikaans -1037 -Hebrew -
1052 -Albanian -1081 -Hindi -
5121 -Arabic (Algeria) -1038 -Hungarian -
15361 -Arabic (Bahrain) -1039 -Icelandic -
3073 -Arabic (Egypt) -1057 -Indonesian -
2049 -Arabic (Iraq) -1040 -Italian (Italy) -
11265 -Arabic (Jordan) -2064 -Italian (Switzerland) -
13313 -Arabic (Kuwait) -1041 -Japanese -
12289 -Arabic (Lebanon) -1099 -Kannada -
4097 -Arabic (Libya) -1087 -Kazakh -
6145 -Arabic (Morocco) -1111 -Konkani -
8193 -Arabic (Oman) -1042 -Korean -
16385 -Arabic (Qatar) -1088 -Kyrgyz (Cyrillic) -
1025 -Arabic (Saudi Arabia) -1062Latvian -
10241 -Arabic (Syria) -1063 -Lithuanian -
7169 -Arabic (Tunisia) -1071 -Macedonian (FYROM) -
14337 -Arabic (U.A.E.) -2110 -Malay (Brunei Darussalam) -
9217 -Arabic (Yemen) -1086 -Malay (Malaysia) -
1067 -Armenian -1102 -Marathi -
2092 -Azeri (Cyrillic) -1104 -Mongolian (Cyrillic) -
1068 -Azeri (Latin) -1044 -Norwegian (Bokmal) -
1069 -Basque -2068 -Norwegian (Nynorsk) -
1059 -Belarusian -1045 -Polish -
1026 -Bulgarian -1046 -Portuguese (Brazil) -
1027 -Catalan -2070 -Portuguese (Portugal) -
3076 -Chinese (Hong Kong) -1094 -Punjabi -
5124 -Chinese (Macau) -1048 -Romanian -
2052 -Chinese (PRC) -1049 -Russian -
4100 -Chinese (Singapore) -1103 -Sanskrit -
1028 -Chinese (Taiwan) -3098 -Serbian (Cyrillic) -
1050 -Croatian -2074 -Serbian (Latin) -
1029 -Czech -1051 -Slovak -
1030 -Danish -1060 -Slovenian -
1125 -Divehi -11274 -Spanish (Argentina) -
2067 -Dutch (Belgium) -16394 -Spanish (Bolivia) -
1043 -Dutch (Netherlands) -13322 -Spanish (Chile) -
3081 -English (Australia) -9226 -Spanish (Colombia) -
10249 -English (Belize) -5130 -Spanish (Costa Rica) -
4105 -English (Canada) -7178 -Spanish (Dominican Republic) -
9225 -English (Caribbean) -12298 -Spanish (Ecuador) -
6153 -English (Ireland) -17418 -Spanish (El Salvador) -
8201 -English (Jamaica) -4106Spanish (Guatemala) -
5129 -English (New Zealand) -18442 -Spanish (Honduras) -
13321 -English (Philippines) -2058 -Spanish (Mexico) -
7177 -English (South Africa) -19466 -Spanish (Nicaragua) -
11273 -English (Trinidad) -6154 -Spanish (Panama) -
2057 -English (United Kingdom) -15370 -Spanish (Paraguay) -
1033 -English (United States)   -10250 -Spanish (Peru) -
12297 -English (Zimbabwe) -20490 -Spanish (Puerto Rico) -
1061 -Estonian -3082 -Spanish (Spain) -
1080 -Faeroese -1034 -Spanish (Traditional) -
1065 -Farsi -14346 -Spanish (Uruguay) -
1035 -Finnish -8202 -Spanish (Venezuela) -
2060 -French (Belgium) -1089 -Swahili -
3084 -French (Canada) -1053 -Swedish -
1036 -French (France) -2077 -Swedish (Finland) -
5132 -French (Luxembourg) -1114 -Syriac -
6156 -French (Monaco) -1097 -Tamil -
4108 -French (Switzerland) -1092 -Tatar -
1110 -Galician -1098 -Telugu -
1079 -Georgian -1054 -Thai -
3079 -German (Austria) -1055 -Turkish -
1031 -German (Germany) -1058 -Ukrainian -
5127 -German (Liechtenstein) -1056 -Urdu -
4103 -German (Luxembourg) -2115 -Uzbek (Cyrillic) -
2055 -German (Switzerland) -1091 -Uzbek (Latin) -
1032 -Greek -1066 -Vietnamese -
1095 -Gujarati -

Time Zones

Web -sites based on Windows SharePoint Services can be set to any of the -time zones recognized by Microsoft Windows Server 2003.

Code -Time zoneCodeTime zone
39(GMT-12:00) Eniwetok, Kwajalein59(GMT+02:00) Helsinki, Riga, Tallinn -
16(GMT-11:00) Midway Island, Samoa -27(GMT+02:00) Jerusalem 26 (GMT+03:00) Baghdad -
15(GMT-10:00) Hawaii -74(GMT+03:00) Kuwait, Riyadh -
14(GMT-09:00) Alaska -51(GMT+03:00) Moscow, St. Petersburg, Volgograd -
13(GMT-08:00) Pacific Time (US and Canada); Tijuana -56(GMT+03:00) Nairobi -
38(GMT-07:00) Arizona -25(GMT+03:30) Tehran
12(GMT-07:00) Mountain Time (US and Canada) -24(GMT+04:00) Abu Dhabi, Muscat -
55(GMT-06:00) Central America -54(GMT+04:00) Baku, Tbilisi, Yerevan 48 (GMT+04:30) Kabul -
11(GMT-06:00) Central Time (US and Canada) -58(GMT+05:00) Ekaterinburg -
37(GMT-06:00) Mexico City -47 -(GMT+05:00) Islamabad, Karachi, Tashkent -
36(GMT-06:00) Saskatchewan -23(GMT+05:30) Calcutta, Chennai, Mumbai, New Delhi -
35(GMT-05:00) Bogota, Lima, Quito -62(GMT+05:45) Kathmandu 46 (GMT+06:00) Almaty, Novosibirsk -
10(GMT-05:00) Eastern Time (US and Canada) -71(GMT+06:00) Astana, Dhaka -
34 -(GMT-05:00) Indiana (East) -66(GMT+06:00) Sri Jayawardenepura -
9 -(GMT-04:00) Atlantic Time (Canada) -61(GMT+06:30) Rangoon -
33(GMT-04:00) Caracas, La Paz -22(GMT+07:00) Bangkok, Hanoi, Jakarta -
65(GMT-04:00) Santiago -64(GMT+07:00) Krasnoyarsk -
28(GMT-03:30) Newfoundland 8 (GMT-03:00) Brasilia -45(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi -
32(GMT-03:00) Buenos Aires, Georgetown -63(GMT+08:00) Irkutsk, Ulaan Bataar -
60(GMT-03:00) Greenland -21(GMT+08:00) Kuala Lumpur, Singapore -
30(GMT-02:00) Mid-Atlantic -73(GMT+08:00) Perth 75 (GMT+08:00) Taipei -
29(GMT-01:00) Azores -20(GMT+09:00) Osaka, Sapporo, Tokyo 72 (GMT+09:00) Seoul -
53(GMT-01:00) Cape Verde Is.70(GMT+09:00) Yakutsk 19 (GMT+09:30) Adelaide -
31(GMT) Casablanca, Monrovia -44(GMT+09:30) Darwin -
2(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London -18(GMT+10:00) Brisbane -
4(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna -76(GMT+10:00) Canberra, Melbourne, Sydney -
6(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague -43(GMT+10:00) Guam, Port Moresby -
3(GMT+01:00) Brussels, Copenhagen, Madrid, Paris -42(GMT+10:00) Hobart
57(GMT+01:00) Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb -68(GMT+10:00) Vladivostok -
69(GMT+01:00) West Central Africa -41(GMT+11:00) Magadan, Solomon Is., New Caledonia -
7(GMT+02:00) Athens, Istanbul, Minsk -17(GMT+12:00) Auckland, Wellington -
5(GMT+02:00) Bucharest40 -(GMT+12:00) Fiji, Kamchatka, Marshall Is. -
49 -(GMT+02:00) Cairo -67 -(GMT+13:00) Nuku'alofa -
50 -(GMT+02:00) Harare, Pretoria -

Currency IDs

Web sites based on Windows SharePoint Services can be set to use the following currencies. -

IDCurrency -IDCurrency -
51211,254 .ج.د (Arabic-Algeria) -4106 -Q1,254 (Guatemala) -
15361 -1,254 .ب.د (Arabic-Bahrain) -18442 -L. 1254 (Honduras) -
3073 -1,254 .م.ج (Arabic-Egypt)3076 -HK$1,254 (Hong Kong) -
2049 -1,254 .ع.د (Arabic-Iraq) -1038 -1 254 Ft (Hungary) -
11265 -1,254 .ا.د (Arabic-Jordan) -1081 -रु 1,254 (India) -
13313 -1,254 .ك.د (Arabic-Kuwait) -6153 -IR£1,254 (Ireland) -
12289 -1,254 .ل.ل (Arabic-Lebanon) -1037 -₪1,254 (Israel) -
4097 -1,254 .ل.د (Arabic-Libya) -1041 -¥1,254 (Japan) -
6145 -1,254 .م.د (Arabic-Morocco) -1042 -₩1,254 (Korea) -
8193 -1,254 .ع.ر (Arabic-Oman) -2058 -$1,254 (Mexico) -
16385 -1,254 .ق.ر (Arabic-Qatar) -5129 -$1,254 (New Zealand) -
1025 -1,254 .س.ر (Arabic-Saudi Arabia) -19466 -C$ 1254 (Nicaragua) -
10241 -1,254 .س.ل (Arabic-Syria) -1044 -kr 1 254 (Norway) -
7169 -1,254 .ت.د (Arabic-Tunisia) -1056 -Rs 1,254 (Pakistan) -
14337 -1,254 .إ.د (Arabic-U.A.E) -6154 -B/. 1,254 (Panama) -
9217 -1,254 .ي.ر (Arabic-Yemen) -15370 -Gs 1.254 (Paraguay) -
11274 -$ 1.254 (Argentina) -2052 -ï¿¥1,254 (People's Republic of China) -
3081 -$1,254 (Australia) -10250 -S/. 1,254 (Peru) -
3079 -öS 1.254 (Austria) -1045 -1 254 zł (Poland) -
16394 -$b 1.254 (Bolivia) -1049 -1 254р. (Russia) -
1046 -R$ 1.254 (Brazil) -4100 -$1,254 (Singapore) -
3084 -1 254 $ (Canada) -1051 -1 254 Sk (Slovakia) -
4105 -$1,254 (Canada) -1060 -1.254 SIT (Slovenia) -
13322 -$ 1.254 (Chile) -7177 -R 1,254 (South Africa) -
9226 -$ 1.254 (Colombia) -1053 -1.254 kr (Sweden) -
5130 -C1.254 (Costa Rica) -2055 -SFr. 1'254 (Switzerland) -
1029 -1 254 Kč (Czech Republic) -1028 -NT$1,254 (Taiwan) -
1030 -kr 1.254 (Denmark) -1054 -฿1,254 (Thai) -
7178 -RD$1,254 (Dominican Republic) -1055 -1.254 TL (Turkey) -
17418 -C1254 (El Salvador) -2057 -£1,254 (United Kingdom) -
-2 -1,254 € (European Union) -1033 -$1,254 (United States) -
-1 -€ 1,254 (European Union) -14346 -$U 1.254 (Uruguay) -
1065 -1,254 ريال (Farsi) -8202 -Bs 1.254 (Venezuela) -
1032 -1.254 Δρχ (Greece) -1066 -1,254 ₫ (Vietnamese) -
©2003 Microsoft Corporation. All rights reserved.
\ No newline at end of file +Regional and Language Settings
Microsoft Office SharePoint Portal Server 2003
HomeBackForwardPrint

Regional and Language Settings

+ + + + + + +

This topic lists the regional and language settings you can specify +from the command line by using operations in Stsadm.exe and by using +HTML Administration pages. For more information about specifying +regional and language settings, see Language Considerations. For more information about the syntax for command-line operations, see Command-Line Operations. +

The following types of regional and language settings are used in Microsoft Windows SharePoint Services:

+ + +

Language IDs

The +Language ID determines the language used for text on pages in the Web +site (such as the text on the Site Settings page). The languages +available for site creation depend on the language template packs you +have installed to your server or server farm. Web sites based on +Windows SharePoint Services can be created in the following languages.

IDLanguage +IDLanguage +
1025Arabic +1041 +Japanese +
1028 +Chinese - Traditional +1042 +Korean
1029 +Czech1043Dutch +
1030 +Danish +1044 +Norwegian +
1031 +German +1045 +Polish +
1032 +Greek +1046 +Portuguese - Brazilian +
1033 +English +1049 +Russian +
1034 +Spanish +1053 +Swedish +
1035 +Finnish +1054 +Thai +
1036 +French +1055 +Turkish +
1037 +Hebrew +2052 +Chinese - Simplified +
1038 +Hungarian +2070 +Portuguese +
1040 +Italian +3076Chinese - Hong Kong

Windows SharePoint Services also supports input and display of text in the following languages, but not site creation.

IDLanguage +IDLanguage +
1026Bulgarian1048Romanian
1050Croatian +2074Serbian
1061Estonian +1051Slovak
1081Hindi with Indic PT1060Slovenian
1062Latvian1058Ukrainian
1063Lithuanian

Locale IDs

The +Locale ID controls the numbering, sorting, calendar, and time +formatting for the Web site. You can change the locale for a Web site +by using the Regional Settings page. Web sites based on Windows +SharePoint Services can be set to the following Locale IDs.

IDLocaleIDLocale
1078Afrikaans +1037 +Hebrew +
1052 +Albanian +1081 +Hindi +
5121 +Arabic (Algeria) +1038 +Hungarian +
15361 +Arabic (Bahrain) +1039 +Icelandic +
3073 +Arabic (Egypt) +1057 +Indonesian +
2049 +Arabic (Iraq) +1040 +Italian (Italy) +
11265 +Arabic (Jordan) +2064 +Italian (Switzerland) +
13313 +Arabic (Kuwait) +1041 +Japanese +
12289 +Arabic (Lebanon) +1099 +Kannada +
4097 +Arabic (Libya) +1087 +Kazakh +
6145 +Arabic (Morocco) +1111 +Konkani +
8193 +Arabic (Oman) +1042 +Korean +
16385 +Arabic (Qatar) +1088 +Kyrgyz (Cyrillic) +
1025 +Arabic (Saudi Arabia) +1062Latvian +
10241 +Arabic (Syria) +1063 +Lithuanian +
7169 +Arabic (Tunisia) +1071 +Macedonian (FYROM) +
14337 +Arabic (U.A.E.) +2110 +Malay (Brunei Darussalam) +
9217 +Arabic (Yemen) +1086 +Malay (Malaysia) +
1067 +Armenian +1102 +Marathi +
2092 +Azeri (Cyrillic) +1104 +Mongolian (Cyrillic) +
1068 +Azeri (Latin) +1044 +Norwegian (Bokmal) +
1069 +Basque +2068 +Norwegian (Nynorsk) +
1059 +Belarusian +1045 +Polish +
1026 +Bulgarian +1046 +Portuguese (Brazil) +
1027 +Catalan +2070 +Portuguese (Portugal) +
3076 +Chinese (Hong Kong) +1094 +Punjabi +
5124 +Chinese (Macau) +1048 +Romanian +
2052 +Chinese (PRC) +1049 +Russian +
4100 +Chinese (Singapore) +1103 +Sanskrit +
1028 +Chinese (Taiwan) +3098 +Serbian (Cyrillic) +
1050 +Croatian +2074 +Serbian (Latin) +
1029 +Czech +1051 +Slovak +
1030 +Danish +1060 +Slovenian +
1125 +Divehi +11274 +Spanish (Argentina) +
2067 +Dutch (Belgium) +16394 +Spanish (Bolivia) +
1043 +Dutch (Netherlands) +13322 +Spanish (Chile) +
3081 +English (Australia) +9226 +Spanish (Colombia) +
10249 +English (Belize) +5130 +Spanish (Costa Rica) +
4105 +English (Canada) +7178 +Spanish (Dominican Republic) +
9225 +English (Caribbean) +12298 +Spanish (Ecuador) +
6153 +English (Ireland) +17418 +Spanish (El Salvador) +
8201 +English (Jamaica) +4106Spanish (Guatemala) +
5129 +English (New Zealand) +18442 +Spanish (Honduras) +
13321 +English (Philippines) +2058 +Spanish (Mexico) +
7177 +English (South Africa) +19466 +Spanish (Nicaragua) +
11273 +English (Trinidad) +6154 +Spanish (Panama) +
2057 +English (United Kingdom) +15370 +Spanish (Paraguay) +
1033 +English (United States)   +10250 +Spanish (Peru) +
12297 +English (Zimbabwe) +20490 +Spanish (Puerto Rico) +
1061 +Estonian +3082 +Spanish (Spain) +
1080 +Faeroese +1034 +Spanish (Traditional) +
1065 +Farsi +14346 +Spanish (Uruguay) +
1035 +Finnish +8202 +Spanish (Venezuela) +
2060 +French (Belgium) +1089 +Swahili +
3084 +French (Canada) +1053 +Swedish +
1036 +French (France) +2077 +Swedish (Finland) +
5132 +French (Luxembourg) +1114 +Syriac +
6156 +French (Monaco) +1097 +Tamil +
4108 +French (Switzerland) +1092 +Tatar +
1110 +Galician +1098 +Telugu +
1079 +Georgian +1054 +Thai +
3079 +German (Austria) +1055 +Turkish +
1031 +German (Germany) +1058 +Ukrainian +
5127 +German (Liechtenstein) +1056 +Urdu +
4103 +German (Luxembourg) +2115 +Uzbek (Cyrillic) +
2055 +German (Switzerland) +1091 +Uzbek (Latin) +
1032 +Greek +1066 +Vietnamese +
1095 +Gujarati +

Time Zones

Web +sites based on Windows SharePoint Services can be set to any of the +time zones recognized by Microsoft Windows Server 2003.

Code +Time zoneCodeTime zone
39(GMT-12:00) Eniwetok, Kwajalein59(GMT+02:00) Helsinki, Riga, Tallinn +
16(GMT-11:00) Midway Island, Samoa +27(GMT+02:00) Jerusalem 26 (GMT+03:00) Baghdad +
15(GMT-10:00) Hawaii +74(GMT+03:00) Kuwait, Riyadh +
14(GMT-09:00) Alaska +51(GMT+03:00) Moscow, St. Petersburg, Volgograd +
13(GMT-08:00) Pacific Time (US and Canada); Tijuana +56(GMT+03:00) Nairobi +
38(GMT-07:00) Arizona +25(GMT+03:30) Tehran
12(GMT-07:00) Mountain Time (US and Canada) +24(GMT+04:00) Abu Dhabi, Muscat +
55(GMT-06:00) Central America +54(GMT+04:00) Baku, Tbilisi, Yerevan 48 (GMT+04:30) Kabul +
11(GMT-06:00) Central Time (US and Canada) +58(GMT+05:00) Ekaterinburg +
37(GMT-06:00) Mexico City +47 +(GMT+05:00) Islamabad, Karachi, Tashkent +
36(GMT-06:00) Saskatchewan +23(GMT+05:30) Calcutta, Chennai, Mumbai, New Delhi +
35(GMT-05:00) Bogota, Lima, Quito +62(GMT+05:45) Kathmandu 46 (GMT+06:00) Almaty, Novosibirsk +
10(GMT-05:00) Eastern Time (US and Canada) +71(GMT+06:00) Astana, Dhaka +
34 +(GMT-05:00) Indiana (East) +66(GMT+06:00) Sri Jayawardenepura +
9 +(GMT-04:00) Atlantic Time (Canada) +61(GMT+06:30) Rangoon +
33(GMT-04:00) Caracas, La Paz +22(GMT+07:00) Bangkok, Hanoi, Jakarta +
65(GMT-04:00) Santiago +64(GMT+07:00) Krasnoyarsk +
28(GMT-03:30) Newfoundland 8 (GMT-03:00) Brasilia +45(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi +
32(GMT-03:00) Buenos Aires, Georgetown +63(GMT+08:00) Irkutsk, Ulaan Bataar +
60(GMT-03:00) Greenland +21(GMT+08:00) Kuala Lumpur, Singapore +
30(GMT-02:00) Mid-Atlantic +73(GMT+08:00) Perth 75 (GMT+08:00) Taipei +
29(GMT-01:00) Azores +20(GMT+09:00) Osaka, Sapporo, Tokyo 72 (GMT+09:00) Seoul +
53(GMT-01:00) Cape Verde Is.70(GMT+09:00) Yakutsk 19 (GMT+09:30) Adelaide +
31(GMT) Casablanca, Monrovia +44(GMT+09:30) Darwin +
2(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London +18(GMT+10:00) Brisbane +
4(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna +76(GMT+10:00) Canberra, Melbourne, Sydney +
6(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague +43(GMT+10:00) Guam, Port Moresby +
3(GMT+01:00) Brussels, Copenhagen, Madrid, Paris +42(GMT+10:00) Hobart
57(GMT+01:00) Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb +68(GMT+10:00) Vladivostok +
69(GMT+01:00) West Central Africa +41(GMT+11:00) Magadan, Solomon Is., New Caledonia +
7(GMT+02:00) Athens, Istanbul, Minsk +17(GMT+12:00) Auckland, Wellington +
5(GMT+02:00) Bucharest40 +(GMT+12:00) Fiji, Kamchatka, Marshall Is. +
49 +(GMT+02:00) Cairo +67 +(GMT+13:00) Nuku'alofa +
50 +(GMT+02:00) Harare, Pretoria +

Currency IDs

Web sites based on Windows SharePoint Services can be set to use the following currencies. +

IDCurrency +IDCurrency +
51211,254 .ج.د (Arabic-Algeria) +4106 +Q1,254 (Guatemala) +
15361 +1,254 .ب.د (Arabic-Bahrain) +18442 +L. 1254 (Honduras) +
3073 +1,254 .م.ج (Arabic-Egypt)3076 +HK$1,254 (Hong Kong) +
2049 +1,254 .ع.د (Arabic-Iraq) +1038 +1 254 Ft (Hungary) +
11265 +1,254 .ا.د (Arabic-Jordan) +1081 +रु 1,254 (India) +
13313 +1,254 .ك.د (Arabic-Kuwait) +6153 +IR£1,254 (Ireland) +
12289 +1,254 .ل.ل (Arabic-Lebanon) +1037 +₪1,254 (Israel) +
4097 +1,254 .ل.د (Arabic-Libya) +1041 +¥1,254 (Japan) +
6145 +1,254 .م.د (Arabic-Morocco) +1042 +₩1,254 (Korea) +
8193 +1,254 .ع.ر (Arabic-Oman) +2058 +$1,254 (Mexico) +
16385 +1,254 .ق.ر (Arabic-Qatar) +5129 +$1,254 (New Zealand) +
1025 +1,254 .س.ر (Arabic-Saudi Arabia) +19466 +C$ 1254 (Nicaragua) +
10241 +1,254 .س.ل (Arabic-Syria) +1044 +kr 1 254 (Norway) +
7169 +1,254 .ت.د (Arabic-Tunisia) +1056 +Rs 1,254 (Pakistan) +
14337 +1,254 .إ.د (Arabic-U.A.E) +6154 +B/. 1,254 (Panama) +
9217 +1,254 .ي.ر (Arabic-Yemen) +15370 +Gs 1.254 (Paraguay) +
11274 +$ 1.254 (Argentina) +2052 +ï¿¥1,254 (People's Republic of China) +
3081 +$1,254 (Australia) +10250 +S/. 1,254 (Peru) +
3079 +öS 1.254 (Austria) +1045 +1 254 zł (Poland) +
16394 +$b 1.254 (Bolivia) +1049 +1 254р. (Russia) +
1046 +R$ 1.254 (Brazil) +4100 +$1,254 (Singapore) +
3084 +1 254 $ (Canada) +1051 +1 254 Sk (Slovakia) +
4105 +$1,254 (Canada) +1060 +1.254 SIT (Slovenia) +
13322 +$ 1.254 (Chile) +7177 +R 1,254 (South Africa) +
9226 +$ 1.254 (Colombia) +1053 +1.254 kr (Sweden) +
5130 +C1.254 (Costa Rica) +2055 +SFr. 1'254 (Switzerland) +
1029 +1 254 Kč (Czech Republic) +1028 +NT$1,254 (Taiwan) +
1030 +kr 1.254 (Denmark) +1054 +฿1,254 (Thai) +
7178 +RD$1,254 (Dominican Republic) +1055 +1.254 TL (Turkey) +
17418 +C1254 (El Salvador) +2057 +£1,254 (United Kingdom) +
-2 +1,254 € (European Union) +1033 +$1,254 (United States) +
-1 +€ 1,254 (European Union) +14346 +$U 1.254 (Uruguay) +
1065 +1,254 ريال (Farsi) +8202 +Bs 1.254 (Venezuela) +
1032 +1.254 Δρχ (Greece) +1066 +1,254 ₫ (Vietnamese) +
©2003 Microsoft Corporation. All rights reserved.
diff --git a/development/Win32/vld/src/crtmfcpatch.h b/development/Win32/vld/src/crtmfcpatch.h index addcacd6b1..e412fa0ce4 100644 --- a/development/Win32/vld/src/crtmfcpatch.h +++ b/development/Win32/vld/src/crtmfcpatch.h @@ -1,965 +1,965 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Leak Detector - CRT and MFC IAT Patch Functions Header -// Copyright (c) 2009 Dan Moulding -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// -// See COPYING.txt for the full terms of the GNU Lesser General Public License. -// -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#ifndef VLDBUILD -#error \ -"This header should only be included by Visual Leak Detector when building it from source. \ -Applications should never include this header." -#endif - -#include "vldint.h" -extern __declspec(dllexport) VisualLeakDetector vld; - -#define TEMPLATE_HEADER \ -template - -#define TEMPLATE_ARGS \ - crtddll, mfcddll, mfcuddll,\ - crtd_vector_new_name, crtd_vector_new_dbg_name,\ - crtd_scalar_new_name, crtd_scalar_new_dbg_name,\ - mfcd_vector_new_ordinal, mfcd_vector_new_dbg_4p_ordinal, mfcd_vector_new_dbg_3p_ordinal,\ - mfcd_scalar_new_ordinal, mfcd_scalar_new_dbg_4p_ordinal, mfcd_scalar_new_dbg_3p_ordinal,\ - mfcud_vector_new_ordinal, mfcud_vector_new_dbg_4p_ordinal, mfcud_vector_new_dbg_3p_ordinal,\ - mfcud_scalar_new_ordinal, mfcud_scalar_new_dbg_4p_ordinal, mfcud_scalar_new_dbg_3p_ordinal - -TEMPLATE_HEADER -class CrtMfcPatch -{ -public: - static void* __cdecl crtd__calloc_dbg (size_t num, size_t size, int type, char const *file, int line); - static void* __cdecl crtd__malloc_dbg (size_t size, int type, const char *file, int line); - static void* __cdecl crtd__realloc_dbg (void *mem, size_t size, int type, char const *file, int line); - static void* __cdecl crtd__scalar_new_dbg (size_t size, int type, char const *file, int line); - static void* __cdecl crtd__vector_new_dbg (size_t size, int type, char const *file, int line); - static void* __cdecl crtd_calloc (size_t num, size_t size); - static void* __cdecl crtd_malloc (size_t size); - static void* __cdecl crtd_realloc (void *mem, size_t size); - static void* __cdecl crtd_scalar_new (size_t size); - static void* __cdecl crtd_vector_new (size_t size); - - template - static void* __cdecl crtd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line); - template - static void* __cdecl crtd_new (SIZE_T fp, size_t size); - - static void* __cdecl mfcd_vector_new (size_t size); - static void* __cdecl mfcd__vector_new_dbg_4p (size_t size, int type, char const *file, int line); - static void* __cdecl mfcd__vector_new_dbg_3p (size_t size, char const *file, int line); - static void* __cdecl mfcd_scalar_new (size_t size); - static void* __cdecl mfcd__scalar_new_dbg_4p (size_t size, int type, char const *file, int line); - static void* __cdecl mfcd__scalar_new_dbg_3p (size_t size, char const *file, int line); - static void* __cdecl mfcud_vector_new (size_t size); - static void* __cdecl mfcud__vector_new_dbg_4p (size_t size, int type, char const *file, int line); - static void* __cdecl mfcud__vector_new_dbg_3p (size_t size, char const *file, int line); - static void* __cdecl mfcud_scalar_new (size_t size); - static void* __cdecl mfcud__scalar_new_dbg_4p (size_t size, int type, char const *file, int line); - static void* __cdecl mfcud__scalar_new_dbg_3p (size_t size, char const *file, int line); - - template - static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line); - template - static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, char const *file, int line); - template - static void* __cdecl mfcd_new (SIZE_T fp, size_t size); -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Studio DLLs -// -//////////////////////////////////////////////////////////////////////////////// - -// crtd__calloc_dbg - Calls to _calloc_dbg from msvcrXXd.dll are patched -// through to this function. -// -// - mem (IN): Pointer to the memory block to be reallocated. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The CRT "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by _calloc_dbg. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd__calloc_dbg (size_t num, - size_t size, - int type, - char const *file, - int line) -{ - static _calloc_dbg_t pcrtxxd__calloc_dbg = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd__calloc_dbg == NULL) { - // This is the first call to this function. Link to the real - // _calloc_dbg. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd__calloc_dbg = (_calloc_dbg_t)GetProcAddress(msvcrxxd, "_calloc_dbg"); - } - - return vld.__calloc_dbg(pcrtxxd__calloc_dbg, fp, num, size, type, file, line); -} - -// crtd__malloc_dbg - Calls to _malloc_dbg from msvcrXXd.dll are patched -// through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The CRT "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by _malloc_dbg. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd__malloc_dbg (size_t size, - int type, - char const *file, - int line) -{ - static _malloc_dbg_t pcrtxxd__malloc_dbg = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd__malloc_dbg == NULL) { - // This is the first call to this function. Link to the real - // _malloc_dbg. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd__malloc_dbg = (_malloc_dbg_t)GetProcAddress(msvcrxxd, "_malloc_dbg"); - } - - return vld.__malloc_dbg(pcrtxxd__malloc_dbg, fp, size, type, file, line); -} - -// crtd__realloc_dbg - Calls to _realloc_dbg from msvcrXXd.dll are patched -// through to this function. -// -// - mem (IN): Pointer to the memory block to be reallocated. -// -// - size (IN): The size of the memory block to reallocate. -// -// - type (IN): The CRT "use type" of the block to be reallocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by _realloc_dbg. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd__realloc_dbg (void *mem, - size_t size, - int type, - char const *file, - int line) -{ - static _realloc_dbg_t pcrtxxd__realloc_dbg = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd__realloc_dbg == NULL) { - // This is the first call to this function. Link to the real - // _realloc_dbg. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd__realloc_dbg = (_realloc_dbg_t)GetProcAddress(msvcrxxd, "_realloc_dbg"); - } - - return vld.__realloc_dbg(pcrtxxd__realloc_dbg, fp, mem, size, type, file, line); -} - -// crtd__scalar_new_dbg - Calls to the CRT's debug scalar new operator from -// msvcrXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The CRT "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the CRT debug scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd__scalar_new_dbg (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return crtd_new_dbg(fp, size, type, file, line); -} - -// crtd__vector_new_dbg - Calls to the CRT's debug vector new operator from -// msvcrXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The CRT "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the CRT debug vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd__vector_new_dbg (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return crtd_new_dbg(fp, size, type, file, line); -} - -// crtd_calloc - Calls to calloc from msvcrXXd.dll are patched through to -// this function. -// -// - dll (IN): The name of the dll -// -// - num (IN): The number of blocks, of size 'size', to be allocated. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the valued returned from calloc. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd_calloc (size_t num, size_t size) -{ - static calloc_t pcrtxxd_calloc = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd_calloc == NULL) { - // This is the first call to this function. Link to the real malloc. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd_calloc = (calloc_t)GetProcAddress(msvcrxxd, "calloc"); - } - - return vld._calloc(pcrtxxd_calloc, fp, num, size); -} - -// crtd_malloc - Calls to malloc from msvcrXXd.dll are patched through to -// this function. -// -// - dll (IN): The name of the dll -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the valued returned from malloc. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd_malloc (size_t size) -{ - static malloc_t pcrtxxd_malloc = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd_malloc == NULL) { - // This is the first call to this function. Link to the real malloc. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd_malloc = (malloc_t)GetProcAddress(msvcrxxd, "malloc"); - } - - return vld._malloc(pcrtxxd_malloc, fp, size); -} - -// crtd_realloc - Calls to realloc from msvcrXXd.dll are patched through to -// this function. -// -// - dll (IN): The name of the dll -// -// - mem (IN): Pointer to the memory block to reallocate. -// -// - size (IN): Size of the memory block to reallocate. -// -// Return Value: -// -// Returns the value returned from realloc. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd_realloc (void *mem, size_t size) -{ - static realloc_t pcrtxxd_realloc = NULL; - - SIZE_T fp; - HMODULE msvcrxxd; - - FRAMEPOINTER(fp); - - if (pcrtxxd_realloc == NULL) { - // This is the first call to this function. Link to the real realloc. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd_realloc = (realloc_t)GetProcAddress(msvcrxxd, "realloc"); - } - - return vld._realloc(pcrtxxd_realloc, fp, mem, size); -} - -// crtd_scalar_new - Calls to the CRT's scalar new operator from msvcrXXd.dll -// are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the CRT scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd_scalar_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return crtd_new(fp, size); -} - -// crtd_vector_new - Calls to the CRT's vector new operator from msvcrXXd.dll -// are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the CRT vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::crtd_vector_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return crtd_new(fp, size); -} - -// crtd_new_dbg - A template function for implementation of patch functions to -// the CRT's debug new operator from msvcrXXd.dll -// -// - procname (IN): The debug new operator's name -// -// - fp (IN): Frame pointer from the call that initiated this allocation. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The CRT "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the CRT debug new operator. -// -TEMPLATE_HEADER -template -void* CrtMfcPatch::crtd_new_dbg (SIZE_T fp, - size_t size, - int type, - char const *file, - int line) -{ - static new_dbg_crt_t pcrtxxd_new_dbg = NULL; - - HMODULE msvcrxxd; - - if (pcrtxxd_new_dbg == NULL) { - // This is the first call to this function. Link to the real CRT debug - // new operator. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd_new_dbg = (new_dbg_crt_t)GetProcAddress(msvcrxxd, procname); - } - - return vld.new_dbg_crt(pcrtxxd_new_dbg, fp, size, type, file, line); -} - -// crt_new - A template function for implementing patch functions to the -// CRT's new operator from msvcrXXd.dll -// -// - dll (IN): The name of the dll -// -// - procname (IN): The debug new operator's name -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the CRT new operator. -// -TEMPLATE_HEADER -template -void* CrtMfcPatch::crtd_new (SIZE_T fp, size_t size) -{ - static new_t pcrtxxd_scalar_new = NULL; - - HMODULE msvcrxxd; - - if (pcrtxxd_scalar_new == NULL) { - // This is the first call to this function. Link to the real CRT new - // operator. - msvcrxxd = GetModuleHandle(crtddll); - pcrtxxd_scalar_new = (new_t)GetProcAddress(msvcrxxd, procname); - } - - return vld._new(pcrtxxd_scalar_new, fp, size); -} - -//////////////////////////////////////////////////////////////////////////////// -// -// MFC DLLs -// -//////////////////////////////////////////////////////////////////////////////// - -// mfcd__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from -// mfcXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd__scalar_new_dbg_4p (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, type, file, line); -} - -// mfcd__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from -// mfcXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd__scalar_new_dbg_3p (size_t size, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, file, line); -} - -// mfcd__vector_new_dbg_4p - Calls to the MFC debug vector new operator from -// mfcXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd__vector_new_dbg_4p (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, type, file, line); -} - -// mfcd__vector_new_dbg_3p - Calls to the MFC debug vector new operator from -// mfcXXd.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd__vector_new_dbg_3p (size_t size, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, file, line); -} - -// mfcd_scalar_new - Calls to the MFC scalar new operator from mfcXXd.dll are -// patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the MFC scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd_scalar_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new(fp, size); -} - -// mfcd_vector_new - Calls to the MFC vector new operator from mfcXXd.dll are -// patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the MFC vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcd_vector_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new(fp, size); -} - -// mfcud__scalar_new_dbg_4p - Calls to the MFC debug scalar new operator from -// mfcXXud.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud__scalar_new_dbg_4p (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, type, file, line); -} - -// mfcud__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from -// mfcXXud.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud__scalar_new_dbg_3p (size_t size, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, file, line); -} - -// mfcud__vector_new_dbg_4p - Calls to the MFC debug vector new operator from -// mfcXXud.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - type (IN): The "use type" of the block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud__vector_new_dbg_4p (size_t size, - int type, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, type, file, line); -} - -// mfcud__vector_new_dbg_3p - Calls to the MFC debug vector new operator from -// mfcXXud.dll are patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud__vector_new_dbg_3p (size_t size, - char const *file, - int line) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new_dbg - (fp, size, file, line); -} - -// mfcud_scalar_new - Calls to the MFC scalar new operator from mfcXXud.dll are -// patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the MFC scalar new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud_scalar_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new(fp, size); -} - -// mfcud_vector_new - Calls to the MFC vector new operator from mfcXXud.dll are -// patched through to this function. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the MFC vector new operator. -// -TEMPLATE_HEADER -void* CrtMfcPatch::mfcud_vector_new (size_t size) -{ - SIZE_T fp; - FRAMEPOINTER(fp); - - return mfcd_new(fp, size); -} - -// mfcd_new_dbg - A generic function for implementing patch functions to the MFC -// debug new operators: -// void* __cdecl operator new[](size_t size, int type, char const *file, int line) -// void* __cdecl operator new(size_t size, int type, char const *file, int line) -// -// - mfcdll (IN): The name of the MFC DLL -// -// - ordinal (IN): The debug new operator's ordinal value -// -// - type (IN): The "use type" of the block to be allocated. -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug new operator. -// -TEMPLATE_HEADER -template -void* CrtMfcPatch::mfcd_new_dbg (SIZE_T fp, - size_t size, - int type, - char const *file, - int line) -{ - static new_dbg_crt_t pmfcxxd__new_dbg = NULL; - - HMODULE mfcxxd; - - if (pmfcxxd__new_dbg == NULL) { - // This is the first call to this function. Link to the real MFC debug - // new operator. - mfcxxd = GetModuleHandle(mfcdll); - pmfcxxd__new_dbg = (new_dbg_crt_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); - } - - return vld.new_dbg_mfc(pmfcxxd__new_dbg, fp, size, type, file, line); -} - -// mfcd_new_dbg - A generic function for implementing patch functions to the MFC -// debug new operators: -// void* __cdecl operator new[](size_t size, char const *file, int line) -// void* __cdecl operator new(size_t size, char const *file, int line) -// -// - mfcdll (IN): The name of the MFC DLL -// -// - ordinal (IN): The debug new operator's ordinal value -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// - file (IN): The name of the file from which this function is being called. -// -// - line (IN): The line number, in the above file, at which this function is -// being called. -// -// Return Value: -// -// Returns the value returned by the MFC debug new operator. -// -TEMPLATE_HEADER -template -void* CrtMfcPatch::mfcd_new_dbg (SIZE_T fp, - size_t size, - char const *file, - int line) -{ - static new_dbg_mfc_t pmfcxxd__new_dbg = NULL; - - HMODULE mfcxxd; - - if (pmfcxxd__new_dbg == NULL) { - // This is the first call to this function. Link to the real MFC debug - // new operator. - mfcxxd = GetModuleHandle(mfcdll); - pmfcxxd__new_dbg = (new_dbg_mfc_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); - } - - return vld.new_dbg_mfc(pmfcxxd__new_dbg, fp, size, file, line); -} - -// mfcd_new - A generic function for implementing patch functions to the MFC new -// operators. -// -// - mfcdll (IN): The name of the MFC DLL -// -// - ordinal (IN): The new operator's ordinal value -// -// - size (IN): The size, in bytes, of the memory block to be allocated. -// -// Return Value: -// -// Returns the value returned by the MFC new operator. -// -TEMPLATE_HEADER -template -void* CrtMfcPatch::mfcd_new (SIZE_T fp, size_t size) -{ - static new_t pmfcxxd_new = NULL; - - HMODULE mfcxxd; - - if (pmfcxxd_new == NULL) { - // This is the first call to this function. Link to the real CRT new - // operator. - mfcxxd = GetModuleHandle(mfcdll); - pmfcxxd_new = (new_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); - } - - return vld._new(pmfcxxd_new, fp, size); -} - -#undef TEMPLATE_HEADER -#undef TEMPLATE_ARGS - -const extern char scalar_new_dbg_name[] = "??2@YAPAXIHPBDH@Z"; -const extern char vector_new_dbg_name[] = "??_U@YAPAXIHPBDH@Z"; -const extern char scalar_new_name[] = "??2@YAPAXI@Z"; -const extern char vector_new_name[] = "??_U@YAPAXI@Z"; -const extern wchar_t msvcrtd_dll[] = L"msvcrtd.dll"; -const extern wchar_t mfc42d_dll[] = L"mfc42d.dll"; -const extern wchar_t mfc42ud_dll[] = L"mfc42ud.dll"; -const extern wchar_t msvcr70d_dll[] = L"msvcr70d.dll"; -const extern wchar_t mfc70d_dll[] = L"mfc70d.dll"; -const extern wchar_t mfc70ud_dll[] = L"mfc70ud.dll"; -const extern wchar_t msvcr71d_dll[] = L"msvcr71d.dll"; -const extern wchar_t mfc71d_dll[] = L"mfc71d.dll"; -const extern wchar_t mfc71ud_dll[] = L"mfc71ud.dll"; -const extern wchar_t msvcr80d_dll[] = L"msvcr80d.dll"; -const extern wchar_t mfc80d_dll[] = L"mfc80d.dll"; -const extern wchar_t mfc80ud_dll[] = L"mfc80ud.dll"; -const extern wchar_t msvcr90d_dll[] = L"msvcr90d.dll"; -const extern wchar_t mfc90d_dll[] = L"mfc90d.dll"; -const extern wchar_t mfc90ud_dll[] = L"mfc90ud.dll"; -const extern wchar_t msvcr100d_dll[] = L"msvcr100d.dll"; -const extern wchar_t mfc100d_dll[] = L"mfc100d.dll"; -const extern wchar_t mfc100ud_dll[] = L"mfc100ud.dll"; - -// Visual Studio 6.0 -typedef CrtMfcPatch - VS60; -// Visual Studio .NET 2002 -typedef CrtMfcPatch - VS70; -// Visual Studio .NET 2003 -typedef CrtMfcPatch - VS71; -// Visual Studio 2005 -typedef CrtMfcPatch - VS80; -// Visual Studio 2008 -typedef CrtMfcPatch - VS90; - -// Visual Studio 2010 -typedef CrtMfcPatch - VS100; \ No newline at end of file +//////////////////////////////////////////////////////////////////////////////// +// +// Visual Leak Detector - CRT and MFC IAT Patch Functions Header +// Copyright (c) 2009 Dan Moulding +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +// See COPYING.txt for the full terms of the GNU Lesser General Public License. +// +//////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#ifndef VLDBUILD +#error \ +"This header should only be included by Visual Leak Detector when building it from source. \ +Applications should never include this header." +#endif + +#include "vldint.h" +extern __declspec(dllexport) VisualLeakDetector vld; + +#define TEMPLATE_HEADER \ +template + +#define TEMPLATE_ARGS \ + crtddll, mfcddll, mfcuddll,\ + crtd_vector_new_name, crtd_vector_new_dbg_name,\ + crtd_scalar_new_name, crtd_scalar_new_dbg_name,\ + mfcd_vector_new_ordinal, mfcd_vector_new_dbg_4p_ordinal, mfcd_vector_new_dbg_3p_ordinal,\ + mfcd_scalar_new_ordinal, mfcd_scalar_new_dbg_4p_ordinal, mfcd_scalar_new_dbg_3p_ordinal,\ + mfcud_vector_new_ordinal, mfcud_vector_new_dbg_4p_ordinal, mfcud_vector_new_dbg_3p_ordinal,\ + mfcud_scalar_new_ordinal, mfcud_scalar_new_dbg_4p_ordinal, mfcud_scalar_new_dbg_3p_ordinal + +TEMPLATE_HEADER +class CrtMfcPatch +{ +public: + static void* __cdecl crtd__calloc_dbg (size_t num, size_t size, int type, char const *file, int line); + static void* __cdecl crtd__malloc_dbg (size_t size, int type, const char *file, int line); + static void* __cdecl crtd__realloc_dbg (void *mem, size_t size, int type, char const *file, int line); + static void* __cdecl crtd__scalar_new_dbg (size_t size, int type, char const *file, int line); + static void* __cdecl crtd__vector_new_dbg (size_t size, int type, char const *file, int line); + static void* __cdecl crtd_calloc (size_t num, size_t size); + static void* __cdecl crtd_malloc (size_t size); + static void* __cdecl crtd_realloc (void *mem, size_t size); + static void* __cdecl crtd_scalar_new (size_t size); + static void* __cdecl crtd_vector_new (size_t size); + + template + static void* __cdecl crtd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line); + template + static void* __cdecl crtd_new (SIZE_T fp, size_t size); + + static void* __cdecl mfcd_vector_new (size_t size); + static void* __cdecl mfcd__vector_new_dbg_4p (size_t size, int type, char const *file, int line); + static void* __cdecl mfcd__vector_new_dbg_3p (size_t size, char const *file, int line); + static void* __cdecl mfcd_scalar_new (size_t size); + static void* __cdecl mfcd__scalar_new_dbg_4p (size_t size, int type, char const *file, int line); + static void* __cdecl mfcd__scalar_new_dbg_3p (size_t size, char const *file, int line); + static void* __cdecl mfcud_vector_new (size_t size); + static void* __cdecl mfcud__vector_new_dbg_4p (size_t size, int type, char const *file, int line); + static void* __cdecl mfcud__vector_new_dbg_3p (size_t size, char const *file, int line); + static void* __cdecl mfcud_scalar_new (size_t size); + static void* __cdecl mfcud__scalar_new_dbg_4p (size_t size, int type, char const *file, int line); + static void* __cdecl mfcud__scalar_new_dbg_3p (size_t size, char const *file, int line); + + template + static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, int type, char const *file, int line); + template + static void* __cdecl mfcd_new_dbg (SIZE_T fp, size_t size, char const *file, int line); + template + static void* __cdecl mfcd_new (SIZE_T fp, size_t size); +}; + + +//////////////////////////////////////////////////////////////////////////////// +// +// Visual Studio DLLs +// +//////////////////////////////////////////////////////////////////////////////// + +// crtd__calloc_dbg - Calls to _calloc_dbg from msvcrXXd.dll are patched +// through to this function. +// +// - mem (IN): Pointer to the memory block to be reallocated. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The CRT "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by _calloc_dbg. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd__calloc_dbg (size_t num, + size_t size, + int type, + char const *file, + int line) +{ + static _calloc_dbg_t pcrtxxd__calloc_dbg = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd__calloc_dbg == NULL) { + // This is the first call to this function. Link to the real + // _calloc_dbg. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd__calloc_dbg = (_calloc_dbg_t)GetProcAddress(msvcrxxd, "_calloc_dbg"); + } + + return vld.__calloc_dbg(pcrtxxd__calloc_dbg, fp, num, size, type, file, line); +} + +// crtd__malloc_dbg - Calls to _malloc_dbg from msvcrXXd.dll are patched +// through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The CRT "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by _malloc_dbg. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd__malloc_dbg (size_t size, + int type, + char const *file, + int line) +{ + static _malloc_dbg_t pcrtxxd__malloc_dbg = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd__malloc_dbg == NULL) { + // This is the first call to this function. Link to the real + // _malloc_dbg. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd__malloc_dbg = (_malloc_dbg_t)GetProcAddress(msvcrxxd, "_malloc_dbg"); + } + + return vld.__malloc_dbg(pcrtxxd__malloc_dbg, fp, size, type, file, line); +} + +// crtd__realloc_dbg - Calls to _realloc_dbg from msvcrXXd.dll are patched +// through to this function. +// +// - mem (IN): Pointer to the memory block to be reallocated. +// +// - size (IN): The size of the memory block to reallocate. +// +// - type (IN): The CRT "use type" of the block to be reallocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by _realloc_dbg. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd__realloc_dbg (void *mem, + size_t size, + int type, + char const *file, + int line) +{ + static _realloc_dbg_t pcrtxxd__realloc_dbg = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd__realloc_dbg == NULL) { + // This is the first call to this function. Link to the real + // _realloc_dbg. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd__realloc_dbg = (_realloc_dbg_t)GetProcAddress(msvcrxxd, "_realloc_dbg"); + } + + return vld.__realloc_dbg(pcrtxxd__realloc_dbg, fp, mem, size, type, file, line); +} + +// crtd__scalar_new_dbg - Calls to the CRT's debug scalar new operator from +// msvcrXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The CRT "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the CRT debug scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd__scalar_new_dbg (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return crtd_new_dbg(fp, size, type, file, line); +} + +// crtd__vector_new_dbg - Calls to the CRT's debug vector new operator from +// msvcrXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The CRT "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the CRT debug vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd__vector_new_dbg (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return crtd_new_dbg(fp, size, type, file, line); +} + +// crtd_calloc - Calls to calloc from msvcrXXd.dll are patched through to +// this function. +// +// - dll (IN): The name of the dll +// +// - num (IN): The number of blocks, of size 'size', to be allocated. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the valued returned from calloc. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd_calloc (size_t num, size_t size) +{ + static calloc_t pcrtxxd_calloc = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd_calloc == NULL) { + // This is the first call to this function. Link to the real malloc. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd_calloc = (calloc_t)GetProcAddress(msvcrxxd, "calloc"); + } + + return vld._calloc(pcrtxxd_calloc, fp, num, size); +} + +// crtd_malloc - Calls to malloc from msvcrXXd.dll are patched through to +// this function. +// +// - dll (IN): The name of the dll +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the valued returned from malloc. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd_malloc (size_t size) +{ + static malloc_t pcrtxxd_malloc = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd_malloc == NULL) { + // This is the first call to this function. Link to the real malloc. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd_malloc = (malloc_t)GetProcAddress(msvcrxxd, "malloc"); + } + + return vld._malloc(pcrtxxd_malloc, fp, size); +} + +// crtd_realloc - Calls to realloc from msvcrXXd.dll are patched through to +// this function. +// +// - dll (IN): The name of the dll +// +// - mem (IN): Pointer to the memory block to reallocate. +// +// - size (IN): Size of the memory block to reallocate. +// +// Return Value: +// +// Returns the value returned from realloc. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd_realloc (void *mem, size_t size) +{ + static realloc_t pcrtxxd_realloc = NULL; + + SIZE_T fp; + HMODULE msvcrxxd; + + FRAMEPOINTER(fp); + + if (pcrtxxd_realloc == NULL) { + // This is the first call to this function. Link to the real realloc. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd_realloc = (realloc_t)GetProcAddress(msvcrxxd, "realloc"); + } + + return vld._realloc(pcrtxxd_realloc, fp, mem, size); +} + +// crtd_scalar_new - Calls to the CRT's scalar new operator from msvcrXXd.dll +// are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the CRT scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd_scalar_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return crtd_new(fp, size); +} + +// crtd_vector_new - Calls to the CRT's vector new operator from msvcrXXd.dll +// are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the CRT vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::crtd_vector_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return crtd_new(fp, size); +} + +// crtd_new_dbg - A template function for implementation of patch functions to +// the CRT's debug new operator from msvcrXXd.dll +// +// - procname (IN): The debug new operator's name +// +// - fp (IN): Frame pointer from the call that initiated this allocation. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The CRT "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the CRT debug new operator. +// +TEMPLATE_HEADER +template +void* CrtMfcPatch::crtd_new_dbg (SIZE_T fp, + size_t size, + int type, + char const *file, + int line) +{ + static new_dbg_crt_t pcrtxxd_new_dbg = NULL; + + HMODULE msvcrxxd; + + if (pcrtxxd_new_dbg == NULL) { + // This is the first call to this function. Link to the real CRT debug + // new operator. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd_new_dbg = (new_dbg_crt_t)GetProcAddress(msvcrxxd, procname); + } + + return vld.new_dbg_crt(pcrtxxd_new_dbg, fp, size, type, file, line); +} + +// crt_new - A template function for implementing patch functions to the +// CRT's new operator from msvcrXXd.dll +// +// - dll (IN): The name of the dll +// +// - procname (IN): The debug new operator's name +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the CRT new operator. +// +TEMPLATE_HEADER +template +void* CrtMfcPatch::crtd_new (SIZE_T fp, size_t size) +{ + static new_t pcrtxxd_scalar_new = NULL; + + HMODULE msvcrxxd; + + if (pcrtxxd_scalar_new == NULL) { + // This is the first call to this function. Link to the real CRT new + // operator. + msvcrxxd = GetModuleHandle(crtddll); + pcrtxxd_scalar_new = (new_t)GetProcAddress(msvcrxxd, procname); + } + + return vld._new(pcrtxxd_scalar_new, fp, size); +} + +//////////////////////////////////////////////////////////////////////////////// +// +// MFC DLLs +// +//////////////////////////////////////////////////////////////////////////////// + +// mfcd__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from +// mfcXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd__scalar_new_dbg_4p (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, type, file, line); +} + +// mfcd__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from +// mfcXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd__scalar_new_dbg_3p (size_t size, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, file, line); +} + +// mfcd__vector_new_dbg_4p - Calls to the MFC debug vector new operator from +// mfcXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd__vector_new_dbg_4p (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, type, file, line); +} + +// mfcd__vector_new_dbg_3p - Calls to the MFC debug vector new operator from +// mfcXXd.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd__vector_new_dbg_3p (size_t size, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, file, line); +} + +// mfcd_scalar_new - Calls to the MFC scalar new operator from mfcXXd.dll are +// patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the MFC scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd_scalar_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new(fp, size); +} + +// mfcd_vector_new - Calls to the MFC vector new operator from mfcXXd.dll are +// patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the MFC vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcd_vector_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new(fp, size); +} + +// mfcud__scalar_new_dbg_4p - Calls to the MFC debug scalar new operator from +// mfcXXud.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud__scalar_new_dbg_4p (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, type, file, line); +} + +// mfcud__scalar_new_dbg_3p - Calls to the MFC debug scalar new operator from +// mfcXXud.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud__scalar_new_dbg_3p (size_t size, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, file, line); +} + +// mfcud__vector_new_dbg_4p - Calls to the MFC debug vector new operator from +// mfcXXud.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - type (IN): The "use type" of the block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud__vector_new_dbg_4p (size_t size, + int type, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, type, file, line); +} + +// mfcud__vector_new_dbg_3p - Calls to the MFC debug vector new operator from +// mfcXXud.dll are patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud__vector_new_dbg_3p (size_t size, + char const *file, + int line) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new_dbg + (fp, size, file, line); +} + +// mfcud_scalar_new - Calls to the MFC scalar new operator from mfcXXud.dll are +// patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the MFC scalar new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud_scalar_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new(fp, size); +} + +// mfcud_vector_new - Calls to the MFC vector new operator from mfcXXud.dll are +// patched through to this function. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the MFC vector new operator. +// +TEMPLATE_HEADER +void* CrtMfcPatch::mfcud_vector_new (size_t size) +{ + SIZE_T fp; + FRAMEPOINTER(fp); + + return mfcd_new(fp, size); +} + +// mfcd_new_dbg - A generic function for implementing patch functions to the MFC +// debug new operators: +// void* __cdecl operator new[](size_t size, int type, char const *file, int line) +// void* __cdecl operator new(size_t size, int type, char const *file, int line) +// +// - mfcdll (IN): The name of the MFC DLL +// +// - ordinal (IN): The debug new operator's ordinal value +// +// - type (IN): The "use type" of the block to be allocated. +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug new operator. +// +TEMPLATE_HEADER +template +void* CrtMfcPatch::mfcd_new_dbg (SIZE_T fp, + size_t size, + int type, + char const *file, + int line) +{ + static new_dbg_crt_t pmfcxxd__new_dbg = NULL; + + HMODULE mfcxxd; + + if (pmfcxxd__new_dbg == NULL) { + // This is the first call to this function. Link to the real MFC debug + // new operator. + mfcxxd = GetModuleHandle(mfcdll); + pmfcxxd__new_dbg = (new_dbg_crt_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); + } + + return vld.new_dbg_mfc(pmfcxxd__new_dbg, fp, size, type, file, line); +} + +// mfcd_new_dbg - A generic function for implementing patch functions to the MFC +// debug new operators: +// void* __cdecl operator new[](size_t size, char const *file, int line) +// void* __cdecl operator new(size_t size, char const *file, int line) +// +// - mfcdll (IN): The name of the MFC DLL +// +// - ordinal (IN): The debug new operator's ordinal value +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// - file (IN): The name of the file from which this function is being called. +// +// - line (IN): The line number, in the above file, at which this function is +// being called. +// +// Return Value: +// +// Returns the value returned by the MFC debug new operator. +// +TEMPLATE_HEADER +template +void* CrtMfcPatch::mfcd_new_dbg (SIZE_T fp, + size_t size, + char const *file, + int line) +{ + static new_dbg_mfc_t pmfcxxd__new_dbg = NULL; + + HMODULE mfcxxd; + + if (pmfcxxd__new_dbg == NULL) { + // This is the first call to this function. Link to the real MFC debug + // new operator. + mfcxxd = GetModuleHandle(mfcdll); + pmfcxxd__new_dbg = (new_dbg_mfc_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); + } + + return vld.new_dbg_mfc(pmfcxxd__new_dbg, fp, size, file, line); +} + +// mfcd_new - A generic function for implementing patch functions to the MFC new +// operators. +// +// - mfcdll (IN): The name of the MFC DLL +// +// - ordinal (IN): The new operator's ordinal value +// +// - size (IN): The size, in bytes, of the memory block to be allocated. +// +// Return Value: +// +// Returns the value returned by the MFC new operator. +// +TEMPLATE_HEADER +template +void* CrtMfcPatch::mfcd_new (SIZE_T fp, size_t size) +{ + static new_t pmfcxxd_new = NULL; + + HMODULE mfcxxd; + + if (pmfcxxd_new == NULL) { + // This is the first call to this function. Link to the real CRT new + // operator. + mfcxxd = GetModuleHandle(mfcdll); + pmfcxxd_new = (new_t)GetProcAddress(mfcxxd, (LPCSTR)ordinal); + } + + return vld._new(pmfcxxd_new, fp, size); +} + +#undef TEMPLATE_HEADER +#undef TEMPLATE_ARGS + +const extern char scalar_new_dbg_name[] = "??2@YAPAXIHPBDH@Z"; +const extern char vector_new_dbg_name[] = "??_U@YAPAXIHPBDH@Z"; +const extern char scalar_new_name[] = "??2@YAPAXI@Z"; +const extern char vector_new_name[] = "??_U@YAPAXI@Z"; +const extern wchar_t msvcrtd_dll[] = L"msvcrtd.dll"; +const extern wchar_t mfc42d_dll[] = L"mfc42d.dll"; +const extern wchar_t mfc42ud_dll[] = L"mfc42ud.dll"; +const extern wchar_t msvcr70d_dll[] = L"msvcr70d.dll"; +const extern wchar_t mfc70d_dll[] = L"mfc70d.dll"; +const extern wchar_t mfc70ud_dll[] = L"mfc70ud.dll"; +const extern wchar_t msvcr71d_dll[] = L"msvcr71d.dll"; +const extern wchar_t mfc71d_dll[] = L"mfc71d.dll"; +const extern wchar_t mfc71ud_dll[] = L"mfc71ud.dll"; +const extern wchar_t msvcr80d_dll[] = L"msvcr80d.dll"; +const extern wchar_t mfc80d_dll[] = L"mfc80d.dll"; +const extern wchar_t mfc80ud_dll[] = L"mfc80ud.dll"; +const extern wchar_t msvcr90d_dll[] = L"msvcr90d.dll"; +const extern wchar_t mfc90d_dll[] = L"mfc90d.dll"; +const extern wchar_t mfc90ud_dll[] = L"mfc90ud.dll"; +const extern wchar_t msvcr100d_dll[] = L"msvcr100d.dll"; +const extern wchar_t mfc100d_dll[] = L"mfc100d.dll"; +const extern wchar_t mfc100ud_dll[] = L"mfc100ud.dll"; + +// Visual Studio 6.0 +typedef CrtMfcPatch + VS60; +// Visual Studio .NET 2002 +typedef CrtMfcPatch + VS70; +// Visual Studio .NET 2003 +typedef CrtMfcPatch + VS71; +// Visual Studio 2005 +typedef CrtMfcPatch + VS80; +// Visual Studio 2008 +typedef CrtMfcPatch + VS90; + +// Visual Studio 2010 +typedef CrtMfcPatch + VS100; diff --git a/development/Win32/vld/src/resource.h b/development/Win32/vld/src/resource.h index c6b72e6ec8..c210abbbf8 100644 --- a/development/Win32/vld/src/resource.h +++ b/development/Win32/vld/src/resource.h @@ -1,14 +1,14 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by vld.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by vld.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/development/Win32/vld/src/vld.h b/development/Win32/vld/src/vld.h index 234c87f3ed..27d7b142d4 100644 --- a/development/Win32/vld/src/vld.h +++ b/development/Win32/vld/src/vld.h @@ -1,97 +1,97 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Leak Detector - Import Library Header -// Copyright (c) 2006 Dan Moulding -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// -// See COPYING.txt for the full terms of the GNU Lesser General Public License. -// -//////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#ifdef _DEBUG - -#pragma comment(lib, "vld.lib") - -// Force a symbolic reference to the global VisualLeakDetector class object from -// the DLL. This enusres that the DLL is loaded and linked with the program, -// even if no code otherwise imports any of the DLL's exports. -#pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A") - -//////////////////////////////////////////////////////////////////////////////// -// -// Visual Leak Detector APIs -// - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// VLDDisable - Disables Visual Leak Detector's memory leak detection at -// runtime. If memory leak detection is already disabled, then calling this -// function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only disabled for that thread. If memory leak -// detection is enabled for other threads, then it will remain enabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to disable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// -__declspec(dllimport) void VLDDisable (); - -// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime. -// If memory leak detection is already enabled, which it is by default, then -// calling this function has no effect. -// -// Note: In multithreaded programs, this function operates on a per-thread -// basis. In other words, if you call this function from one thread, then -// memory leak detection is only enabled for that thread. If memory leak -// detection is disabled for other threads, then it will remain disabled for -// those other threads. It was designed to work this way to insulate you, -// the programmer, from having to ensure thread synchronization when calling -// VLDEnable() and VLDDisable(). Without this, calling these two functions -// unsychronized could result in unpredictable and unintended behavior. -// But this also means that if you want to enable memory leak detection -// process-wide, then you need to call this function from every thread in -// the process. -// -// Return Value: -// -// None. -// -__declspec(dllimport) void VLDEnable (); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#else // !_DEBUG - -#define VLDEnable() -#define VLDDisable() - -#endif // _DEBUG +//////////////////////////////////////////////////////////////////////////////// +// +// Visual Leak Detector - Import Library Header +// Copyright (c) 2006 Dan Moulding +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// +// See COPYING.txt for the full terms of the GNU Lesser General Public License. +// +//////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#ifdef _DEBUG + +#pragma comment(lib, "vld.lib") + +// Force a symbolic reference to the global VisualLeakDetector class object from +// the DLL. This enusres that the DLL is loaded and linked with the program, +// even if no code otherwise imports any of the DLL's exports. +#pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A") + +//////////////////////////////////////////////////////////////////////////////// +// +// Visual Leak Detector APIs +// + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// VLDDisable - Disables Visual Leak Detector's memory leak detection at +// runtime. If memory leak detection is already disabled, then calling this +// function has no effect. +// +// Note: In multithreaded programs, this function operates on a per-thread +// basis. In other words, if you call this function from one thread, then +// memory leak detection is only disabled for that thread. If memory leak +// detection is enabled for other threads, then it will remain enabled for +// those other threads. It was designed to work this way to insulate you, +// the programmer, from having to ensure thread synchronization when calling +// VLDEnable() and VLDDisable(). Without this, calling these two functions +// unsychronized could result in unpredictable and unintended behavior. +// But this also means that if you want to disable memory leak detection +// process-wide, then you need to call this function from every thread in +// the process. +// +// Return Value: +// +// None. +// +__declspec(dllimport) void VLDDisable (); + +// VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime. +// If memory leak detection is already enabled, which it is by default, then +// calling this function has no effect. +// +// Note: In multithreaded programs, this function operates on a per-thread +// basis. In other words, if you call this function from one thread, then +// memory leak detection is only enabled for that thread. If memory leak +// detection is disabled for other threads, then it will remain disabled for +// those other threads. It was designed to work this way to insulate you, +// the programmer, from having to ensure thread synchronization when calling +// VLDEnable() and VLDDisable(). Without this, calling these two functions +// unsychronized could result in unpredictable and unintended behavior. +// But this also means that if you want to enable memory leak detection +// process-wide, then you need to call this function from every thread in +// the process. +// +// Return Value: +// +// None. +// +__declspec(dllimport) void VLDEnable (); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#else // !_DEBUG + +#define VLDEnable() +#define VLDDisable() + +#endif // _DEBUG -- 2.39.2