Commit 15cac722 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Use new OG API to get/restore context

parent 0cb468d7
......@@ -493,9 +493,6 @@ class sdlHandler(QObject):
# Read in the DLL the list of internal variables
for var, (sort, _) in self.proc.variables.viewitems():
typename = sort.ReferencedTypeName.replace('-', '_')
get_size = getattr(self.dll, "{}_size".format(var))
get_size.restype = ctypes.c_uint
size = get_size()
# ctypes hint: don't use c_char_p except for text strings
get_value = getattr(self.dll, "{}_value".format(var))
get_value.restype = ctypes.c_void_p
......@@ -604,8 +601,13 @@ class sdlHandler(QObject):
def direct_tc(self, name, arg_ctypes_ptr):
''' Send a TC by calling directly the function in the dll '''
# Save internal state, send tc, restore state
getattr(self.dll, "_save_context")()
getattr(self.dll, '{}_{}'.format(self.proc.processName,
new_hash = self.on_event()
getattr(self.dll, "_restore_context")()
return new_hash
def click_tc(self, name, arg_gser=None):
''' Send a TC by clicking on the Send button automatically
......@@ -683,9 +685,9 @@ class sdlHandler(QObject):
for arg_gser in compute_combinations(asn1_ty,
self.direct_tc(name, ptr)
new_hash = self.direct_tc(name, ptr)
#self.click_tc(name, arg_gser)
new_hash = self.current_hash
# new_hash = self.current_hash
yield new_hash, (name, arg_gser)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment