Chapter 52. What Is CoInitializeSecurity?

COM provides several process-level security settings, and CoInitializeSecurity is the documented Win32 API for choosing them. Now, in many cases you won't need to call this function because other infrastructure takes care of this housekeeping for you. For example, in a COM+ application, you specify your process-wide security settings via the COM+ catalog, and the COM+ surrogate (DLLHOST.EXE) takes care of wiring up these settings. The same goes with an ASP.NET worker process. On Windows 2000, you can specify your COM security settings via machine.config (see the <processModel> section), and some plumbing in ASP.NET configures COM security on your behalf. But what about a Windows Forms app or a lowly console ...

Get The .NET Developer's Guide to Windows Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.