This file is indexed.

/usr/lib/gcc/x86_64-linux-gnu/6/include/d/std/internal/windows/advapi32.d is in libgphobos-6-dev 6.4.0-17ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Written in the D programming language.

/**
 * The only purpose of this module is to do the static construction for
 * std.windows.registry, to eliminate cyclic construction errors.
 *
 * License:   $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
 * Authors:   Kenji Hara
 * Source:    $(PHOBOSSRC std/internal/windows/_advapi32.d)
 */
module std.internal.windows.advapi32;

version(Windows):

private import core.sys.windows.windows;

version(GNU) {}
else pragma(lib, "advapi32.lib");

immutable bool isWow64;

shared static this()
{
    // WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows
    // IsWow64Process Function - Minimum supported client - Windows Vista, Windows XP with SP2
    alias fptr_t = extern(Windows) BOOL function(HANDLE, PBOOL);
    auto hKernel = GetModuleHandleA("kernel32");
    auto IsWow64Process = cast(fptr_t) GetProcAddress(hKernel, "IsWow64Process");
    BOOL bIsWow64;
    isWow64 = IsWow64Process && IsWow64Process(GetCurrentProcess(), &bIsWow64) && bIsWow64;
}

HMODULE hAdvapi32 = null;
extern (Windows)
{
    LONG function(in HKEY hkey, in LPCWSTR lpSubKey, in REGSAM samDesired, in DWORD reserved) pRegDeleteKeyExW;
}

void loadAdvapi32()
{
    if (!hAdvapi32)
    {
        hAdvapi32 = LoadLibraryA("Advapi32.dll");
        if (!hAdvapi32)
            throw new Exception(`LoadLibraryA("Advapi32.dll")`);

        pRegDeleteKeyExW = cast(typeof(pRegDeleteKeyExW)) GetProcAddress(hAdvapi32 , "RegDeleteKeyExW");
        if (!pRegDeleteKeyExW)
            throw new Exception(`GetProcAddress(hAdvapi32 , "RegDeleteKeyExW")`);
    }
}

// It will free Advapi32.dll, which may be loaded for RegDeleteKeyEx function
private void freeAdvapi32()
{
    if (hAdvapi32)
    {
        if (!FreeLibrary(hAdvapi32))
            throw new Exception(`FreeLibrary("Advapi32.dll")`);
        hAdvapi32 = null;

        pRegDeleteKeyExW = null;
    }
}

static ~this()
{
    freeAdvapi32();
}