Module: Win32

Defined in:
documented/init.rb

Overview

Namespace for Windows API interop via Fiddle.

Provides wrappers for kernel32, user32, advapi32, and shell32 DLL calls. Only available on Windows (mingw/win platform, non-Darwin).

Defined Under Namespace

Modules: Advapi32, Kernel32, Shell32, User32

Constant Summary collapse

SIZEOF_CHAR =

Size in bytes of a char type in native code (typically 1).

Fiddle::SIZEOF_CHAR
SIZEOF_LONG =

Size in bytes of a long type in native code (typically 4 or 8).

Fiddle::SIZEOF_LONG
SEE_MASK_NOCLOSEPROCESS =

ShellExecuteEx mask flag to prevent process handle closure on return.

0x00000040
MB_OK =

MessageBox type flag: display OK button only.

0x00000000
MB_OKCANCEL =

MessageBox type flag: display OK and Cancel buttons.

0x00000001
MB_YESNO =

MessageBox type flag: display Yes and No buttons.

0x00000004
MB_ICONERROR =

MessageBox icon flag: display error icon (stop sign).

0x00000010
MB_ICONQUESTION =

MessageBox icon flag: display question mark icon.

0x00000020
MB_ICONWARNING =

MessageBox icon flag: display warning (exclamation) icon.

0x00000030
IDIOK =
1
IDICANCEL =
2
IDIYES =
6
IDINO =
7
KEY_ALL_ACCESS =

Registry key access mask: all standard access rights.

0xF003F
KEY_CREATE_SUB_KEY =

Registry key access mask: create subkey.

0x0004
KEY_ENUMERATE_SUB_KEYS =

Registry key access mask: enumerate subkeys.

0x0008
KEY_EXECUTE =

Registry key access mask: read-equivalent permissions.

0x20019
KEY_NOTIFY =

Registry key access mask: request change notifications.

0x0010
KEY_QUERY_VALUE =

Registry key access mask: query value.

0x0001
KEY_READ =

Registry key access mask: read key and values.

0x20019
KEY_SET_VALUE =

Registry key access mask: set value.

0x0002
KEY_WOW64_32KEY =

Registry key access mask: operate on 32-bit registry view on 64-bit Windows.

0x0200
KEY_WOW64_64KEY =

Registry key access mask: operate on 64-bit registry view on 64-bit Windows.

0x0100
KEY_WRITE =

Registry key access mask: write key and values.

0x20006
TokenElevation =
20
TOKEN_QUERY =
8
STILL_ACTIVE =
259
SW_SHOWNORMAL =
1
SW_SHOW =
5
PROCESS_QUERY_INFORMATION =
1024
PROCESS_VM_READ =
16
HKEY_LOCAL_MACHINE =
-2147483646
REG_NONE =
0
REG_SZ =
1
REG_EXPAND_SZ =
2
REG_BINARY =
3
REG_DWORD =
4
REG_DWORD_LITTLE_ENDIAN =
4
REG_DWORD_BIG_ENDIAN =
5
6
REG_MULTI_SZ =
7
REG_QWORD =
11
REG_QWORD_LITTLE_ENDIAN =
11

Class Method Summary collapse

Class Method Details

.admin? ⇒ Boolean

def Win32.isWin8? r = Win32.GetVersionEx return ((r == 6) and (r >= 2)) end

Returns:

  • (Boolean)


516
517
518
519
520
521
522
523
524
525
# File 'documented/init.rb', line 516

def self.admin?
  if Win32.isXP?
    return true
  else
    r = Win32.OpenProcessToken(:ProcessHandle => Win32.GetCurrentProcess, :DesiredAccess => TOKEN_QUERY)
    token_handle = r[:TokenHandle]
    r = Win32.GetTokenInformation(:TokenInformationClass => TokenElevation, :TokenHandle => token_handle)
    return (r[:TokenIsElevated] != 0)
  end
end

.CreateProcess(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Spawns a new Windows process with optional inheritance, environment, and startup configuration.

Parameters:

  • args (Hash) —

    process creation arguments

Options Hash (args):

  • :lpApplicationName (String) —

    executable path (optional)

  • :lpCommandLine (String) —

    command line (required)

  • :lpCurrentDirectory (String) —

    working directory

  • :dwCreationFlags (Integer) —

    creation flags (default: 0)

  • :bInheritHandles (Integer, true, false) —

    whether handles are inherited (default: false)

  • :lpEnvironment (Array, nil) —

    environment block

  • :dwX (Integer) —

    window X position

  • :dwY (Integer) —

    window Y position

  • :dwXSize (Integer) —

    window width

  • :dwYSize (Integer) —

    window height

  • :wShowWindow (Integer) —

    show window flag (SW_SHOW, etc.)

Returns:

  • (Hash) —

    return result with :return boolean, :hProcess, :hThread, :dwProcessId, :dwThreadId



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'documented/init.rb', line 140

def self.CreateProcess(args)
  if args[:lpCommandLine]
    lpCommandLine = args[:lpCommandLine].dup
  else
    lpCommandLine = nil
  end
  if args[:bInheritHandles] == false
    bInheritHandles = 0
  elsif args[:bInheritHandles] == true
    bInheritHandles = 1
  else
    bInheritHandles = args[:bInheritHandles].to_i
  end
  if args[:lpEnvironment].is_a?(Array)
    # fixme
  end
  lpStartupInfo = [68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  lpStartupInfo_index = { :lpDesktop => 2, :lpTitle => 3, :dwX => 4, :dwY => 5, :dwXSize => 6, :dwYSize => 7, :dwXCountChars => 8, :dwYCountChars => 9, :dwFillAttribute => 10, :dwFlags => 11, :wShowWindow => 12, :hStdInput => 15, :hStdOutput => 16, :hStdError => 17 }
  for sym in [:lpDesktop, :lpTitle]
    if args[sym]
      args[sym] = "#{args[sym]}\0" unless args[sym][-1, 1] == "\0"
      lpStartupInfo[lpStartupInfo_index[sym]] = Fiddle::Pointer.to_ptr(args[sym]).to_i
    end
  end
  for sym in [:dwX, :dwY, :dwXSize, :dwYSize, :dwXCountChars, :dwYCountChars, :dwFillAttribute, :dwFlags, :wShowWindow, :hStdInput, :hStdOutput, :hStdError]
    if args[sym]
      lpStartupInfo[lpStartupInfo_index[sym]] = args[sym]
    end
  end
  lpStartupInfo = lpStartupInfo.pack('LLLLLLLLLLLLSSLLLL')
  lpProcessInformation = [0, 0, 0, 0,].pack('LLLL')
  r = Kernel32.CreateProcess(args[:lpApplicationName], lpCommandLine, args[:lpProcessAttributes], args[:lpThreadAttributes], bInheritHandles, args[:dwCreationFlags].to_i, args[:lpEnvironment], args[:lpCurrentDirectory], lpStartupInfo, lpProcessInformation)
  lpProcessInformation = lpProcessInformation.unpack('LLLL')
  return :return => (r > 0 ? true : false), :hProcess => lpProcessInformation[0], :hThread => lpProcessInformation[1], :dwProcessId => lpProcessInformation[2], :dwThreadId => lpProcessInformation[3]
end

.GetCurrentProcess ⇒ Object

Win32.CreateProcess(:lpApplicationName => 'Launcher.exe', :lpCommandLine => 'lich2323.sal', :lpCurrentDirectory => 'C:\PROGRA~1\SIMU') def Win32.OpenProcess(args={}) return Kernel32.OpenProcess(args.to_i, args.to_i, args.to_i) end



180
181
182
# File 'documented/init.rb', line 180

def self.GetCurrentProcess
  return Kernel32.GetCurrentProcess
end

.GetExitCodeProcess(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves the exit code of a process.

Parameters:

  • args (Hash) —

    process query arguments

Options Hash (args):

  • :hProcess (Integer) —

    process handle

Returns:

  • (Hash) —

    :return status code, :lpExitCode exit code of the process (or STILL_ACTIVE if running)



190
191
192
193
194
# File 'documented/init.rb', line 190

def self.GetExitCodeProcess(args)
  lpExitCode = [0].pack('L')
  r = Kernel32.GetExitCodeProcess(args[:hProcess].to_i, lpExitCode)
  return :return => r, :lpExitCode => lpExitCode.unpack('L')[0]
end

.GetLastError ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the last Win32 error code from the calling thread.

Returns:

  • (Integer) —

    the error code



120
121
122
# File 'documented/init.rb', line 120

def self.GetLastError
  return Kernel32.GetLastError()
end

.GetModuleFileName(args = {}) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves the file path of the executable module for a process.

Parameters:

  • args (Hash) (defaults to: {}) —

    module query arguments (default: {})

Options Hash (args):

  • :hModule (Integer) —

    module handle (default: 0 for main executable)

  • :nSize (Integer) —

    buffer size in bytes (default: 256)

Returns:

  • (Hash) —

    :return character count, :lpFilename path string (null terminators removed)



203
204
205
206
207
208
# File 'documented/init.rb', line 203

def self.GetModuleFileName(args = {})
  args[:nSize] ||= 256
  buffer = "\0" * args[:nSize].to_i
  r = Kernel32.GetModuleFileName(args[:hModule].to_i, buffer, args[:nSize].to_i)
  return :return => r, :lpFilename => buffer.gsub("\0", '')
end

.GetTokenInformation(args) ⇒ Hash?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves security token information for the current process.

Parameters:

  • args (Hash) —

    token query arguments

Options Hash (args):

  • :TokenHandle (Integer) —

    process token handle

  • :TokenInformationClass (Integer) —

    type of info to retrieve (TokenElevation=20)

Returns:

  • (Hash, nil) —

    :return status code, :TokenIsElevated 1 if elevated/admin 0 otherwise; nil if class not recognized



262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'documented/init.rb', line 262

def self.GetTokenInformation(args)
  if args[:TokenInformationClass] == TokenElevation
    token_information_length = SIZEOF_LONG
    token_information = [0].pack('L')
  else
    return nil
  end
  return_length = [0].pack('L')
  r = Advapi32.GetTokenInformation(args[:TokenHandle].to_i, args[:TokenInformationClass], token_information, token_information_length, return_length)
  if args[:TokenInformationClass] == TokenElevation
    return :return => r, :TokenIsElevated => token_information.unpack('L')[0]
  end
end

.GetVersionEx ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves Windows version and system information.

Returns:

  • (Hash) —

    operating system info with :dwMajorVersion, :dwMinorVersion, :dwBuildNumber, :dwPlatformId, :szCSDVersion, service pack levels, suite mask, and product type



214
215
216
217
218
219
# File 'documented/init.rb', line 214

def self.GetVersionEx
  a = [156, 0, 0, 0, 0, ("\0" * 128), 0, 0, 0, 0, 0].pack('LLLLLa128SSSCC')
  r = Kernel32.GetVersionEx(a)
  a = a.unpack('LLLLLa128SSSCC')
  return :return => r, :dwOSVersionInfoSize => a[0], :dwMajorVersion => a[1], :dwMinorVersion => a[2], :dwBuildNumber => a[3], :dwPlatformId => a[4], :szCSDVersion => a[5].strip, :wServicePackMajor => a[6], :wServicePackMinor => a[7], :wSuiteMask => a[8], :wProductType => a[9]
end

.isXP? ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if the system is Windows XP or earlier.

Returns:

  • (Boolean) —

    true if major version < 6 (XP/Server 2003 and earlier)



508
509
510
# File 'documented/init.rb', line 508

def self.isXP?
  return (Win32.GetVersionEx[:dwMajorVersion] < 6)
end

.MessageBox(args) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Displays a modal dialog box with a message, title, buttons, and icon.

Parameters:

  • args (Hash) —

    message box arguments

Options Hash (args):

  • :hWnd (Integer) —

    parent window handle

  • :lpText (String) —

    message text

  • :lpCaption (String) —

    title bar text (default: "Lich vLICH_VERSION")

  • :uType (Integer) —

    button and icon flags (MB_OK, MB_YESNO, MB_ICONERROR, etc.)

Returns:

  • (Integer) —

    button clicked (IDIOK, IDIYES, IDICANCEL, etc.)



237
238
239
240
# File 'documented/init.rb', line 237

def self.MessageBox(args)
  args[:lpCaption] ||= "Lich v#{LICH_VERSION}"
  return User32.MessageBox(args[:hWnd].to_i, args[:lpText], args[:lpCaption], args[:uType].to_i)
end

.OpenProcessToken(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Opens the security token for a process.

Parameters:

  • args (Hash) —

    process arguments

Options Hash (args):

  • :ProcessHandle (Integer) —

    process handle from GetCurrentProcess

  • :DesiredAccess (Integer) —

    token access mask (TOKEN_QUERY, etc.)

Returns:

  • (Hash) —

    :return status code, :TokenHandle the opened token handle



283
284
285
286
287
# File 'documented/init.rb', line 283

def self.OpenProcessToken(args)
  token_handle = [0].pack('L')
  r = Advapi32.OpenProcessToken(args[:ProcessHandle].to_i, args[:DesiredAccess].to_i, token_handle)
  return :return => r, :TokenHandle => token_handle.unpack('L')[0]
end

.RegCloseKey(args) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Closes an open registry key handle.

Parameters:

  • args (Hash) —

    key close arguments

Options Hash (args):

  • :hKey (Integer) —

    registry key handle to close

Returns:

  • (Integer) —

    error status (0 = success)



398
399
400
# File 'documented/init.rb', line 398

def self.RegCloseKey(args)
  return Advapi32.RegCloseKey(args[:hKey])
end

.RegDeleteValue(args) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deletes a registry value.

Parameters:

  • args (Hash) —

    value delete arguments

Options Hash (args):

  • :hKey (Integer) —

    registry key handle

  • :lpValueName (String) —

    value name (default: nil for default value)

Returns:

  • (Integer) —

    error status (0 = success)



387
388
389
390
# File 'documented/init.rb', line 387

def self.RegDeleteValue(args)
  args[:lpValueName] ||= 0
  return Advapi32.RegDeleteValue(args[:hKey].to_i, args[:lpValueName])
end

.RegOpenKeyEx(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Opens a registry key.

Parameters:

  • args (Hash) —

    key open arguments

Options Hash (args):

  • :hKey (Integer) —

    parent key handle (e.g., HKEY_LOCAL_MACHINE)

  • :lpSubKey (String) —

    subkey path

  • :samDesired (Integer) —

    access mask (KEY_READ, KEY_WRITE, etc.)

Returns:

  • (Hash) —

    :return status code (0 = success), :phkResult opened key handle



297
298
299
300
301
# File 'documented/init.rb', line 297

def self.RegOpenKeyEx(args)
  phkResult = [0].pack('L')
  r = Advapi32.RegOpenKeyEx(args[:hKey].to_i, args[:lpSubKey].to_s, 0, args[:samDesired].to_i, phkResult)
  return :return => r, :phkResult => phkResult.unpack('L')[0]
end

.RegQueryValueEx(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves the data and type of a registry value.

Parameters:

  • args (Hash) —

    value query arguments

Options Hash (args):

  • :hKey (Integer) —

    registry key handle

  • :lpValueName (String) —

    value name (default: nil for default value)

Returns:

  • (Hash) —

    :return status code (0 = success), :lpType registry data type (REG_SZ, REG_DWORD, etc.), :lpcbData size in bytes, :lpData converted value (String, Integer, Array, or raw); omitted if status != 0



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'documented/init.rb', line 310

def self.RegQueryValueEx(args)
  args[:lpValueName] ||= 0
  lpcbData = [0].pack('L')
  r = Advapi32.RegQueryValueEx(args[:hKey].to_i, args[:lpValueName], 0, 0, 0, lpcbData)
  if r == 0
    lpcbData = lpcbData.unpack('L')[0]
    lpData = String.new.rjust(lpcbData, "\x00")
    lpcbData = [lpcbData].pack('L')
    lpType = [0].pack('L')
    r = Advapi32.RegQueryValueEx(args[:hKey].to_i, args[:lpValueName], 0, lpType, lpData, lpcbData)
    lpType = lpType.unpack('L')[0]
    lpcbData = lpcbData.unpack('L')[0]
    if [REG_EXPAND_SZ, REG_SZ, REG_LINK].include?(lpType)
      lpData.gsub!("\x00", '')
    elsif lpType == REG_MULTI_SZ
      lpData = lpData.gsub("\x00\x00", '').split("\x00")
    elsif lpType == REG_DWORD
      lpData = lpData.unpack('L')[0]
    elsif lpType == REG_QWORD
      lpData = lpData.unpack('Q')[0]
    elsif lpType == REG_BINARY
      # fixme
    elsif lpType == REG_DWORD_BIG_ENDIAN
      # fixme
    else
      # fixme
    end
    return :return => r, :lpType => lpType, :lpcbData => lpcbData, :lpData => lpData
  else
    return :return => r
  end
end

.RegSetValueEx(args) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the data of a registry value, creating or overwriting it.

Parameters:

  • args (Hash) —

    value set arguments

Options Hash (args):

  • :hKey (Integer) —

    registry key handle

  • :lpValueName (String) —

    value name (default: nil for default value)

  • :dwType (Integer) —

    registry data type (REG_SZ, REG_DWORD, REG_MULTI_SZ, REG_QWORD, etc.)

  • :lpData (String, Integer, Array) —

    value data; type determines encoding (String for SZ types, Integer for DWORD/QWORD, Array of Strings for MULTI_SZ)

Returns:

  • (Integer) —

    error status (0 = success)



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'documented/init.rb', line 352

def self.RegSetValueEx(args)
  if [REG_EXPAND_SZ, REG_SZ, REG_LINK].include?(args[:dwType]) and (args[:lpData].is_a?(String))
    lpData = args[:lpData].dup
    lpData.concat("\x00")
    cbData = lpData.length
  elsif (args[:dwType] == REG_MULTI_SZ) and (args[:lpData].is_a?(Array))
    lpData = args[:lpData].join("\x00").concat("\x00\x00")
    cbData = lpData.length
  elsif (args[:dwType] == REG_DWORD) and (args[:lpData].is_a?(Integer))
    lpData = [args[:lpData]].pack('L')
    cbData = 4
  elsif (args[:dwType] == REG_QWORD) and (args[:lpData].is_a?(Integer))
    lpData = [args[:lpData]].pack('Q')
    cbData = 8
  elsif args[:dwType] == REG_BINARY
    # fixme
    return false
  elsif args[:dwType] == REG_DWORD_BIG_ENDIAN
    # fixme
    return false
  else
    # fixme
    return false
  end
  args[:lpValueName] ||= 0
  return Advapi32.RegSetValueEx(args[:hKey].to_i, args[:lpValueName], 0, args[:dwType], lpData, cbData)
end

.ShellExecute(args) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Legacy execution wrapper; executes a file or URI with minimal configuration.

Parameters:

  • args (Hash) —

    execution arguments

Options Hash (args):

  • :hwnd (Integer) —

    parent window handle

  • :lpFile (String) —

    file path or URI

  • :lpOperation (String) —

    operation verb (default: nil / "open")

  • :lpParameters (String) —

    command-line arguments (default: nil)

  • :lpDirectory (String) —

    working directory (default: nil)

  • :nShowCmd (Integer) —

    window display flag (default: 1 / SW_HIDE)

Returns:

  • (Integer) —

    execution result (32+ = success, <32 = error code)



458
459
460
461
462
463
464
# File 'documented/init.rb', line 458

def self.ShellExecute(args)
  args[:lpOperation] ||= 0
  args[:lpParameters] ||= 0
  args[:lpDirectory] ||= 0
  args[:nShowCmd] ||= 1
  return Shell32.ShellExecute(args[:hwnd].to_i, args[:lpOperation], args[:lpFile], args[:lpParameters], args[:lpDirectory], args[:nShowCmd])
end

.ShellExecuteEx(args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Executes a file or URI with optional verb, parameters, and window display mode.

Parameters:

  • args (Hash) —

    execution arguments

Options Hash (args):

  • :lpVerb (String) —

    operation ("open", "edit", "print", etc.)

  • :lpFile (String) —

    file path or URI

  • :lpParameters (String) —

    command-line arguments

  • :lpDirectory (String) —

    working directory

  • :nShow (Integer) —

    window display flag (SW_SHOW, etc.)

  • :fMask (Integer) —

    SHELLEXECUTEINFO flags (SEE_MASK_NOCLOSEPROCESS, etc.)

  • :hkeyClass (Integer) —

    registry key for file association

  • :dwHotKey (Integer) —

    keyboard hotkey

  • :hIcon (Integer) —

    icon handle

  • :hMonitor (Integer) —

    monitor handle

  • :hProcess (Integer) —

    process handle output

Returns:

  • (Hash) —

    :return status code (32 = success), :hProcess new process handle, :hInstApp error code if return != 32



426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'documented/init.rb', line 426

def self.ShellExecuteEx(args)
  #         struct = [ (SIZEOF_LONG * 15), 0, 0, 0, 0, 0, 0, SW_SHOWNORMAL, 0, 0, 0, 0, 0, 0, 0 ]
  struct = [(SIZEOF_LONG * 15), 0, 0, 0, 0, 0, 0, SW_SHOW, 0, 0, 0, 0, 0, 0, 0]
  struct_index = { :cbSize => 0, :fMask => 1, :hwnd => 2, :lpVerb => 3, :lpFile => 4, :lpParameters => 5, :lpDirectory => 6, :nShow => 7, :hInstApp => 8, :lpIDList => 9, :lpClass => 10, :hkeyClass => 11, :dwHotKey => 12, :hIcon => 13, :hMonitor => 13, :hProcess => 14 }
  for sym in [:lpVerb, :lpFile, :lpParameters, :lpDirectory, :lpIDList, :lpClass]
    if args[sym]
      args[sym] = "#{args[sym]}\0" unless args[sym][-1, 1] == "\0"
      struct[struct_index[sym]] = Fiddle::Pointer.to_ptr(args[sym]).to_i
    end
  end
  for sym in [:fMask, :hwnd, :nShow, :hkeyClass, :dwHotKey, :hIcon, :hMonitor, :hProcess]
    if args[sym]
      struct[struct_index[sym]] = args[sym]
    end
  end
  struct = struct.pack('LLLLLLLLLLLLLLL')
  r = Shell32.ShellExecuteEx(struct)
  struct = struct.unpack('LLLLLLLLLLLLLLL')
  return :return => r, :hProcess => struct[struct_index[:hProcess]], :hInstApp => struct[struct_index[:hInstApp]]
end