Knowledge (XXG)

Platform Invocation Services

Source 📝

102:
written in unmanaged code or third party libraries also written in unmanaged code. P/Invoke is the technique a programmer can use to access functions in these libraries. Calls to functions within these libraries occur by declaring the signature of the unmanaged function within managed code, which serves as the actual function that can be called like any other managed method. The declaration references the library's file path and defines the function parameters and return in managed types that are most likely to be implicitly marshaled to and from the unmanaged types by the common language run-time (CLR). When the unmanaged data types become too complex for a simple implicit conversion from and to managed types, the framework allows the user to define attributes on the function, return, and/or the parameters to explicitly refine how the data should be marshaled so as not to lead to exceptions in trying to do so implicitly.
1944: 1954: 1964: 22: 1343:
This tool generates C# wrapper DLLs with source code from existing native C++ DLLs and the associated header files which are required by the tool to build a C# wrapper DLL. The P/Invoke signatures and data marshaling are generated by the application. The resulting C# wrapper has the similar interface
105:
There are many abstractions of lower-level programming concepts available to managed code programmers as compared to programming in unmanaged languages. As a result, a programmer with only managed code experience will need to brush up on programming concepts such as pointers, structures, and passing
340:
When using C++/CLI, emitted CIL is free to interact with objects located on the managed heap and simultaneously any addressable native memory location. A managed heap resident object may be called, modified or constructed, using simple "object->field;" notation to assign values or specify method
1318:
Because this tool produces C# source code rather than a compiled dll the user is free to make any changes necessary to the code before use. So the ambiguity problem is solved by the application picking one particular .NET type to use in the P/Invoke method signature and if necessary the user can
331:
Interference with the location of data by the managed language's garbage collector: if a reference is local to a method in .NET and is passed to a native function, when the managed method returns, the garbage collector may reclaim that reference. Care should be taken that the object reference is
101:
Managed code, such as C# or VB.NET, provides native access to classes, methods, and types defined within the libraries that make up the .NET Framework. While the .NET Framework provides an extensive set of functionality, it may lack access to many lower level operating system libraries normally
1283:
array. The actual native memory structure for both is the same, but the respective interface class constructors for each type will populate the memory in different ways. The responsibility for deciding what .NET type needs to be passed into the function is therefore passed to the developer.
1339:
xInterop C++ .NET Bridge is a windows application to created C# wrapper for native C++ DLLs and C++ bridge to access .NET assemblies, it comes with a C#/.NET library which wraps the standard C++ classes, such as string, iostream, etc., C++ classes and objects can be accessed from .NET.
358:
These references specify solutions for each of these issue if they are encountered. A primary benefit is the elimination of the structure declaration, the order of field declaration and alignment issues are not present in the context of C++ Interop.
1146:
files and produce an interface assembly automatically turns out to be quite difficult. The main problem with producing such an importer/exporter for P/Invoke signatures is the ambiguity of some C++ function call parameter types.
1255:
interop DLLs. It overcomes the ambiguity problem by wrapping native pointer function parameters in PInvoker specific .NET interface classes. Instead of using standard .NET parameter types in P/Invoke method definitions
1227:
One of the tools listed below, xInterop C++ .NET Bridge has resolved this issue by implementing multiple overrides of the same C++ method in .NET world, developers can then pick the correct one to make the call.
328:. Two different variables overlap in memory, and defining these two variables in a type in .NET would cause them to be in different locations in memory, so special attributes must be used to correct the issue. 1347:
This tool recognizes template classes which is not exported from the C++ DLL and instantiates the template class and export it in a supplement DLL and the corresponding C++ interface can be used in .NET.
1327:
The P/Invoke Wizard uses a similar method to the Microsoft Interop Assistant in that it accepts native C++ .h file code and produces C# (or VB.NET) code for you to paste into your .NET application code.
2000: 40: 1331:
It also has options for which framework you wish to target: .NET Framework for the desktop or .NET Compact Framework for Windows Mobile smart devices (and Windows CE).
295:
environment can be hard, which can result in such problems. For this purpose tools and websites exist to obtain such signatures, helping to prevent signature problems.
2321: 1236:
PInvoke.net is a wiki containing P/Invoke signatures for a large number of standard Windows APIs. It is owned by Redgate Software and has around 50000 hits per month.
312:
in the managed language: there are different ways data can be aligned depending on compilers or compiler directives in C and care must be taken to explicitly tell the
161:, an application may simultaneously use the managed heap (by way of tracking pointers) and any native memory region, without the explicit declaration. (Implicit) 1993: 2311: 171:
i.e. Adding/removing/re-ordering structures in a native header will be transparently supported so long as the structure member names did not also change.
2316: 341:
calls. Significant performance gains result from having eliminated any needless context switching, memory requirements are reduced (shorter stacks).
1505: 2351: 1986: 1696: 1530: 280: 1868: 336:, preventing it from being collected or moved by the garbage collector, which would result in an invalid access by the native module. 58: 275:
Writing P/Invoke wrappers can be difficult and error prone. Using native DLLs means that the programmer can no longer benefit from
1728: 1297: 1886: 1753: 1708: 2306: 2270: 2194: 2184: 2009: 1957: 1557: 1383: 415: 79: 1681: 164:
A primary benefit in this case being, if underlying native data structures change, so long as the naming is compatible, a
2285: 2230: 2033: 1498: 2215: 1759: 1747: 2225: 2346: 1702: 1444: 1224:
Regardless of this issue, there are a few tools available to make the production of P/Invoke signatures simpler.
2096: 2055: 2038: 1691: 325: 321: 305: 233: 283:
as is usually provided in the .NET environment. When they are used improperly this may cause problems such as
1292:
Microsoft Interop Assistant is a free tool available with binaries and source code available for download on
1876: 1613: 1602: 1525: 1491: 1458: 1413: 1251:
PInvoker is an application which imports native DLLs and C++ .h files and exports fully formed and compiled
1240: 313: 203: 183: 87: 1311:
and method definitions. It then produces C# P/Invoke code for you to copy and paste into your applications.
2129: 1848: 1843: 1807: 1564: 2290: 2169: 2081: 1713: 1594: 1374: 1362: 248: 1239:
The signatures are manually produced by users of the wiki. They can be searched using a free addin to
2275: 2134: 2028: 1664: 1569: 1143: 373: 240: 218: 211: 187: 129: 1723: 1430: 1197:
in our P/Invoke signature ? This could be either a C++ null terminated string, or could be a
2045: 2023: 1624: 1417: 1368: 284: 195: 138:
embedded in the caller's assembly defines how the native code is to be called and data accessed (
1139:
There are a number of tools which are designed to aid in the production of P/Invoke signatures.
2189: 1734: 1649: 634: 1967: 1775: 1637: 140:
usually requires attributed source specifiers to aid the compiler in generating marshal glue
2150: 1919: 1881: 1579: 1357: 317: 165: 320:. A common example of this is when trying to define a data type in .NET to represent a 2260: 2220: 2124: 2091: 2086: 2076: 2071: 1903: 1792: 1552: 1314:
A searchable database of converted Windows API constant, method and struct definitions.
333: 292: 260: 135: 2340: 1947: 1765: 1741: 1718: 1674: 1584: 1409: 819:// Compiled with /clr; use of #pragma managed/unmanaged can lead to double thunking; 2255: 1898: 1833: 1659: 1654: 1267:
For instance, if we consider the above example code, PInvoker would produce a .NET
633:
This next complex example shows how to share an Event between two processes in the
191: 91: 1978: 1307:
A converter which takes small sections of native C++ header file code containing
1893: 1815: 1669: 1608: 383: 288: 276: 244: 224:
Locates the address of the function in memory and pushes its arguments onto the
95: 2245: 2240: 2199: 1784: 225: 2235: 1924: 1797: 1686: 1142:
Writing a utility application that would import C++ header files and native
309: 256: 252: 158: 83: 1344:
of the C++ counterpart with the parameter type converted to the .NET code.
2250: 1379: 1293: 243:. It can be used when a programmer needs to have access to the extensive 1264:, etc.) it uses these interface classes in the P/Invoke function calls. 2280: 2265: 1929: 1854: 1820: 1644: 1632: 1033:// Using marshal_as. It makes sense for large or frequently used types. 372:
This first simple example shows how to get the version of a particular
291:. Getting the exact signatures of the legacy functions for use in the 2155: 1574: 237: 1838: 106:
by reference to overcome some of the obstacles in using P/Invoke.
2119: 1546: 1514: 1982: 1487: 1271:
function accepting a .NET interface class wrapping the native
348:
Code is prone to Double Thunking if not specifically addressed
264: 15: 531:
The second example shows how to extract an icon in a file:
1478: 1365:, the standard way for Java programs to access native code 296: 1153:
The problem lies with C++ functions like the following:
1275:
pointer. The construction of this class could be from a
1483: 36: 885:// Note use of de/referencing. It must match your use. 822:// avoid by using a stand-alone .cpp with .h includes. 2299: 2208: 2177: 2168: 2143: 2112: 2105: 2064: 2016: 1912: 1867: 1806: 1783: 1774: 1623: 1593: 1539: 31:
may be too technical for most readers to understand
232:P/Invoke is useful for using standard (unmanaged) 119:Two variants of P/Invoke currently in use are: 1382:, the no-longer maintained equivalent API for 1994: 1499: 8: 1404:is not to be confused with the general term 1150:Brad Abrams has this to say on the subject: 2174: 2109: 2001: 1987: 1979: 1953: 1780: 1506: 1492: 1484: 1193:What type should we use for the parameter 1412:. Marshaled parameters are copied in the 59:Learn how and when to remove this message 43:, without removing the technical details. 1394: 537:function signature in the Windows API: 1697:Extensible Application Markup Language 825:// This would be located in a .h file. 145:This definition is the "Explicit" part 41:make it understandable to non-experts 7: 1963: 1445:"Initialization of Mixed Assemblies" 247:, as many functions provided by the 2322:Visual Basic and Visual Basic .NET 1319:change this to the required type. 14: 1371:, the Java equivalent of P/Invoke 1962: 1952: 1943: 1942: 1729:Windows Communication Foundation 1416:stack after their conversion to 1298:Microsoft Limited Public License 344:This comes with new challenges: 20: 1754:Windows Presentation Foundation 1709:Managed Extensibility Framework 695:P/Invoke C# code to invoke the 580:P/Invoke C# code to invoke the 2352:Common Language Infrastructure 2010:Common Language Infrastructure 1420:types, but are not serialized. 1384:Microsoft Java Virtual Machine 228:, marshaling data as required. 190:loading and conversion of the 80:Common Language Infrastructure 1: 2051:Platform Invocation Services 2034:Common Intermediate Language 1205:parameter. So should we use 1201:array or could be an output 128:Native code is imported via 72:Platform Invocation Services 1760:Windows Workflow Foundation 1748:Windows Identity Foundation 1296:. It is licensed under the 1288:Microsoft Interop Assistant 198:types (also referred to as 2368: 1479:A site devoted to P/Invoke 382:function signature in the 267:must be written manually. 74:, commonly referred to as 1938: 1829: 1703:Language Integrated Query 1521: 182:When using P/Invoke, the 2312:C# and Visual Basic .NET 2056:Virtual Execution System 1692:Dynamic Language Runtime 1531:Libraries and frameworks 1335:xInterop C++ .NET Bridge 1155: 1027:NativeCallGetRefToMemory 970: 816: 761: 701: 645: 586: 539: 424: 388: 300:Other pitfalls include: 214:containing the function. 202:). To perform this, the 130:dynamic-linked libraries 2317:Java and .NET platforms 1614:Framework Class Library 1603:Common Language Runtime 1431:"Double Thunking (C++)" 1241:Microsoft Visual Studio 88:Common Language Runtime 2130:.NET Compact Framework 1849:Native Image Generator 1844:.NET Compiler Platform 1565:.NET Compact Framework 758:A more complex example 316:how to align data for 259:is not exposed by the 82:implementations, like 2082:Global Assembly Cache 1714:Microsoft Silverlight 1459:"The PInvoke problem" 1375:Windows library files 1363:Java Native Interface 764:// native declaration 657:LPSECURITY_ATTRIBUTES 200:parameter marshalling 2135:.NET Micro Framework 2029:Code Access Security 1570:.NET Micro Framework 1402:Parameter marshaling 643:function signature: 263:the wrapper to this 1724:Parallel Extensions 1465:. February 6, 2004. 1463:learn.microsoft.com 1066:// Direct field use 418:code to invoke the 318:non-blittable types 285:segmentation faults 2097:Standard Libraries 2046:Common Type System 2024:Application domain 1369:Java Native Access 1303:It has two parts: 353:Loader Lock issue 281:garbage collection 194:previous types to 78:, is a feature of 2334: 2333: 2330: 2329: 2164: 2163: 1976: 1975: 1863: 1862: 1735:WCF Data Services 722:lpEventAttributes 660:lpEventAttributes 249:Windows libraries 69: 68: 61: 2359: 2347:.NET terminology 2175: 2110: 2003: 1996: 1989: 1980: 1966: 1965: 1956: 1955: 1946: 1945: 1781: 1638:Entity Framework 1508: 1501: 1494: 1485: 1467: 1466: 1455: 1449: 1448: 1441: 1435: 1434: 1427: 1421: 1399: 1310: 1282: 1278: 1274: 1270: 1263: 1259: 1254: 1220: 1216: 1212: 1208: 1204: 1200: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 877: 874: 871: 868: 865: 862: 859: 856: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 813: 810: 807: 804: 801: 798: 795: 792: 789: 786: 783: 780: 777: 774: 771: 768: 765: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 635:Windows platform 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 593: 590: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 410: 407: 404: 401: 398: 395: 392: 308:of user-defined 64: 57: 53: 50: 44: 24: 23: 16: 2367: 2366: 2362: 2361: 2360: 2358: 2357: 2356: 2337: 2336: 2335: 2326: 2295: 2204: 2178:Major languages 2160: 2139: 2106:Implementations 2101: 2060: 2012: 2007: 1977: 1972: 1934: 1920:.NET Foundation 1908: 1859: 1825: 1802: 1770: 1619: 1589: 1558:Version history 1540:Implementations 1535: 1517: 1512: 1475: 1470: 1457: 1456: 1452: 1443: 1442: 1438: 1429: 1428: 1424: 1400: 1396: 1392: 1358:Blittable types 1354: 1337: 1325: 1323:P/Invoke Wizard 1308: 1290: 1280: 1276: 1272: 1268: 1261: 1257: 1252: 1249: 1234: 1218: 1214: 1210: 1206: 1202: 1198: 1191: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1137: 1132: 1131: 1129:// Return to C# 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1056: 1053: 1050: 1047: 1044: 1041: 1038: 1035: 1032: 1029: 1026: 1023: 1020: 1017: 1014: 1011: 1008: 1005: 1002: 999: 996: 993: 990: 987: 984: 981: 978: 975: 972: 969: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 755: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 693: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 631: 630: 627: 624: 621: 618: 616:lpszExeFileName 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 578: 577: 574: 571: 568: 565: 563:lpszExeFileName 562: 559: 556: 553: 550: 547: 544: 541: 529: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 412: 411: 408: 405: 402: 399: 396: 393: 390: 370: 365: 273: 251:lack available 180: 166:breaking change 154: 125: 117: 112: 90:, that enables 65: 54: 48: 45: 37:help improve it 34: 25: 21: 12: 11: 5: 2365: 2363: 2355: 2354: 2349: 2339: 2338: 2332: 2331: 2328: 2327: 2325: 2324: 2319: 2314: 2309: 2303: 2301: 2297: 2296: 2294: 2293: 2288: 2283: 2278: 2273: 2268: 2263: 2258: 2253: 2248: 2243: 2238: 2233: 2228: 2223: 2218: 2212: 2210: 2206: 2205: 2203: 2202: 2197: 2192: 2187: 2181: 2179: 2172: 2166: 2165: 2162: 2161: 2159: 2158: 2153: 2147: 2145: 2141: 2140: 2138: 2137: 2132: 2127: 2125:.NET Framework 2122: 2116: 2114: 2107: 2103: 2102: 2100: 2099: 2094: 2089: 2084: 2079: 2074: 2068: 2066: 2062: 2061: 2059: 2058: 2053: 2048: 2043: 2042: 2041: 2031: 2026: 2020: 2018: 2014: 2013: 2008: 2006: 2005: 1998: 1991: 1983: 1974: 1973: 1971: 1970: 1960: 1950: 1939: 1936: 1935: 1933: 1932: 1927: 1922: 1916: 1914: 1910: 1909: 1907: 1906: 1904:Xamarin Studio 1901: 1896: 1891: 1890: 1889: 1884: 1873: 1871: 1865: 1864: 1861: 1860: 1858: 1857: 1852: 1846: 1841: 1836: 1830: 1827: 1826: 1824: 1823: 1818: 1812: 1810: 1804: 1803: 1801: 1800: 1795: 1793:.NET Reflector 1789: 1787: 1778: 1772: 1771: 1769: 1768: 1763: 1757: 1751: 1745: 1739: 1738: 1737: 1726: 1721: 1716: 1711: 1706: 1700: 1694: 1689: 1684: 1679: 1678: 1677: 1672: 1667: 1662: 1657: 1652: 1642: 1641: 1640: 1629: 1627: 1621: 1620: 1618: 1617: 1611: 1606: 1599: 1597: 1591: 1590: 1588: 1587: 1582: 1577: 1572: 1567: 1562: 1561: 1560: 1553:.NET Framework 1550: 1543: 1541: 1537: 1536: 1534: 1533: 1528: 1522: 1519: 1518: 1513: 1511: 1510: 1503: 1496: 1488: 1482: 1481: 1474: 1473:External links 1471: 1469: 1468: 1450: 1436: 1422: 1393: 1391: 1388: 1387: 1386: 1377: 1372: 1366: 1360: 1353: 1350: 1336: 1333: 1324: 1321: 1316: 1315: 1312: 1289: 1286: 1248: 1245: 1233: 1230: 1156: 1136: 1133: 971: 817: 762: 759: 756: 702: 646: 587: 540: 520:DLLVERSIONINFO 469:dwMinorVersion 457:dwMajorVersion 433:DLLVERSIONINFO 425: 400:DLLVERSIONINFO 389: 369: 368:Basic examples 366: 364: 361: 356: 355: 349: 338: 337: 329: 306:data alignment 272: 269: 261:.NET Framework 230: 229: 222: 215: 179: 176: 175: 174: 173: 172: 162: 153: 150: 149: 148: 147: 146: 133: 124: 121: 116: 113: 111: 108: 67: 66: 28: 26: 19: 13: 10: 9: 6: 4: 3: 2: 2364: 2353: 2350: 2348: 2345: 2344: 2342: 2323: 2320: 2318: 2315: 2313: 2310: 2308: 2305: 2304: 2302: 2298: 2292: 2289: 2287: 2284: 2282: 2279: 2277: 2274: 2272: 2269: 2267: 2264: 2262: 2259: 2257: 2254: 2252: 2249: 2247: 2244: 2242: 2239: 2237: 2234: 2232: 2229: 2227: 2224: 2222: 2219: 2217: 2214: 2213: 2211: 2207: 2201: 2198: 2196: 2193: 2191: 2188: 2186: 2183: 2182: 2180: 2176: 2173: 2171: 2167: 2157: 2154: 2152: 2149: 2148: 2146: 2142: 2136: 2133: 2131: 2128: 2126: 2123: 2121: 2118: 2117: 2115: 2111: 2108: 2104: 2098: 2095: 2093: 2090: 2088: 2085: 2083: 2080: 2078: 2075: 2073: 2070: 2069: 2067: 2063: 2057: 2054: 2052: 2049: 2047: 2044: 2040: 2037: 2036: 2035: 2032: 2030: 2027: 2025: 2022: 2021: 2019: 2015: 2011: 2004: 1999: 1997: 1992: 1990: 1985: 1984: 1981: 1969: 1961: 1959: 1951: 1949: 1941: 1940: 1937: 1931: 1928: 1926: 1923: 1921: 1918: 1917: 1915: 1913:Organizations 1911: 1905: 1902: 1900: 1897: 1895: 1892: 1888: 1885: 1883: 1880: 1879: 1878: 1877:Visual Studio 1875: 1874: 1872: 1870: 1866: 1856: 1853: 1850: 1847: 1845: 1842: 1840: 1837: 1835: 1832: 1831: 1828: 1822: 1821:SmartAssembly 1819: 1817: 1814: 1813: 1811: 1809: 1805: 1799: 1796: 1794: 1791: 1790: 1788: 1786: 1782: 1779: 1777: 1773: 1767: 1766:.NET Remoting 1764: 1761: 1758: 1755: 1752: 1749: 1746: 1743: 1742:Windows Forms 1740: 1736: 1733: 1732: 1730: 1727: 1725: 1722: 1720: 1719:Microsoft XNA 1717: 1715: 1712: 1710: 1707: 1704: 1701: 1698: 1695: 1693: 1690: 1688: 1685: 1683: 1680: 1676: 1673: 1671: 1668: 1666: 1663: 1661: 1658: 1656: 1653: 1651: 1648: 1647: 1646: 1643: 1639: 1636: 1635: 1634: 1631: 1630: 1628: 1626: 1622: 1615: 1612: 1610: 1607: 1604: 1601: 1600: 1598: 1596: 1592: 1586: 1585:XNA Framework 1583: 1581: 1578: 1576: 1573: 1571: 1568: 1566: 1563: 1559: 1556: 1555: 1554: 1551: 1548: 1545: 1544: 1542: 1538: 1532: 1529: 1527: 1526:.NET strategy 1524: 1523: 1520: 1516: 1509: 1504: 1502: 1497: 1495: 1490: 1489: 1486: 1480: 1477: 1476: 1472: 1464: 1460: 1454: 1451: 1446: 1440: 1437: 1432: 1426: 1423: 1419: 1415: 1411: 1410:Serialization 1407: 1403: 1398: 1395: 1389: 1385: 1381: 1378: 1376: 1373: 1370: 1367: 1364: 1361: 1359: 1356: 1355: 1351: 1349: 1345: 1341: 1334: 1332: 1329: 1322: 1320: 1313: 1306: 1305: 1304: 1301: 1299: 1295: 1287: 1285: 1265: 1246: 1244: 1242: 1237: 1231: 1229: 1225: 1222: 1211:StringBuilder 1196: 1154: 1151: 1148: 1145: 1140: 1134: 757: 740:bInitialState 700: 698: 678:bInitialState 644: 642: 638: 636: 585: 583: 538: 536: 532: 511:DllGetVersion 481:dwBuildNumber 423: 421: 420:DllGetVersion 417: 394:DllGetVersion 387: 385: 381: 380:DllGetVersion 377: 375: 367: 362: 360: 354: 350: 347: 346: 345: 342: 335: 330: 327: 323: 319: 315: 311: 307: 303: 302: 301: 298: 297: 294: 290: 286: 282: 278: 270: 268: 266: 262: 258: 254: 250: 246: 242: 239: 235: 227: 223: 220: 216: 213: 209: 208: 207: 205: 201: 197: 193: 189: 185: 177: 170: 169: 167: 163: 160: 156: 155: 151: 144: 143: 141: 137: 134: 131: 127: 126: 122: 120: 114: 109: 107: 103: 99: 97: 93: 89: 85: 81: 77: 73: 63: 60: 52: 42: 38: 32: 29:This article 27: 18: 17: 2256:JScript .NET 2190:Visual Basic 2050: 2039:instructions 2017:Architecture 1899:SharpDevelop 1834:CLR Profiler 1665:Dynamic Data 1595:Architecture 1462: 1453: 1439: 1425: 1405: 1401: 1397: 1346: 1342: 1338: 1330: 1326: 1317: 1302: 1291: 1266: 1250: 1238: 1235: 1226: 1223: 1194: 1192: 1152: 1149: 1141: 1138: 731:bManualReset 696: 694: 669:bManualReset 640: 639: 632: 581: 579: 534: 533: 530: 493:dwPlatformID 419: 413: 379: 378: 371: 357: 352: 343: 339: 299: 289:memory leaks 274: 231: 221:into memory. 210:Locates the 199: 181: 168:is avoided. 139: 118: 110:Architecture 104: 100: 92:managed code 75: 71: 70: 55: 46: 30: 2307:C# and Java 2291:Small Basic 1894:MonoDevelop 1816:Dotfuscator 1808:Obfuscators 1785:Decompilers 1609:COM Interop 1406:marshalling 1232:PInvoke.net 713:CreateEvent 697:CreateEvent 651:CreateEvent 641:CreateEvent 598:ExtractIcon 582:ExtractIcon 545:ExtractIcon 535:ExtractIcon 384:Windows API 277:type safety 245:Windows API 96:native code 2341:Categories 2300:Comparison 2246:IronPython 2241:IronScheme 2200:PowerShell 2065:Components 1744:(WinForms) 1625:Components 1408:, meaning 1390:References 1300:(Ms-LPL). 1279:or from a 1173:MyFunction 1158:__declspec 1042:marshal_as 843:marshal_as 699:function: 625:nIconIndex 584:function: 572:nIconIndex 422:function: 304:Incorrect 255:. When a 217:Loads the 49:March 2015 2276:Phalanger 2170:Languages 2113:Microsoft 1925:Microsoft 1687:ClickOnce 1650:Web Forms 1164:dllexport 1123:mgd_pair1 1093:mgd_pair2 1069:mgd_pair2 1036:mgd_pair1 991:mgd_pair2 979:mgd_pair1 551:HINSTANCE 414:P/Invoke 257:Win32 API 192:unmanaged 157:By using 84:Microsoft 2251:IronRuby 2092:Metadata 2087:Manifest 2077:Delegate 2072:Assembly 1948:Category 1682:Avalonia 1380:J/Direct 1352:See also 1294:CodePlex 1269:P/Invoke 1253:P/Invoke 1247:PInvoker 1221: ? 1219:ref char 1048:CLR_PAIR 985:CLR_PAIR 973:CLR_PAIR 903:CLR_PAIR 888:CLR_PAIR 849:CLR_PAIR 837:CLR_PAIR 831:<> 828:template 363:Examples 271:Pitfalls 253:wrappers 186:handles 152:Implicit 136:Metadata 123:Explicit 115:Overview 94:to call 76:P/Invoke 2271:Oxygene 2266:Nemerle 2236:C++/CLI 1968:Commons 1930:Xamarin 1887:Express 1855:XAMLPad 1798:dotPeek 1645:ASP.NET 1633:ADO.NET 1105:native0 1081:native0 1060:native1 1021:native0 1015:native0 1009:native1 1000:native0 767:typedef 684:LPCTSTR 560:LPCTSTR 427:private 391:HRESULT 178:Details 159:C++/CLI 35:Please 2156:DotGNU 1851:(NGen) 1731:(WCF) 1705:(LINQ) 1699:(XAML) 1575:DotGNU 1549:(Core) 1309:struct 1277:string 1273:char * 1262:string 1207:string 1195:params 1185:params 1117:return 1012:=& 957:return 834:inline 770:struct 749:lpName 746:string 719:IntPtr 710:IntPtr 707:extern 704:static 687:lpName 648:HANDLE 613:string 604:IntPtr 595:IntPtr 592:extern 589:static 505:extern 502:static 487:public 475:public 463:public 451:public 445:cbSize 439:public 430:struct 334:pinned 132:(DLLs) 2286:Scala 2231:Cobra 2209:Other 2144:Other 1882:Blend 1839:ILAsm 1776:Tools 1756:(WPF) 1750:(WIF) 1675:Razor 1616:(FCL) 1605:(CLR) 1281:char 1215:char 1135:Tools 1096:-> 1072:-> 1051:^> 936:-> 912:-> 900:gcnew 873:& 867:const 809:PPAIR 788:DWORD 779:DWORD 773:_PAIR 607:hInst 554:hInst 542:HICON 322:union 310:types 226:stack 2216:Axum 2151:Mono 2120:.NET 1958:List 1869:IDEs 1762:(WF) 1660:Core 1655:AJAX 1580:Mono 1547:.NET 1515:.NET 1258:char 1203:char 1199:char 1179:char 1170:void 1111:val2 1099:val2 1087:Val1 1075:Val1 1045:< 997:PAIR 960:Dest 951:Val2 939:Val2 933:Dest 927:Val1 915:Val1 909:Dest 894:Dest 870:PAIR 861:> 858:PAIR 846:< 800:PAIR 791:Val2 782:Val1 737:bool 728:bool 675:BOOL 666:BOOL 622:uint 569:UINT 523:pdvi 406:pdvi 351:The 293:.NET 279:and 241:DLLs 2226:Boo 1670:MVC 1418:CTS 1414:CLR 1217:or 1144:DLL 1030:(); 945:Src 921:Src 876:Src 517:ref 508:int 490:int 478:int 466:int 454:int 442:int 374:DLL 324:in 314:CLR 287:or 265:API 238:C++ 236:or 219:DLL 212:DLL 204:CLR 196:CTS 188:DLL 184:CLR 86:'s 39:to 2343:: 2281:Q# 2261:J# 2221:A# 2195:F# 2185:C# 1461:. 1260:, 1243:. 1213:, 1209:, 1188:); 1126:); 1063:); 966:}; 752:); 690:); 637:: 628:); 575:); 526:); 416:C# 386:: 376:: 206:: 142:) 98:. 2002:e 1995:t 1988:v 1507:e 1500:t 1493:v 1447:. 1433:. 1256:( 1182:* 1176:( 1167:) 1161:( 1120:( 1114:; 1108:. 1102:= 1090:; 1084:. 1078:= 1057:* 1054:( 1039:= 1024:= 1018:; 1006:* 1003:, 994:; 988:^ 982:; 976:^ 963:; 954:; 948:. 942:= 930:; 924:. 918:= 906:; 897:= 891:^ 882:{ 879:) 864:( 855:, 852:^ 840:^ 812:; 806:* 803:, 797:} 794:; 785:; 776:{ 743:, 734:, 725:, 716:( 681:, 672:, 663:, 654:( 619:, 610:, 601:( 566:, 557:, 548:( 514:( 499:} 496:; 484:; 472:; 460:; 448:; 436:{ 409:) 403:* 397:( 326:C 234:C 62:) 56:( 51:) 47:( 33:.

Index

help improve it
make it understandable to non-experts
Learn how and when to remove this message
Common Language Infrastructure
Microsoft
Common Language Runtime
managed code
native code
dynamic-linked libraries
Metadata
C++/CLI
breaking change
CLR
DLL
unmanaged
CTS
CLR
DLL
DLL
stack
C
C++
DLLs
Windows API
Windows libraries
wrappers
Win32 API
.NET Framework
API
type safety

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.