translate: fixes
[ia32rtools.git] / tools / protoparse.h
index 7acd63a..b17f218 100644 (file)
@@ -33,7 +33,7 @@ struct parsed_proto {
                struct parsed_type ret_type;
                struct parsed_type type;
        };
-       struct parsed_proto_arg arg[16];
+       struct parsed_proto_arg arg[32];
        int argc;
        int argc_stack;
        int argc_reg;
@@ -216,6 +216,7 @@ static const char *known_ptr_types[] = {
        "HRSRC",
        "HKEY",
        "HMENU",
+       "HMONITOR",
        "HWAVEOUT",
        "HWND",
        "PAPPBARDATA",
@@ -238,6 +239,8 @@ static const char *known_ptr_types[] = {
        "REFCLSID",
        "REFGUID",
        "REFIID",
+       "SC_HANDLE",
+       "SERVICE_STATUS_HANDLE",
        "HOOKPROC",
        "DLGPROC",
        "TIMERPROC",
@@ -638,6 +641,12 @@ static int parse_protostr(char *protostr, struct parsed_proto *pp)
                        return -1;
                }
 
+               if (xarg >= ARRAY_SIZE(pp->arg)) {
+                       printf("%s:%d:%zd: too many args\n",
+                               hdrfn, hdrfline, (p - protostr) + 1);
+                       return -1;
+               }
+
                arg = &pp->arg[xarg];
                xarg++;