code: def test_reflection(self):
      # Test that we can create, open, and delete keys in the 32-bit
      # area. Because we are doing this in a key which gets reflected,
      # test the differences of 32 and 64-bit keys before and after the
      # reflection occurs (ie. when the created key is closed).
      try:
          with CreateKeyEx(
              HKEY_CURRENT_USER,
              test_reflect_key_name,
              0,
              KEY_ALL_ACCESS | KEY_WOW64_32KEY,
          ) as created_key:
              self.assertNotEqual(created_key.handle, 0)
  
              # The key should now be available in the 32-bit area
              with OpenKey(
                  HKEY_CURRENT_USER,
                  test_reflect_key_name,
                  0,
                  KEY_ALL_ACCESS | KEY_WOW64_32KEY,
              ) as key:
                  self.assertNotEqual(key.handle, 0)
  
              # Write a value to what currently is only in the 32-bit area
              SetValueEx(created_key, "", 0, REG_SZ, "32KEY")
  
              # The key is not reflected until created_key is closed.
              # The 64-bit version of the key should not be available yet.
              open_fail = lambda: OpenKey(
                  HKEY_CURRENT_USER,
                  test_reflect_key_name,
                  0,
                  KEY_READ | KEY_WOW64_64KEY,
              )
              self.assertRaises(OSError, open_fail)
  
          # Now explicitly open the 64-bit version of the key
          with OpenKey(
              HKEY_CURRENT_USER,
              test_reflect_key_name,
              0,
              KEY_ALL_ACCESS | KEY_WOW64_64KEY,
          ) as key:
              self.assertNotEqual(key.handle, 0)
              # Make sure the original value we set is there
              self.assertEqual("32KEY", QueryValue(key, ""))
              # Set a new value, which will get reflected to 32-bit
              SetValueEx(key, "", 0, REG_SZ, "64KEY")
  
          # Reflection uses a "last-writer wins policy, so the value we set
          # on the 64-bit key should be the same on 32-bit
          with OpenKey(
              HKEY_CURRENT_USER,
              test_reflect_key_name,
              0,
              KEY_READ | KEY_WOW64_32KEY,
          ) as key:
              self.assertEqual("64KEY", QueryValue(key, ""))
      finally:
          DeleteKeyEx(
              HKEY_CURRENT_USER,
              test_reflect_key_name,
              KEY_WOW64_32KEY,
              0,
          )
  
imports: import gc
  import os, sys, errno
  import threading
  import unittest
  from platform import machine, win32_edition
  from test.support import cpython_only, import_helper
  from winreg import *
label_desc: Use image node_id 3 for calling the Win64WinregTests obj's underlying member method code with example usage: obj.test_reflection() without return types