else if(((NPPVariable)dw2 == NPPVpluginWindowBool) || ((NPPVariable)dw2 == NPPVpluginTransparentBool))
else if(((NPPVariable)dw2 == NPPVpluginWindowBool) || ((NPPVariable)dw2 == NPPVpluginTransparentBool) || ((NPPVariable)dw2 == NPPVpluginKeepLibraryInMemory))
LogItemStruct * makeLogItemStruct(NPAPI_Action action,                                   DWORD dwTimeEnter, DWORD dwTimeReturn,                                   DWORD dwRet,                                   DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4,                                   DWORD dw5, DWORD dw6, DWORD dw7, BOOL bShort){  int iWrap = pLogger->getStringDataWrap();  LogItemStruct * plis = new LogItemStruct;  if(plis == NULL)    return NULL;  plis->dwTimeEnter = dwTimeEnter;  plis->dwTimeReturn = dwTimeReturn;  plis->action = action;  plis->dwReturnValue = dwRet;  plis->arg1.dwArg = dw1;  plis->arg2.dwArg = dw2;  plis->arg3.dwArg = dw3;  plis->arg4.dwArg = dw4;  plis->arg5.dwArg = dw5;  plis->arg6.dwArg = dw6;  plis->arg7.dwArg = dw7;  char szTarget[1024] = {'\0'};  char szBuf[1024] = {'\0'};  if(bShort)    return plis;  switch (action)  {    case action_invalid:      break;    // NPN action    case action_npn_version:      plis->arg1.pData = new int[1];      *(int*)(plis->arg1.pData) = *((int*)dw1);      plis->arg1.iLength = sizeof(int);      plis->arg2.pData = new int[1];      *(int*)(plis->arg2.pData) = *((int*)dw2);      plis->arg2.iLength = sizeof(int);      plis->arg3.pData = new int[1];      *(int*)(plis->arg3.pData) = *((int*)dw3);      plis->arg3.iLength = sizeof(int);      plis->arg4.pData = new int[1];      *(int*)(plis->arg4.pData) = *((int*)dw4);      plis->arg4.iLength = sizeof(int);      break;    case action_npn_get_url_notify:      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      if(dw3 != 0L)      {        makeAbbreviatedString(szTarget, sizeof(szTarget), dw3, strlen((LPSTR)dw3), iWrap);        plis->arg3.iLength = strlen(szTarget) + 1;        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)&szTarget[0], plis->arg3.iLength);      }      break;    case action_npn_get_url:    {      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      if(dw3 != 0L)      {        makeAbbreviatedString(szTarget, sizeof(szTarget), dw3, strlen((LPSTR)dw3), iWrap);        plis->arg3.iLength = strlen(szTarget) + 1;        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)&szTarget[0], plis->arg3.iLength);      }      break;    }    case action_npn_post_url_notify:    {      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      if(dw3 != 0L)      {        makeAbbreviatedString(szTarget, sizeof(szTarget), dw3, strlen((LPSTR)dw3), iWrap);        plis->arg3.iLength = strlen(szTarget) + 1;        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)&szTarget[0], plis->arg3.iLength);      }      makeAbbreviatedString(szBuf, sizeof(szBuf), dw5, strlen((LPSTR)dw5), iWrap);      plis->arg5.iLength = (int)dw4 + 1;      plis->arg5.pData = new char[plis->arg5.iLength];      memcpy(plis->arg5.pData, (LPVOID)&szBuf[0], plis->arg5.iLength);      break;    }    case action_npn_post_url:    {      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      if(dw3 != 0L)      {        makeAbbreviatedString(szTarget, sizeof(szTarget), dw3, strlen((LPSTR)dw3), iWrap);        plis->arg3.iLength = strlen(szTarget) + 1;        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)&szTarget[0], plis->arg3.iLength);      }      makeAbbreviatedString(szBuf, sizeof(szBuf), dw5, strlen((LPSTR)dw5), iWrap);      plis->arg5.iLength = (int)dw4 + 1;      plis->arg5.pData = new char[plis->arg5.iLength];      memcpy(plis->arg5.pData, (LPVOID)&szBuf[0], plis->arg5.iLength);      break;    }    case action_npn_new_stream:    {      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      makeAbbreviatedString(szTarget, sizeof(szTarget), dw3, strlen((LPSTR)dw3), iWrap);      plis->arg3.iLength = strlen(szTarget) + 1;      plis->arg3.pData = new char[plis->arg3.iLength];      memcpy(plis->arg3.pData, (LPVOID)&szTarget[0], plis->arg3.iLength);      plis->arg4.pData = new char[sizeof(DWORD)];      plis->arg4.iLength = sizeof(DWORD);      memcpy(plis->arg4.pData, (LPVOID)dw4, plis->arg4.iLength);      break;    }    case action_npn_destroy_stream:      break;    case action_npn_request_read:      break;    case action_npn_write:    {      makeAbbreviatedString(szBuf, sizeof(szBuf), dw4, strlen((LPSTR)dw4), iWrap);      plis->arg4.iLength = strlen(szBuf) + 1;      plis->arg4.pData = new char[plis->arg4.iLength];      memcpy(plis->arg4.pData, (LPVOID)&szBuf[0], plis->arg4.iLength);      break;    }    case action_npn_status:      if(dw2 != 0L)      {        plis->arg2.iLength = strlen((LPSTR)dw2) + 1;        plis->arg2.pData = new char[plis->arg2.iLength];        memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      }      break;    case action_npn_user_agent:      break;    case action_npn_mem_alloc:      break;    case action_npn_mem_free:      break;    case action_npn_mem_flush:      break;    case action_npn_reload_plugins:      break;    case action_npn_get_java_env:      break;    case action_npn_get_java_peer:      break;    case action_npn_get_value:      plis->arg3.iLength = sizeof(DWORD);      plis->arg3.pData = new char[plis->arg3.iLength];      memcpy(plis->arg3.pData, (LPVOID)dw3, plis->arg3.iLength);      break;    case action_npn_set_value:      if(((NPPVariable)dw2 == NPPVpluginNameString) || ((NPPVariable)dw2 == NPPVpluginDescriptionString))      {        makeAbbreviatedString(szBuf, sizeof(szBuf), dw3, strlen((char *)dw3), iWrap);        plis->arg3.iLength = strlen(szBuf) + 1;        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)&szBuf[0], plis->arg3.iLength);      }      else if(((NPPVariable)dw2 == NPPVpluginWindowBool) || ((NPPVariable)dw2 == NPPVpluginTransparentBool))      {        plis->arg3.iLength = sizeof(NPBool);        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)dw3, plis->arg3.iLength);      }      else if((NPPVariable)dw2 == NPPVpluginWindowSize)      {        plis->arg3.iLength = sizeof(NPSize);        plis->arg3.pData = new char[plis->arg3.iLength];        memcpy(plis->arg3.pData, (LPVOID)dw3, plis->arg3.iLength);      }      break;    case action_npn_invalidate_rect:    {      plis->arg2.iLength = sizeof(NPRect);      plis->arg2.pData = new char[plis->arg2.iLength];      memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      break;    }    case action_npn_invalidate_region:      break;    case action_npn_force_redraw:      break;    // NPP action    case action_np_initialize:      break;    case action_np_shutdown:      break;    case action_npp_new:      plis->arg1.iLength = strlen((LPSTR)dw1) + 1;      plis->arg1.pData = new char[plis->arg1.iLength];      memcpy(plis->arg1.pData, (LPVOID)dw1, plis->arg1.iLength);      break;    case action_npp_destroy:      plis->arg2.iLength = sizeof(DWORD);      plis->arg2.pData = new char[plis->arg2.iLength];      memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      break;    case action_npp_set_window:      plis->arg2.iLength = sizeof(NPWindow);      plis->arg2.pData = new char[plis->arg2.iLength];      memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      break;    case action_npp_new_stream:      plis->arg2.iLength = strlen((LPSTR)dw2) + 1;      plis->arg2.pData = new char[plis->arg2.iLength];      memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      plis->arg5.iLength = sizeof(uint16);      plis->arg5.pData = new char[plis->arg5.iLength];      memcpy(plis->arg5.pData, (LPVOID)dw5, plis->arg5.iLength);      break;    case action_npp_destroy_stream:      break;    case action_npp_stream_as_file:      plis->arg3.iLength = strlen((LPSTR)dw3) + 1;      plis->arg3.pData = new char[plis->arg3.iLength];      memcpy(plis->arg3.pData, (LPVOID)dw3, plis->arg3.iLength);      break;    case action_npp_write_ready:      break;    case action_npp_write:    {      if(dw5 != 0L)      {        makeAbbreviatedString(szBuf, sizeof(szBuf), dw5, strlen((LPSTR)dw5), iWrap);        plis->arg5.iLength = strlen(szBuf) + 1;        plis->arg5.pData = new char[plis->arg5.iLength];        memcpy(plis->arg5.pData, (LPVOID)&szBuf[0], plis->arg5.iLength);      }      break;    }    case action_npp_print:      break;    case action_npp_handle_event:      break;    case action_npp_url_notify:      plis->arg2.iLength = strlen((LPSTR)dw2) + 1;      plis->arg2.pData = new char[plis->arg2.iLength];      memcpy(plis->arg2.pData, (LPVOID)dw2, plis->arg2.iLength);      break;    case action_npp_get_java_class:      break;    case action_np_get_mime_description:      break;    case action_npp_get_value:      break;    case action_npp_set_value:      break;    default:      break;  }  return plis;}