Remove FX_DWORD from fpdfsdk/ and testing

BUG=

Review URL: https://codereview.chromium.org/1835693002
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 3333f7a..9ca8f05 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -78,7 +78,7 @@
                              CPDFSDK_Annot* pAnnot,
                              CFX_RenderDevice* pDevice,
                              CFX_Matrix* pUser2Device,
-                             FX_DWORD dwFlags) {
+                             uint32_t dwFlags) {
   ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
 
   if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
@@ -96,7 +96,7 @@
                                      CPDFSDK_Annot* pAnnot,
                                      CFX_RenderDevice* pDevice,
                                      CFX_Matrix* pUser2Device,
-                                     FX_DWORD dwFlags) {
+                                     uint32_t dwFlags) {
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
   pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
 }
@@ -297,8 +297,8 @@
   cp.pProvider = this;
   cp.rcRectWnd = GetPDFWindowRect();
 
-  FX_DWORD dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
-  FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
+  uint32_t dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
+  uint32_t dwFieldFlag = m_pWidget->GetFieldFlags();
   if (dwFieldFlag & FIELDFLAG_READONLY) {
     dwCreateFlags |= PWS_READONLY;
   }
@@ -692,7 +692,7 @@
                          CPDFSDK_Annot* pAnnot,
                          CFX_RenderDevice* pDevice,
                          CFX_Matrix* pUser2Device,
-                         FX_DWORD dwFlags) {
+                         uint32_t dwFlags) {
   ASSERT(pPageView);
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
   CPDF_FormControl* pCtrl = pWidget->GetFormControl();
@@ -723,6 +723,6 @@
                                  CPDFSDK_Annot* pAnnot,
                                  CFX_RenderDevice* pDevice,
                                  CFX_Matrix* pUser2Device,
-                                 FX_DWORD dwFlags) {
+                                 uint32_t dwFlags) {
   OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
 }
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index b7d8a9d..9e9f4be 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -29,12 +29,12 @@
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
                       CFX_Matrix* pUser2Device,
-                      FX_DWORD dwFlags);
+                      uint32_t dwFlags);
   virtual void OnDrawDeactive(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
                               CFX_RenderDevice* pDevice,
                               CFX_Matrix* pUser2Device,
-                              FX_DWORD dwFlags);
+                              uint32_t dwFlags);
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot);
   virtual void OnLoad(CPDFSDK_Annot* pAnnot);
@@ -188,12 +188,12 @@
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
               CFX_Matrix* pUser2Device,
-              FX_DWORD dwFlags) override;
+              uint32_t dwFlags) override;
   void OnDrawDeactive(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
                       CFX_Matrix* pUser2Device,
-                      FX_DWORD dwFlags) override;
+                      uint32_t dwFlags) override;
 
  protected:
   FX_BOOL m_bMouseIn;
diff --git a/fpdfsdk/formfiller/cffl_iformfiller.cpp b/fpdfsdk/formfiller/cffl_iformfiller.cpp
index 20dd5bb..75e5751 100644
--- a/fpdfsdk/formfiller/cffl_iformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_iformfiller.cpp
@@ -57,7 +57,7 @@
                               CPDFSDK_Annot* pAnnot,
                               CFX_RenderDevice* pDevice,
                               CFX_Matrix* pUser2Device,
-                              FX_DWORD dwFlags) {
+                              uint32_t dwFlags) {
   ASSERT(pPageView);
   CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
 
@@ -500,7 +500,7 @@
 
   CPDF_Page* pPage = pWidget->GetPDFPage();
   CPDF_Document* pDocument = pPage->m_pDocument;
-  FX_DWORD dwPermissions = pDocument->GetUserPermissions();
+  uint32_t dwPermissions = pDocument->GetUserPermissions();
   return (dwPermissions & FPDFPERM_FILL_FORM) ||
          (dwPermissions & FPDFPERM_ANNOT_FORM) ||
          (dwPermissions & FPDFPERM_MODIFY);
@@ -642,7 +642,7 @@
                                          CPDFSDK_PageView* pPageView,
                                          FX_BOOL& bRC,
                                          FX_BOOL& bExit,
-                                         FX_DWORD nFlag) {
+                                         uint32_t nFlag) {
   if (!m_bNotifying) {
     if (pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
       m_bNotifying = TRUE;
@@ -674,7 +674,7 @@
                                   CPDFSDK_PageView* pPageView,
                                   FX_BOOL& bRC,
                                   FX_BOOL& bExit,
-                                  FX_DWORD nFlag) {
+                                  uint32_t nFlag) {
   if (!m_bNotifying) {
     if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) {
       m_bNotifying = TRUE;
@@ -704,7 +704,7 @@
 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
                                    CPDFSDK_PageView* pPageView,
                                    FX_BOOL& bExit,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   if (!m_bNotifying) {
     ASSERT(pWidget);
     CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
@@ -719,7 +719,7 @@
 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
                                 CPDFSDK_PageView* pPageView,
                                 FX_BOOL& bExit,
-                                FX_DWORD nFlag) {
+                                uint32_t nFlag) {
   if (!m_bNotifying) {
     ASSERT(pWidget);
     CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
@@ -816,7 +816,7 @@
 
 void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData,
                                       FX_BOOL& bExit,
-                                      FX_DWORD nFlag) {
+                                      uint32_t nFlag) {
   CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
   ASSERT(pData);
   ASSERT(pData->pWidget);
@@ -832,7 +832,7 @@
 
 void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData,
                                        FX_BOOL& bExit,
-                                       FX_DWORD nFlag) {
+                                       uint32_t nFlag) {
   CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
   ASSERT(pData);
   ASSERT(pData->pWidget);
@@ -933,7 +933,7 @@
                                          FX_BOOL bKeyDown,
                                          FX_BOOL& bRC,
                                          FX_BOOL& bExit,
-                                         FX_DWORD nFlag) {
+                                         uint32_t nFlag) {
   CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
   ASSERT(pData->pWidget);
 
diff --git a/fpdfsdk/formfiller/cffl_iformfiller.h b/fpdfsdk/formfiller/cffl_iformfiller.h
index d405b33..b011594 100644
--- a/fpdfsdk/formfiller/cffl_iformfiller.h
+++ b/fpdfsdk/formfiller/cffl_iformfiller.h
@@ -32,7 +32,7 @@
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
                       CFX_Matrix* pUser2Device,
-                      FX_DWORD dwFlags);
+                      uint32_t dwFlags);
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot);
   virtual void OnLoad(CPDFSDK_Annot* pAnnot);
@@ -96,21 +96,21 @@
                          CPDFSDK_PageView* pPageView,
                          FX_BOOL& bRC,
                          FX_BOOL& bExit,
-                         FX_DWORD nFlag);
+                         uint32_t nFlag);
   void OnValidate(CPDFSDK_Widget* pWidget,
                   CPDFSDK_PageView* pPageView,
                   FX_BOOL& bRC,
                   FX_BOOL& bExit,
-                  FX_DWORD nFlag);
+                  uint32_t nFlag);
 
   void OnCalculate(CPDFSDK_Widget* pWidget,
                    CPDFSDK_PageView* pPageView,
                    FX_BOOL& bExit,
-                   FX_DWORD nFlag);
+                   uint32_t nFlag);
   void OnFormat(CPDFSDK_Widget* pWidget,
                 CPDFSDK_PageView* pPageView,
                 FX_BOOL& bExit,
-                FX_DWORD nFlag);
+                uint32_t nFlag);
   void OnButtonUp(CPDFSDK_Widget* pWidget,
                   CPDFSDK_PageView* pPageView,
                   FX_BOOL& bReset,
@@ -156,14 +156,14 @@
                          FX_BOOL bKeyDown,
                          FX_BOOL& bRC,
                          FX_BOOL& bExit,
-                         FX_DWORD nFlag) override;
+                         uint32_t nFlag) override;
 #ifdef PDF_ENABLE_XFA
   void OnPopupPreOpen(void* pPrivateData,
                       FX_BOOL& bExit,
-                      FX_DWORD nFlag) override;
+                      uint32_t nFlag) override;
   void OnPopupPostOpen(void* pPrivateData,
                        FX_BOOL& bExit,
-                       FX_DWORD nFlag) override;
+                       uint32_t nFlag) override;
   void SetFocusAnnotTab(CPDFSDK_Annot* pWidget,
                         FX_BOOL bSameField,
                         FX_BOOL bNext);
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index 85398e3..b668b67 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -25,7 +25,7 @@
 PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() {
   PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
 
-  FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
+  uint32_t dwFieldFlag = m_pWidget->GetFieldFlags();
 
   if (dwFieldFlag & FIELDFLAG_MULTISELECT) {
     cp.dwFlags |= PLBS_MULTIPLESEL;
diff --git a/fpdfsdk/formfiller/cffl_pushbutton.cpp b/fpdfsdk/formfiller/cffl_pushbutton.cpp
index 7a32cbd..0015608 100644
--- a/fpdfsdk/formfiller/cffl_pushbutton.cpp
+++ b/fpdfsdk/formfiller/cffl_pushbutton.cpp
@@ -33,6 +33,6 @@
                              CPDFSDK_Annot* pAnnot,
                              CFX_RenderDevice* pDevice,
                              CFX_Matrix* pUser2Device,
-                             FX_DWORD dwFlags) {
+                             uint32_t dwFlags) {
   CFFL_Button::OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
 }
diff --git a/fpdfsdk/formfiller/cffl_pushbutton.h b/fpdfsdk/formfiller/cffl_pushbutton.h
index 0d9d82e..ff53ce4 100644
--- a/fpdfsdk/formfiller/cffl_pushbutton.h
+++ b/fpdfsdk/formfiller/cffl_pushbutton.h
@@ -22,7 +22,7 @@
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
               CFX_Matrix* pUser2Device,
-              FX_DWORD dwFlags) override;
+              uint32_t dwFlags) override;
 };
 
 #endif  // FPDFSDK_FORMFILLER_CFFL_PUSHBUTTON_H_
diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp
index 6cef5fd..dc6efbc 100644
--- a/fpdfsdk/fpdf_dataavail.cpp
+++ b/fpdfsdk/fpdf_dataavail.cpp
@@ -43,7 +43,7 @@
   void Set(FX_FILEAVAIL* pfileAvail) { m_pfileAvail = pfileAvail; }
 
   // IPDF_DataAvail::FileAvail:
-  FX_BOOL IsDataAvail(FX_FILESIZE offset, FX_DWORD size) override {
+  FX_BOOL IsDataAvail(FX_FILESIZE offset, uint32_t size) override {
     return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size);
   }
 
@@ -81,7 +81,7 @@
 
  public:
   // IFX_DownloadHints
-  void AddSegment(FX_FILESIZE offset, FX_DWORD size) override {
+  void AddSegment(FX_FILESIZE offset, uint32_t size) override {
     m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size);
   }
 
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index 810650f..2541bdd 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -123,7 +123,7 @@
     }
   }
 
-  FX_DWORD nCount = pElement->CountChildren();
+  uint32_t nCount = pElement->CountChildren();
   for (i = 0; i < (int)nCount; i++) {
     CXML_Element::ChildType childType = pElement->GetChildType(i);
     if (childType == CXML_Element::Element) {
@@ -135,7 +135,7 @@
   return FALSE;
 }
 
-void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code) {
+void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) {
   // Security
   if (err_code == FPDF_ERR_SECURITY) {
     FPDF_UnSupportError(FPDF_UNSP_DOC_SECURITY);
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 3ad7c6e..c2ecbc8 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -94,7 +94,7 @@
   if (!pAnnots)
     return FLATTEN_NOTHINGTODO;
 
-  FX_DWORD dwSize = pAnnots->GetCount();
+  uint32_t dwSize = pAnnots->GetCount();
   for (int i = 0; i < (int)dwSize; i++) {
     CPDF_Dictionary* pAnnotDic = ToDictionary(pAnnots->GetElementValue(i));
     if (!pAnnotDic)
@@ -213,7 +213,7 @@
     case CPDF_Object::STREAM: {
       pContentsArray = new CPDF_Array;
       CPDF_Stream* pContents = pContentsObj->AsStream();
-      FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContents);
+      uint32_t dwObjNum = pDocument->AddIndirectObject(pContents);
       CPDF_StreamAcc acc;
       acc.LoadAllData(pContents);
       CFX_ByteString sStream = "q\n";
@@ -237,7 +237,7 @@
   if (!pContentsArray)
     return;
 
-  FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray);
+  uint32_t dwObjNum = pDocument->AddIndirectObject(pContentsArray);
   pPage->SetAtReference("Contents", pDocument, dwObjNum);
 
   if (!key.IsEmpty()) {
@@ -380,7 +380,7 @@
   }
 
   CPDF_Stream* pNewXObject = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
-  FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject);
+  uint32_t dwObjNum = pDocument->AddIndirectObject(pNewXObject);
   CPDF_Dictionary* pPageXObject = pRes->GetDictBy("XObject");
   if (!pPageXObject) {
     pPageXObject = new CPDF_Dictionary;
@@ -486,7 +486,7 @@
 
     CFX_ByteString sFormName;
     sFormName.Format("F%d", i);
-    FX_DWORD dwObjNum = pDocument->AddIndirectObject(pObj);
+    uint32_t dwObjNum = pDocument->AddIndirectObject(pObj);
     pXObject->SetAtReference(sFormName, pDocument, dwObjNum);
 
     CPDF_StreamAcc acc;
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index 6394ef9..7fe4b08 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -45,10 +45,10 @@
     return NULL;
   }
 
-  FX_DWORD GetFontData(void* hFont,
-                       FX_DWORD table,
+  uint32_t GetFontData(void* hFont,
+                       uint32_t table,
                        uint8_t* buffer,
-                       FX_DWORD size) override {
+                       uint32_t size) override {
     if (m_pInfo->GetFontData)
       return m_pInfo->GetFontData(m_pInfo, hFont, table, buffer, size);
     return 0;
@@ -57,7 +57,7 @@
   FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override {
     if (!m_pInfo->GetFaceName)
       return FALSE;
-    FX_DWORD size = m_pInfo->GetFaceName(m_pInfo, hFont, NULL, 0);
+    uint32_t size = m_pInfo->GetFaceName(m_pInfo, hFont, NULL, 0);
     if (size == 0)
       return FALSE;
     char* buffer = FX_Alloc(char, size);
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index d3d6fc2..23118b4 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -285,7 +285,7 @@
 
   CFX_ByteTextBuf strClip;
   CPDF_ClipPath* pClipPath = (CPDF_ClipPath*)clipPath;
-  FX_DWORD i;
+  uint32_t i;
   for (i = 0; i < pClipPath->GetPathCount(); i++) {
     CPDF_Path path = pClipPath->GetPath(i);
     int iClipType = pClipPath->GetClipType(i);
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 2c10281..bf94aef 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -48,7 +48,7 @@
 class PDFDocTest : public testing::Test {
  public:
   struct DictObjInfo {
-    FX_DWORD num;
+    uint32_t num;
     CPDF_Dictionary* obj;
   };
 
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index efbe8f3..7484a3e 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -22,7 +22,7 @@
 
 class CPDF_PageOrganizer {
  public:
-  using ObjectNumberMap = std::map<FX_DWORD, FX_DWORD>;
+  using ObjectNumberMap = std::map<uint32_t, uint32_t>;
   CPDF_PageOrganizer();
   ~CPDF_PageOrganizer();
 
@@ -36,7 +36,7 @@
   FX_BOOL UpdateReference(CPDF_Object* pObj,
                           CPDF_Document* pDoc,
                           ObjectNumberMap* pObjNumberMap);
-  FX_DWORD GetNewObjId(CPDF_Document* pDoc,
+  uint32_t GetNewObjId(CPDF_Document* pDoc,
                        ObjectNumberMap* pObjNumberMap,
                        CPDF_Reference* pRef);
 };
@@ -74,7 +74,7 @@
       pElement ? ToDictionary(pElement->GetDirect()) : nullptr;
   if (!pNewPages) {
     pNewPages = new CPDF_Dictionary;
-    FX_DWORD NewPagesON = pDestPDFDoc->AddIndirectObject(pNewPages);
+    uint32_t NewPagesON = pDestPDFDoc->AddIndirectObject(pNewPages);
     pNewRoot->SetAt("Pages", new CPDF_Reference(pDestPDFDoc, NewPagesON));
   }
 
@@ -86,7 +86,7 @@
   CPDF_Array* pKeysArray = pNewPages->GetArrayBy("Kids");
   if (!pKeysArray) {
     CPDF_Array* pNewKids = new CPDF_Array;
-    FX_DWORD Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids);
+    uint32_t Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids);
 
     pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum));
     pNewPages->SetAt("Count", new CPDF_Number(0));
@@ -164,8 +164,8 @@
     }
 
     // Update the reference
-    FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum();
-    FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum();
+    uint32_t dwOldPageObj = pSrcPageDict->GetObjNum();
+    uint32_t dwNewPageObj = pCurPageDict->GetObjNum();
 
     (*pObjNumberMap)[dwOldPageObj] = dwNewPageObj;
 
@@ -213,7 +213,7 @@
   switch (pObj->GetType()) {
     case CPDF_Object::REFERENCE: {
       CPDF_Reference* pReference = pObj->AsReference();
-      FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference);
+      uint32_t newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference);
       if (newobjnum == 0)
         return FALSE;
       pReference->SetRef(pDoc, newobjnum);
@@ -241,8 +241,8 @@
     }
     case CPDF_Object::ARRAY: {
       CPDF_Array* pArray = pObj->AsArray();
-      FX_DWORD count = pArray->GetCount();
-      for (FX_DWORD i = 0; i < count; ++i) {
+      uint32_t count = pArray->GetCount();
+      for (uint32_t i = 0; i < count; ++i) {
         CPDF_Object* pNextObj = pArray->GetElement(i);
         if (!pNextObj)
           return FALSE;
@@ -269,14 +269,14 @@
   return TRUE;
 }
 
-FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
+uint32_t CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
                                          ObjectNumberMap* pObjNumberMap,
                                          CPDF_Reference* pRef) {
   if (!pRef)
     return 0;
 
-  FX_DWORD dwObjnum = pRef->GetRefObjNum();
-  FX_DWORD dwNewObjNum = 0;
+  uint32_t dwObjnum = pRef->GetRefObjNum();
+  uint32_t dwNewObjNum = 0;
   const auto it = pObjNumberMap->find(dwObjnum);
   if (it != pObjNumberMap->end())
     dwNewObjNum = it->second;
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index 98b9143..147f147 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -138,7 +138,7 @@
     CPDF_StreamAcc streamAcc;
     streamAcc.LoadAllData(pTemplateStream);
     uint8_t* pData = (uint8_t*)streamAcc.GetData();
-    FX_DWORD dwSize2 = streamAcc.GetSize();
+    uint32_t dwSize2 = streamAcc.GetSize();
     ScopedFileStream pTemplate(FX_CreateMemoryStream(pData, dwSize2));
     pContext->UpdateChecksum(pTemplate.get());
   }
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index c883f9a..1406939 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -153,15 +153,15 @@
 CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) {
   m_FileAccess = *pFileAccess;
 #ifdef PDF_ENABLE_XFA
-  m_BufferOffset = (FX_DWORD)-1;
+  m_BufferOffset = (uint32_t)-1;
 #endif  // PDF_ENABLE_XFA
 }
 
 #ifdef PDF_ENABLE_XFA
-FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, uint8_t& ch) {
+FX_BOOL CPDF_CustomAccess::GetByte(uint32_t pos, uint8_t& ch) {
   if (pos >= m_FileAccess.m_FileLen)
     return FALSE;
-  if (m_BufferOffset == (FX_DWORD)-1 || pos < m_BufferOffset ||
+  if (m_BufferOffset == (uint32_t)-1 || pos < m_BufferOffset ||
       pos >= m_BufferOffset + 512) {
     // Need to read from file access
     m_BufferOffset = pos;
@@ -176,9 +176,9 @@
   return TRUE;
 }
 
-FX_BOOL CPDF_CustomAccess::GetBlock(FX_DWORD pos,
+FX_BOOL CPDF_CustomAccess::GetBlock(uint32_t pos,
                                     uint8_t* pBuf,
-                                    FX_DWORD size) {
+                                    uint32_t size) {
   if (pos + size > m_FileAccess.m_FileLen)
     return FALSE;
   return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size);
@@ -202,7 +202,7 @@
 }
 
 // 0 bit: FPDF_POLICY_MACHINETIME_ACCESS
-static FX_DWORD foxit_sandbox_policy = 0xFFFFFFFF;
+static uint32_t foxit_sandbox_policy = 0xFFFFFFFF;
 
 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable) {
   switch (policy) {
@@ -282,7 +282,7 @@
 #endif  // _WIN32
 
 void ProcessParseError(CPDF_Parser::Error err) {
-  FX_DWORD err_code = FPDF_ERR_SUCCESS;
+  uint32_t err_code = FPDF_ERR_SUCCESS;
   // Translate FPDFAPI error code to FPDFVIEW error code
   switch (err) {
     case CPDF_Parser::SUCCESS:
@@ -390,7 +390,7 @@
     FX_SAFE_FILESIZE newPos =
         pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
     newPos += offset;
-    if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) {
+    if (!newPos.IsValid() || newPos.ValueOrDie() > (uint32_t)m_size) {
       return FALSE;
     }
     FXSYS_memcpy(buffer, m_pBuf + offset, size);
@@ -458,7 +458,7 @@
   return TRUE;
 }
 
-// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match
+// jabdelmalek: changed return type from uint32_t to build on Linux (and match
 // header).
 DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) {
   CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
@@ -466,11 +466,11 @@
 #ifndef PDF_ENABLE_XFA
     return 0;
 #else   // PDF_ENABLE_XFA
-    return (FX_DWORD)-1;
+    return (uint32_t)-1;
 #endif  // PDF_ENABLE_XFA
 
   CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict();
-  return pDict ? pDict->GetIntegerBy("P") : (FX_DWORD)-1;
+  return pDict ? pDict->GetIntegerBy("P") : (uint32_t)-1;
 }
 
 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) {
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
index ea3a1c9..cdc1949 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
@@ -134,7 +134,7 @@
   wsVersion = JS_STR_VIEWERVERSION_XFA;
 }
 
-void CPDFXFA_App::Beep(FX_DWORD dwType) {
+void CPDFXFA_App::Beep(uint32_t dwType) {
   CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
   if (pEnv) {
     pEnv->JS_appBeep(dwType);
@@ -143,13 +143,13 @@
 
 int32_t CPDFXFA_App::MsgBox(const CFX_WideStringC& wsMessage,
                             const CFX_WideStringC& wsTitle,
-                            FX_DWORD dwIconType,
-                            FX_DWORD dwButtonType) {
+                            uint32_t dwIconType,
+                            uint32_t dwButtonType) {
   CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
   if (!pEnv)
     return -1;
 
-  FX_DWORD iconType = 0;
+  uint32_t iconType = 0;
   int iButtonType = 0;
   switch (dwIconType) {
     case XFA_MBICON_Error:
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index cee81da..ac2e77b 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -233,7 +233,7 @@
 
 void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView,
                                       const CFX_RectF& rt,
-                                      FX_DWORD dwFlags /* = 0 */) {
+                                      uint32_t dwFlags /* = 0 */) {
   if (!m_pXFADoc || !m_pSDKDoc)
     return;
 
@@ -257,7 +257,7 @@
 }
 
 void CPDFXFA_Document::InvalidateRect(IXFA_Widget* hWidget,
-                                      FX_DWORD dwFlags /* = 0 */) {
+                                      uint32_t dwFlags /* = 0 */) {
   if (!hWidget)
     return;
 
@@ -355,7 +355,7 @@
   rcAnchor.bottom = rtAnchor.top;
 
   int t1, t2, t;
-  FX_DWORD dwPos;
+  uint32_t dwPos;
   FX_FLOAT fPoupHeight;
   switch (nRotate) {
     case 90: {
@@ -489,7 +489,7 @@
 }
 
 void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
-                                     FX_DWORD dwFlags) {
+                                     uint32_t dwFlags) {
   CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
   if (!pEnv)
     return;
@@ -526,7 +526,7 @@
 
 void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget,
                                    CXFA_WidgetAcc* pWidgetData,
-                                   FX_DWORD dwEvent,
+                                   uint32_t dwEvent,
                                    void* pParam,
                                    void* pAdditional) {
   if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget)
@@ -788,7 +788,7 @@
 void CPDFXFA_Document::Print(IXFA_Doc* hDoc,
                              int32_t nStartPage,
                              int32_t nEndPage,
-                             FX_DWORD dwOptions) {
+                             uint32_t dwOptions) {
   if (hDoc != m_pXFADoc)
     return;
 
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
index 7cabe0f..49efceb 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
@@ -14,7 +14,7 @@
 std::vector<CFWL_TimerInfo*>* CXFA_FWLAdapterTimerMgr::s_TimerArray = nullptr;
 
 FWL_ERR CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer,
-                                       FX_DWORD dwElapse,
+                                       uint32_t dwElapse,
                                        FWL_HTIMER& hTimer,
                                        FX_BOOL bImmediately) {
   if (!m_pEnv)
diff --git a/fpdfsdk/fsdk_annothandler.cpp b/fpdfsdk/fsdk_annothandler.cpp
index aef902c..f32c87c 100644
--- a/fpdfsdk/fsdk_annothandler.cpp
+++ b/fpdfsdk/fsdk_annothandler.cpp
@@ -141,7 +141,7 @@
                                            CPDFSDK_Annot* pAnnot,
                                            CFX_RenderDevice* pDevice,
                                            CFX_Matrix* pUser2Device,
-                                           FX_DWORD dwFlags) {
+                                           uint32_t dwFlags) {
   ASSERT(pAnnot);
 
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
@@ -159,7 +159,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -171,7 +171,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -183,7 +183,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -195,7 +195,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -207,7 +207,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     short zDelta,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
@@ -221,7 +221,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -233,7 +233,7 @@
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(
     CPDFSDK_PageView* pPageView,
     CPDFSDK_Annot* pAnnot,
-    FX_DWORD nFlags,
+    uint32_t nFlags,
     const CFX_FloatPoint& point) {
   ASSERT(pAnnot);
 
@@ -245,7 +245,7 @@
 
 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView,
                                                  CPDFSDK_Annot* pAnnot,
-                                                 FX_DWORD nFlag) {
+                                                 uint32_t nFlag) {
   ASSERT(pAnnot);
 
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
@@ -254,7 +254,7 @@
 
 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView,
                                                 CPDFSDK_Annot* pAnnot,
-                                                FX_DWORD nFlag) {
+                                                uint32_t nFlag) {
   ASSERT(pAnnot);
 
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
@@ -262,8 +262,8 @@
 }
 
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot,
-                                              FX_DWORD nChar,
-                                              FX_DWORD nFlags) {
+                                              uint32_t nChar,
+                                              uint32_t nFlags) {
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
     return pAnnotHandler->OnChar(pAnnot, nChar, nFlags);
   }
@@ -300,7 +300,7 @@
 }
 
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot,
-                                                  FX_DWORD nFlag) {
+                                                  uint32_t nFlag) {
   ASSERT(pAnnot);
 
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
@@ -314,7 +314,7 @@
 }
 
 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot,
-                                                   FX_DWORD nFlag) {
+                                                   uint32_t nFlag) {
   ASSERT(pAnnot);
   if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
     return pAnnotHandler->OnKillFocus(pAnnot, nFlag);
@@ -415,7 +415,7 @@
 
   CPDF_Page* pPage = pWidget->GetPDFPage();
   CPDF_Document* pDocument = pPage->m_pDocument;
-  FX_DWORD dwPermissions = pDocument->GetUserPermissions();
+  uint32_t dwPermissions = pDocument->GetUserPermissions();
   return (dwPermissions & FPDFPERM_FILL_FORM) ||
          (dwPermissions & FPDFPERM_ANNOT_FORM);
 }
@@ -463,7 +463,7 @@
                                     CPDFSDK_Annot* pAnnot,
                                     CFX_RenderDevice* pDevice,
                                     CFX_Matrix* pUser2Device,
-                                    FX_DWORD dwFlags) {
+                                    uint32_t dwFlags) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -478,7 +478,7 @@
 
 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
                                           CPDFSDK_Annot* pAnnot,
-                                          FX_DWORD nFlag) {
+                                          uint32_t nFlag) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -489,7 +489,7 @@
 }
 void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
                                          CPDFSDK_Annot* pAnnot,
-                                         FX_DWORD nFlag) {
+                                         uint32_t nFlag) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -500,7 +500,7 @@
 }
 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
                                               CPDFSDK_Annot* pAnnot,
-                                              FX_DWORD nFlags,
+                                              uint32_t nFlags,
                                               const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -515,7 +515,7 @@
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
                                             CPDFSDK_Annot* pAnnot,
-                                            FX_DWORD nFlags,
+                                            uint32_t nFlags,
                                             const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -530,7 +530,7 @@
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                                                 CPDFSDK_Annot* pAnnot,
-                                                FX_DWORD nFlags,
+                                                uint32_t nFlags,
                                                 const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -545,7 +545,7 @@
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
                                             CPDFSDK_Annot* pAnnot,
-                                            FX_DWORD nFlags,
+                                            uint32_t nFlags,
                                             const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -560,7 +560,7 @@
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
                                              CPDFSDK_Annot* pAnnot,
-                                             FX_DWORD nFlags,
+                                             uint32_t nFlags,
                                              short zDelta,
                                              const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -577,7 +577,7 @@
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
                                               CPDFSDK_Annot* pAnnot,
-                                              FX_DWORD nFlags,
+                                              uint32_t nFlags,
                                               const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -591,7 +591,7 @@
 }
 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
                                             CPDFSDK_Annot* pAnnot,
-                                            FX_DWORD nFlags,
+                                            uint32_t nFlags,
                                             const CFX_FloatPoint& point) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
@@ -605,8 +605,8 @@
 }
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
-                                       FX_DWORD nChar,
-                                       FX_DWORD nFlags) {
+                                       uint32_t nChar,
+                                       uint32_t nFlags) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -678,7 +678,7 @@
 }
 
 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
-                                           FX_DWORD nFlag) {
+                                           uint32_t nFlag) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -690,7 +690,7 @@
   return TRUE;
 }
 FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
-                                            FX_DWORD nFlag) {
+                                            uint32_t nFlag) {
   CFX_ByteString sSubType = pAnnot->GetSubType();
 
   if (sSubType == BFFT_SIGNATURE) {
@@ -751,7 +751,7 @@
                                      CPDFSDK_Annot* pAnnot,
                                      CFX_RenderDevice* pDevice,
                                      CFX_Matrix* pUser2Device,
-                                     FX_DWORD dwFlags) {
+                                     uint32_t dwFlags) {
   ASSERT(pPageView != NULL);
   ASSERT(pAnnot != NULL);
 
@@ -827,14 +827,14 @@
   if (!pWidgetHandler)
     return FALSE;
 
-  FX_DWORD dwHitTest =
+  uint32_t dwHitTest =
       pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y);
   return (dwHitTest != FWL_WGTHITTEST_Unknown);
 }
 
 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
                                            CPDFSDK_Annot* pAnnot,
-                                           FX_DWORD nFlag) {
+                                           uint32_t nFlag) {
   if (!pPageView || !pAnnot)
     return;
   IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
@@ -843,7 +843,7 @@
 
 void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
                                           CPDFSDK_Annot* pAnnot,
-                                          FX_DWORD nFlag) {
+                                          uint32_t nFlag) {
   if (!pPageView || !pAnnot)
     return;
 
@@ -853,7 +853,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
                                                CPDFSDK_Annot* pAnnot,
-                                               FX_DWORD nFlags,
+                                               uint32_t nFlags,
                                                const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -865,7 +865,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
                                              CPDFSDK_Annot* pAnnot,
-                                             FX_DWORD nFlags,
+                                             uint32_t nFlags,
                                              const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -877,7 +877,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                                                  CPDFSDK_Annot* pAnnot,
-                                                 FX_DWORD nFlags,
+                                                 uint32_t nFlags,
                                                  const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -889,7 +889,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
                                              CPDFSDK_Annot* pAnnot,
-                                             FX_DWORD nFlags,
+                                             uint32_t nFlags,
                                              const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -901,7 +901,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
                                               CPDFSDK_Annot* pAnnot,
-                                              FX_DWORD nFlags,
+                                              uint32_t nFlags,
                                               short zDelta,
                                               const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
@@ -914,7 +914,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
                                                CPDFSDK_Annot* pAnnot,
-                                               FX_DWORD nFlags,
+                                               uint32_t nFlags,
                                                const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -926,7 +926,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
                                              CPDFSDK_Annot* pAnnot,
-                                             FX_DWORD nFlags,
+                                             uint32_t nFlags,
                                              const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -938,7 +938,7 @@
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
                                                  CPDFSDK_Annot* pAnnot,
-                                                 FX_DWORD nFlags,
+                                                 uint32_t nFlags,
                                                  const CFX_FloatPoint& point) {
   if (!pPageView || !pAnnot)
     return FALSE;
@@ -949,8 +949,8 @@
 }
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
-                                        FX_DWORD nChar,
-                                        FX_DWORD nFlags) {
+                                        uint32_t nChar,
+                                        uint32_t nFlags) {
   if (!pAnnot)
     return FALSE;
 
@@ -982,12 +982,12 @@
 }
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
-                                            FX_DWORD nFlag) {
+                                            uint32_t nFlag) {
   return TRUE;
 }
 
 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
-                                             FX_DWORD nFlag) {
+                                             uint32_t nFlag) {
   return TRUE;
 }
 
@@ -1048,8 +1048,8 @@
 #define FWL_KEYFLAG_RButton (1 << 4)
 #define FWL_KEYFLAG_MButton (1 << 5)
 
-FX_DWORD CPDFSDK_XFAAnnotHandler::GetFWLFlags(FX_DWORD dwFlag) {
-  FX_DWORD dwFWLFlag = 0;
+uint32_t CPDFSDK_XFAAnnotHandler::GetFWLFlags(uint32_t dwFlag) {
+  uint32_t dwFWLFlag = 0;
 
   if (dwFlag & FWL_EVENTFLAG_ControlKey)
     dwFWLFlag |= FWL_KEYFLAG_Ctrl;
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index 3979c0f..ea4e060 100644
--- a/fpdfsdk/fsdk_baseannot.cpp
+++ b/fpdfsdk/fsdk_baseannot.cpp
@@ -622,11 +622,11 @@
   return systime;
 }
 
-void CPDFSDK_BAAnnot::SetFlags(FX_DWORD nFlags) {
+void CPDFSDK_BAAnnot::SetFlags(uint32_t nFlags) {
   m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags);
 }
 
-FX_DWORD CPDFSDK_BAAnnot::GetFlags() const {
+uint32_t CPDFSDK_BAAnnot::GetFlags() const {
   return m_pAnnot->GetAnnotDict()->GetIntegerBy("F");
 }
 
@@ -884,7 +884,7 @@
   return TRUE;
 }
 FX_BOOL CPDFSDK_BAAnnot::IsVisible() const {
-  FX_DWORD nFlags = GetFlags();
+  uint32_t nFlags = GetFlags();
   return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) ||
            (nFlags & ANNOTFLAG_NOVIEW));
 }
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index c34ea49..5dd27f8 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -1551,7 +1551,7 @@
     pEdit->SetPlateRect(rcClient);
     pEdit->SetAlignmentH(pControl->GetControlAlignment());
 
-    FX_DWORD dwFieldFlags = pField->GetFieldFlags();
+    uint32_t dwFieldFlags = pField->GetFieldFlags();
     FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
 
     if (bMultiLine) {
@@ -2371,7 +2371,7 @@
       ASSERT(pControl);
 
       if (CPDFSDK_Widget* pWidget = GetWidget(pControl)) {
-        FX_DWORD nFlags = pWidget->GetFlags();
+        uint32_t nFlags = pWidget->GetFlags();
         nFlags &= ~ANNOTFLAG_INVISIBLE;
         nFlags &= ~ANNOTFLAG_NOVIEW;
         if (bHide)
@@ -2396,7 +2396,7 @@
   CPDF_Dictionary* pActionDict = action.GetDict();
   if (pActionDict->KeyExist("Fields")) {
     CPDF_ActionFields af(&action);
-    FX_DWORD dwFlags = action.GetFlags();
+    uint32_t dwFlags = action.GetFlags();
     std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
     std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
     if (!fields.empty()) {
@@ -2452,7 +2452,7 @@
       return FALSE;
 
     CFX_ByteTextBuf fdfEncodedData;
-    for (FX_DWORD i = 0; i < pFields->GetCount(); i++) {
+    for (uint32_t i = 0; i < pFields->GetCount(); i++) {
       CPDF_Dictionary* pField = pFields->GetDictAt(i);
       if (!pField)
         continue;
@@ -2569,7 +2569,7 @@
     return m_pInterForm->ResetForm(true);
 
   CPDF_ActionFields af(&action);
-  FX_DWORD dwFlags = action.GetFlags();
+  uint32_t dwFlags = action.GetFlags();
 
   std::vector<CPDF_Object*> fieldObjects = af.GetAllFields();
   std::vector<CPDF_FormField*> fields = GetFieldFromObjects(fieldObjects);
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 91bafb1..83de4e8 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -97,16 +97,16 @@
                                         uint8_t nCharset) override;
   int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) override;
   void KillTimer(int32_t nID) override;
-  FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) override {
+  FX_BOOL IsSHIFTKeyDown(uint32_t nFlag) override {
     return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);
   }
-  FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) override {
+  FX_BOOL IsCTRLKeyDown(uint32_t nFlag) override {
     return m_pEnv->FFI_IsCTRLKeyDown(nFlag);
   }
-  FX_BOOL IsALTKeyDown(FX_DWORD nFlag) override {
+  FX_BOOL IsALTKeyDown(uint32_t nFlag) override {
     return m_pEnv->FFI_IsALTKeyDown(nFlag);
   }
-  FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) override {
+  FX_BOOL IsINSERTKeyDown(uint32_t nFlag) override {
     return m_pEnv->FFI_IsINSERTKeyDown(nFlag);
   }
   FX_SYSTEMTIME GetLocalTime() override;
diff --git a/fpdfsdk/fxedit/fxet_ap.cpp b/fpdfsdk/fxedit/fxet_ap.cpp
index 8d57e41..c17a2ca 100644
--- a/fpdfsdk/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/fxedit/fxet_ap.cpp
@@ -18,7 +18,7 @@
     if (SubWord > 0) {
       Word = SubWord;
     } else {
-      FX_DWORD dwCharCode =
+      uint32_t dwCharCode =
           pPDFFont->IsUnicodeCompatible()
               ? pPDFFont->CharCodeFromUnicode(Word)
               : pFontMap->CharCodeFromUnicode(nFontIndex, Word);
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index b568440..3d7e485 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -103,7 +103,7 @@
                                         uint16_t word,
                                         int32_t nWordStyle) {
   if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
-    FX_DWORD charcode = word;
+    uint32_t charcode = word;
 
     if (pPDFFont->IsUnicodeCompatible())
       charcode = pPDFFont->CharCodeFromUnicode(word);
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
index 9d1b1ce..f96ed3b 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_app.h
@@ -50,11 +50,11 @@
     wsFoxitName = L"Foxit";
   }
 
-  void Beep(FX_DWORD dwType) override;
+  void Beep(uint32_t dwType) override;
   int32_t MsgBox(const CFX_WideStringC& wsMessage,
                  const CFX_WideStringC& wsTitle,
-                 FX_DWORD dwIconType,
-                 FX_DWORD dwButtonType) override;
+                 uint32_t dwIconType,
+                 uint32_t dwButtonType) override;
   void Response(CFX_WideString& wsAnswer,
                 const CFX_WideStringC& wsQuestion,
                 const CFX_WideStringC& wsTitle,
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
index 5186fe5..98ed6fd 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h
@@ -49,9 +49,9 @@
   // used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
   virtual void InvalidateRect(IXFA_PageView* pPageView,
                               const CFX_RectF& rt,
-                              FX_DWORD dwFlags = 0);
+                              uint32_t dwFlags = 0);
   // used in static xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
-  virtual void InvalidateRect(IXFA_Widget* hWidget, FX_DWORD dwFlags = 0);
+  virtual void InvalidateRect(IXFA_Widget* hWidget, uint32_t dwFlags = 0);
   // show or hide caret
   virtual void DisplayCaret(IXFA_Widget* hWidget,
                             FX_BOOL bVisible,
@@ -67,11 +67,11 @@
                             const CFX_RectF* pRectExclude = NULL);
 
   // dwFlags XFA_PAGEVIEWEVENT_Added, XFA_PAGEVIEWEVENT_Removing
-  virtual void PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags);
+  virtual void PageViewEvent(IXFA_PageView* pPageView, uint32_t dwFlags);
   // dwEvent refer to XFA_WIDGETEVENT_XXX
   virtual void WidgetEvent(IXFA_Widget* hWidget,
                            CXFA_WidgetAcc* pWidgetData,
-                           FX_DWORD dwEvent,
+                           uint32_t dwEvent,
                            void* pParam = NULL,
                            void* pAdditional = NULL);
 
@@ -104,7 +104,7 @@
   virtual void Print(IXFA_Doc* hDoc,
                      int32_t nStartPage,
                      int32_t nEndPage,
-                     FX_DWORD dwOptions);
+                     uint32_t dwOptions);
 
   // LayoutPseudo method
   virtual int32_t AbsPageCountInBatch(IXFA_Doc* hDoc) { return 0; }
diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
index f4c73c6..e0c508b 100644
--- a/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
+++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_util.h
@@ -23,7 +23,7 @@
  public:
   CXFA_FWLAdapterTimerMgr(CPDFDoc_Environment* pEnv) : m_pEnv(pEnv) {}
   virtual FWL_ERR Start(IFWL_Timer* pTimer,
-                        FX_DWORD dwElapse,
+                        uint32_t dwElapse,
                         FWL_HTIMER& hTimer,
                         FX_BOOL bImmediately = TRUE);
   virtual FWL_ERR Stop(FWL_HTIMER hTimer);
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index f94d7d0..637fdfc 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -61,14 +61,14 @@
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
                       CFX_Matrix* pUser2Device,
-                      FX_DWORD dwFlags) = 0;
+                      uint32_t dwFlags) = 0;
 
   virtual void OnDrawSleep(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
                            CFX_RenderDevice* pDevice,
                            CFX_Matrix* pUser2Device,
                            const CFX_FloatRect& rcWindow,
-                           FX_DWORD dwFlags) = 0;
+                           uint32_t dwFlags) = 0;
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0;
 
@@ -80,56 +80,56 @@
 
   virtual void OnMouseEnter(CPDFSDK_PageView* pPageView,
                             CPDFSDK_Annot* pAnnot,
-                            FX_DWORD nFlag) = 0;
+                            uint32_t nFlag) = 0;
   virtual void OnMouseExit(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
-                           FX_DWORD nFlag) = 0;
+                           uint32_t nFlag) = 0;
 
   virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
                                 CPDFSDK_Annot* pAnnot,
-                                FX_DWORD nFlags,
+                                uint32_t nFlags,
                                 const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                                   CPDFSDK_Annot* pAnnot,
-                                  FX_DWORD nFlags,
+                                  uint32_t nFlags,
                                   const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView,
                                CPDFSDK_Annot* pAnnot,
-                               FX_DWORD nFlags,
+                               uint32_t nFlags,
                                short zDelta,
                                const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView,
                                 CPDFSDK_Annot* pAnnot,
-                                FX_DWORD nFlags,
+                                uint32_t nFlags,
                                 const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point) = 0;
   virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView,
                                   CPDFSDK_Annot* pAnnot,
-                                  FX_DWORD nFlags,
+                                  uint32_t nFlags,
                                   const CFX_FloatPoint& point) = 0;
   // by wjm.
   virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
-                         FX_DWORD nChar,
-                         FX_DWORD nFlags) = 0;
+                         uint32_t nChar,
+                         uint32_t nFlags) = 0;
   virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
   virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
 
   virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0;
   virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0;
 
-  virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
-  virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+  virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) = 0;
+  virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) = 0;
 #ifdef PDF_ENABLE_XFA
   virtual FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
                                     CPDFSDK_Annot* pNewAnnot) = 0;
@@ -162,67 +162,67 @@
               CPDFSDK_Annot* pAnnot,
               CFX_RenderDevice* pDevice,
               CFX_Matrix* pUser2Device,
-              FX_DWORD dwFlags) override;
+              uint32_t dwFlags) override;
   void OnDrawSleep(CPDFSDK_PageView* pPageView,
                    CPDFSDK_Annot* pAnnot,
                    CFX_RenderDevice* pDevice,
                    CFX_Matrix* pUser2Device,
                    const CFX_FloatRect& rcWindow,
-                   FX_DWORD dwFlags) override {}
+                   uint32_t dwFlags) override {}
   void OnCreate(CPDFSDK_Annot* pAnnot) override;
   void OnLoad(CPDFSDK_Annot* pAnnot) override;
   void OnDelete(CPDFSDK_Annot* pAnnot) override {}
   void OnRelease(CPDFSDK_Annot* pAnnot) override {}
   void OnMouseEnter(CPDFSDK_PageView* pPageView,
                     CPDFSDK_Annot* pAnnot,
-                    FX_DWORD nFlag) override;
+                    uint32_t nFlag) override;
   void OnMouseExit(CPDFSDK_PageView* pPageView,
                    CPDFSDK_Annot* pAnnot,
-                   FX_DWORD nFlag) override;
+                   uint32_t nFlag) override;
   FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
                         CPDFSDK_Annot* pAnnot,
-                        FX_DWORD nFlags,
+                        uint32_t nFlags,
                         const CFX_FloatPoint& point) override;
   FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
-                      FX_DWORD nFlags,
+                      uint32_t nFlags,
                       const CFX_FloatPoint& point) override;
   FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                           CPDFSDK_Annot* pAnnot,
-                          FX_DWORD nFlags,
+                          uint32_t nFlags,
                           const CFX_FloatPoint& point) override;
   FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
-                      FX_DWORD nFlags,
+                      uint32_t nFlags,
                       const CFX_FloatPoint& point) override;
   FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView,
                        CPDFSDK_Annot* pAnnot,
-                       FX_DWORD nFlags,
+                       uint32_t nFlags,
                        short zDelta,
                        const CFX_FloatPoint& point) override;
   FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView,
                         CPDFSDK_Annot* pAnnot,
-                        FX_DWORD nFlags,
+                        uint32_t nFlags,
                         const CFX_FloatPoint& point) override;
   FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView,
                       CPDFSDK_Annot* pAnnot,
-                      FX_DWORD nFlags,
+                      uint32_t nFlags,
                       const CFX_FloatPoint& point) override;
   FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView,
                           CPDFSDK_Annot* pAnnot,
-                          FX_DWORD nFlags,
+                          uint32_t nFlags,
                           const CFX_FloatPoint& point) override {
     return FALSE;
   }
   FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
-                 FX_DWORD nChar,
-                 FX_DWORD nFlags) override;
+                 uint32_t nChar,
+                 uint32_t nFlags) override;
   FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override;
   FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) override;
   void OnDeSelected(CPDFSDK_Annot* pAnnot) override {}
   void OnSelected(CPDFSDK_Annot* pAnnot) override {}
-  FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) override;
-  FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) override;
+  FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override;
+  FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag) override;
 #ifdef PDF_ENABLE_XFA
   FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
                             CPDFSDK_Annot* pNewAnnot) override {
@@ -272,14 +272,14 @@
                       CPDFSDK_Annot* pAnnot,
                       CFX_RenderDevice* pDevice,
                       CFX_Matrix* pUser2Device,
-                      FX_DWORD dwFlags);
+                      uint32_t dwFlags);
 
   virtual void OnDrawSleep(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
                            CFX_RenderDevice* pDevice,
                            CFX_Matrix* pUser2Device,
                            const CFX_FloatRect& rcWindow,
-                           FX_DWORD dwFlags) {}
+                           uint32_t dwFlags) {}
 
   virtual void OnCreate(CPDFSDK_Annot* pAnnot) {}
 
@@ -291,62 +291,62 @@
 
   virtual void OnMouseEnter(CPDFSDK_PageView* pPageView,
                             CPDFSDK_Annot* pAnnot,
-                            FX_DWORD nFlag);
+                            uint32_t nFlag);
   virtual void OnMouseExit(CPDFSDK_PageView* pPageView,
                            CPDFSDK_Annot* pAnnot,
-                           FX_DWORD nFlag);
+                           uint32_t nFlag);
 
   virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView,
                                 CPDFSDK_Annot* pAnnot,
-                                FX_DWORD nFlags,
+                                uint32_t nFlags,
                                 const CFX_FloatPoint& point);
   virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point);
   virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                                   CPDFSDK_Annot* pAnnot,
-                                  FX_DWORD nFlags,
+                                  uint32_t nFlags,
                                   const CFX_FloatPoint& point);
   virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point);
   virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView,
                                CPDFSDK_Annot* pAnnot,
-                               FX_DWORD nFlags,
+                               uint32_t nFlags,
                                short zDelta,
                                const CFX_FloatPoint& point);
   virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView,
                                 CPDFSDK_Annot* pAnnot,
-                                FX_DWORD nFlags,
+                                uint32_t nFlags,
                                 const CFX_FloatPoint& point);
   virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView,
                               CPDFSDK_Annot* pAnnot,
-                              FX_DWORD nFlags,
+                              uint32_t nFlags,
                               const CFX_FloatPoint& point);
   virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView* pPageView,
                                   CPDFSDK_Annot* pAnnot,
-                                  FX_DWORD nFlags,
+                                  uint32_t nFlags,
                                   const CFX_FloatPoint& point);
   // by wjm.
   virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot,
-                         FX_DWORD nChar,
-                         FX_DWORD nFlags);
+                         uint32_t nChar,
+                         uint32_t nFlags);
   virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
   virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
 
   virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) {}
   virtual void OnSelected(CPDFSDK_Annot* pAnnot) {}
 
-  virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
-  virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+  virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
+  virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
   virtual FX_BOOL OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
                                     CPDFSDK_Annot* pNewAnnot);
 
  private:
   IXFA_WidgetHandler* GetXFAWidgetHandler(CPDFSDK_Annot* pAnnot);
-  FX_DWORD GetFWLFlags(FX_DWORD dwFlag);
+  uint32_t GetFWLFlags(uint32_t dwFlag);
 
  private:
   CPDFDoc_Environment* m_pApp;
@@ -381,56 +381,56 @@
                             CPDFSDK_Annot* pAnnot,
                             CFX_RenderDevice* pDevice,
                             CFX_Matrix* pUser2Device,
-                            FX_DWORD dwFlags);
+                            uint32_t dwFlags);
 
   virtual void Annot_OnMouseEnter(CPDFSDK_PageView* pPageView,
                                   CPDFSDK_Annot* pAnnot,
-                                  FX_DWORD nFlags);
+                                  uint32_t nFlags);
   virtual void Annot_OnMouseExit(CPDFSDK_PageView* pPageView,
                                  CPDFSDK_Annot* pAnnot,
-                                 FX_DWORD nFlags);
+                                 uint32_t nFlags);
 
   virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView* pPageView,
                                       CPDFSDK_Annot* pAnnot,
-                                      FX_DWORD nFlags,
+                                      uint32_t nFlags,
                                       const CFX_FloatPoint& point);
   virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView* pPageView,
                                     CPDFSDK_Annot* pAnnot,
-                                    FX_DWORD nFlags,
+                                    uint32_t nFlags,
                                     const CFX_FloatPoint& point);
   virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView* pPageView,
                                         CPDFSDK_Annot* pAnnot,
-                                        FX_DWORD nFlags,
+                                        uint32_t nFlags,
                                         const CFX_FloatPoint& point);
 
   virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView* pPageView,
                                     CPDFSDK_Annot* pAnnot,
-                                    FX_DWORD nFlags,
+                                    uint32_t nFlags,
                                     const CFX_FloatPoint& point);
   virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView* pPageView,
                                      CPDFSDK_Annot* pAnnot,
-                                     FX_DWORD nFlags,
+                                     uint32_t nFlags,
                                      short zDelta,
                                      const CFX_FloatPoint& point);
   virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView* pPageView,
                                       CPDFSDK_Annot* pAnnot,
-                                      FX_DWORD nFlags,
+                                      uint32_t nFlags,
                                       const CFX_FloatPoint& point);
   virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView* pPageView,
                                     CPDFSDK_Annot* pAnnot,
-                                    FX_DWORD nFlags,
+                                    uint32_t nFlags,
                                     const CFX_FloatPoint& point);
 
   virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot,
-                               FX_DWORD nChar,
-                               FX_DWORD nFlags);
+                               uint32_t nChar,
+                               uint32_t nFlags);
   virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
                                   int nKeyCode,
                                   int nFlag);
   virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
 
-  virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
-  virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+  virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
+  virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
 
 #ifdef PDF_ENABLE_XFA
   virtual FX_BOOL Annot_OnChangeFocus(CPDFSDK_Annot* pSetAnnot,
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index 2024c2c..dc2c1a9 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -148,8 +148,8 @@
   void SetModifiedDate(const FX_SYSTEMTIME& st);
   FX_SYSTEMTIME GetModifiedDate() const;
 
-  void SetFlags(FX_DWORD nFlags);
-  FX_DWORD GetFlags() const;
+  void SetFlags(uint32_t nFlags);
+  uint32_t GetFlags() const;
 
   void SetAppState(const CFX_ByteString& str);
   CFX_ByteString GetAppState() const;
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 4af327f..706880a 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -25,13 +25,13 @@
 
 // Convert a #FX_ARGB to a #FX_COLORREF.
 #define FX_ARGBTOCOLORREF(argb)                                            \
-  ((((FX_DWORD)argb & 0x00FF0000) >> 16) | ((FX_DWORD)argb & 0x0000FF00) | \
-   (((FX_DWORD)argb & 0x000000FF) << 16))
+  ((((uint32_t)argb & 0x00FF0000) >> 16) | ((uint32_t)argb & 0x0000FF00) | \
+   (((uint32_t)argb & 0x000000FF) << 16))
 
 // Convert a #FX_COLORREF to a #FX_ARGB.
 #define FX_COLORREFTOARGB(rgb)                                   \
-  ((FX_DWORD)0xFF000000 | (((FX_DWORD)rgb & 0x000000FF) << 16) | \
-   ((FX_DWORD)rgb & 0x0000FF00) | (((FX_DWORD)rgb & 0x00FF0000) >> 16))
+  ((uint32_t)0xFF000000 | (((uint32_t)rgb & 0x000000FF) << 16) | \
+   ((uint32_t)rgb & 0x0000FF00) | (((uint32_t)rgb & 0x00FF0000) >> 16))
 
 typedef unsigned int FX_UINT;
 class CRenderContext;
@@ -49,15 +49,15 @@
 
 #ifdef PDF_ENABLE_XFA
   virtual CFX_ByteString GetFullPath() { return ""; }
-  virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch);
-  virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size);
+  virtual FX_BOOL GetByte(uint32_t pos, uint8_t& ch);
+  virtual FX_BOOL GetBlock(uint32_t pos, uint8_t* pBuf, uint32_t size);
 #endif  // PDF_ENABLE_XFA
 
  private:
   FPDF_FILEACCESS m_FileAccess;
 #ifdef PDF_ENABLE_XFA
   uint8_t m_Buffer[512];
-  FX_DWORD m_BufferOffset;
+  uint32_t m_BufferOffset;
 #endif  // PDF_ENABLE_XFA
 };
 
@@ -124,7 +124,7 @@
                             FX_BOOL bNeedToRestore,
                             IFSDK_PAUSE_Adapter* pause);
 
-void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code);
+void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code);
 void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot);
 void ProcessParseError(CPDF_Parser::Error err);
 
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 1734075..3b8c951 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -103,19 +103,19 @@
       m_pInfo->FFI_OnChange(m_pInfo);
   }
 
-  FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag) const {
+  FX_BOOL FFI_IsSHIFTKeyDown(uint32_t nFlag) const {
     return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
   }
 
-  FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const {
+  FX_BOOL FFI_IsCTRLKeyDown(uint32_t nFlag) const {
     return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
   }
 
-  FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const {
+  FX_BOOL FFI_IsALTKeyDown(uint32_t nFlag) const {
     return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
   }
 
-  FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const { return FALSE; }
+  FX_BOOL FFI_IsINSERTKeyDown(uint32_t nFlag) const { return FALSE; }
 
   FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) {
     if (m_pInfo && m_pInfo->FFI_GetPage)
@@ -398,7 +398,7 @@
     return L"";
   }
 
-  void FFI_PageEvent(int iPageCount, FX_DWORD dwEventType) const {
+  void FFI_PageEvent(int iPageCount, uint32_t dwEventType) const {
     if (m_pInfo && m_pInfo->FFI_PageEvent)
       m_pInfo->FFI_PageEvent(m_pInfo, iPageCount, dwEventType);
   }
diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h
index 6619f3e..dc225df 100644
--- a/fpdfsdk/include/fx_systemhandler.h
+++ b/fpdfsdk/include/fx_systemhandler.h
@@ -92,10 +92,10 @@
   virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0;
   virtual void KillTimer(int32_t nID) = 0;
 
-  virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
-  virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0;
-  virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0;
-  virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0;
+  virtual FX_BOOL IsSHIFTKeyDown(uint32_t nFlag) = 0;
+  virtual FX_BOOL IsCTRLKeyDown(uint32_t nFlag) = 0;
+  virtual FX_BOOL IsALTKeyDown(uint32_t nFlag) = 0;
+  virtual FX_BOOL IsINSERTKeyDown(uint32_t nFlag) = 0;
 
   virtual FX_SYSTEMTIME GetLocalTime() = 0;
 
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 9b3df61..0b793db 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1460,7 +1460,7 @@
   FX_BOOL bIsLatin = FALSE;
 
   for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
-    FX_DWORD charcode = static_cast<FX_DWORD>(-1);
+    uint32_t charcode = static_cast<uint32_t>(-1);
     FX_FLOAT kerning;
 
     pTextObj->GetCharInfo(i, charcode, kerning);
@@ -1493,7 +1493,7 @@
   FX_BOOL bIsLatin = FALSE;
 
   for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
-    FX_DWORD charcode = static_cast<FX_DWORD>(-1);
+    uint32_t charcode = static_cast<uint32_t>(-1);
     FX_FLOAT kerning;
 
     pTextObj->GetCharInfo(i, charcode, kerning);
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 814d2e8..4ac7081 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -947,7 +947,7 @@
     if (!m_bCanSet)
       return FALSE;
 
-    CFX_ArrayTemplate<FX_DWORD> array;
+    CFX_ArrayTemplate<uint32_t> array;
 
     if (vp.GetType() == CJS_Value::VT_number) {
       int iSelecting = 0;
@@ -1002,7 +1002,7 @@
 void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument,
                                    const CFX_WideString& swFieldName,
                                    int nControlIndex,
-                                   const CFX_ArrayTemplate<FX_DWORD>& array) {
+                                   const CFX_ArrayTemplate<uint32_t>& array) {
   ASSERT(pDocument);
 
   std::vector<CPDF_FormField*> FieldArray =
@@ -1010,7 +1010,7 @@
   for (CPDF_FormField* pFormField : FieldArray) {
     int nFieldType = pFormField->GetFieldType();
     if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX) {
-      FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
+      uint32_t dwFieldFlags = pFormField->GetFieldFlags();
       pFormField->ClearSelection(TRUE);
 
       for (int i = 0, sz = array.GetSize(); i < sz; i++) {
@@ -1209,7 +1209,7 @@
     if (!pWidget)
       return FALSE;
 
-    FX_DWORD dwFlag = pWidget->GetFlags();
+    uint32_t dwFlag = pWidget->GetFlags();
 
     if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) {
       vp << (int32_t)1;
@@ -1244,7 +1244,7 @@
         ASSERT(pFormControl);
 
         if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
-          FX_DWORD dwFlag = pWidget->GetFlags();
+          uint32_t dwFlag = pWidget->GetFlags();
           switch (number) {
             case 0:
               dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1285,7 +1285,7 @@
       if (CPDF_FormControl* pFormControl =
               pFormField->GetControl(nControlIndex)) {
         if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
-          FX_DWORD dwFlag = pWidget->GetFlags();
+          uint32_t dwFlag = pWidget->GetFlags();
           switch (number) {
             case 0:
               dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1525,7 +1525,7 @@
     if (!pWidget)
       return FALSE;
 
-    FX_DWORD dwFlags = pWidget->GetFlags();
+    uint32_t dwFlags = pWidget->GetFlags();
 
     if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
       vp << true;
@@ -1549,7 +1549,7 @@
       for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
         if (CPDFSDK_Widget* pWidget =
                 pInterForm->GetWidget(pFormField->GetControl(i))) {
-          FX_DWORD dwFlags = pWidget->GetFlags();
+          uint32_t dwFlags = pWidget->GetFlags();
 
           if (b) {
             dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1577,7 +1577,7 @@
       if (CPDF_FormControl* pFormControl =
               pFormField->GetControl(nControlIndex)) {
         if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
-          FX_DWORD dwFlags = pWidget->GetFlags();
+          uint32_t dwFlags = pWidget->GetFlags();
 
           if (b) {
             dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1964,7 +1964,7 @@
         for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
           if (CPDFSDK_Widget* pWidget =
                   pInterForm->GetWidget(pFormField->GetControl(i))) {
-            FX_DWORD dwFlags = pWidget->GetFlags();
+            uint32_t dwFlags = pWidget->GetFlags();
             if (bVP)
               dwFlags |= ANNOTFLAG_PRINT;
             else
@@ -1985,7 +1985,7 @@
         if (CPDF_FormControl* pFormControl =
                 pFormField->GetControl(m_nFormControlIndex)) {
           if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
-            FX_DWORD dwFlags = pWidget->GetFlags();
+            uint32_t dwFlags = pWidget->GetFlags();
             if (bVP)
               dwFlags |= ANNOTFLAG_PRINT;
             else
@@ -3428,7 +3428,7 @@
 }
 
 void Field::AddDelay_WordArray(enum FIELD_PROP prop,
-                               const CFX_ArrayTemplate<FX_DWORD>& array) {
+                               const CFX_ArrayTemplate<uint32_t>& array) {
   CJS_DelayData* pNewData = new CJS_DelayData;
   pNewData->sFieldName = m_FieldName;
   pNewData->nControlIndex = m_nFormControlIndex;
diff --git a/fpdfsdk/javascript/Field.h b/fpdfsdk/javascript/Field.h
index c304563..5f5be10 100644
--- a/fpdfsdk/javascript/Field.h
+++ b/fpdfsdk/javascript/Field.h
@@ -84,7 +84,7 @@
   CFX_WideString widestring;
   CFX_FloatRect rect;
   CPWL_Color color;
-  CFX_ArrayTemplate<FX_DWORD> wordarray;
+  CFX_ArrayTemplate<uint32_t> wordarray;
   CJS_WideStringArray widestringarray;
 };
 
@@ -344,7 +344,7 @@
   static void SetCurrentValueIndices(CPDFSDK_Document* pDocument,
                                      const CFX_WideString& swFieldName,
                                      int nControlIndex,
-                                     const CFX_ArrayTemplate<FX_DWORD>& array);
+                                     const CFX_ArrayTemplate<uint32_t>& array);
   static void SetDefaultStyle(CPDFSDK_Document* pDocument,
                               const CFX_WideString& swFieldName,
                               int nControlIndex);
@@ -477,7 +477,7 @@
   void AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect);
   void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color);
   void AddDelay_WordArray(enum FIELD_PROP prop,
-                          const CFX_ArrayTemplate<FX_DWORD>& array);
+                          const CFX_ArrayTemplate<uint32_t>& array);
   void AddDelay_WideStringArray(enum FIELD_PROP prop,
                                 const CJS_WideStringArray& array);
 
diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp
index 3376ccd..2c2ec1d 100644
--- a/fpdfsdk/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/javascript/JS_GlobalData.cpp
@@ -328,19 +328,19 @@
 
       ASSERT(wVersion <= 2);
 
-      FX_DWORD dwCount = *((FX_DWORD*)p);
-      p += sizeof(FX_DWORD);
+      uint32_t dwCount = *((uint32_t*)p);
+      p += sizeof(uint32_t);
 
-      FX_DWORD dwSize = *((FX_DWORD*)p);
-      p += sizeof(FX_DWORD);
+      uint32_t dwSize = *((uint32_t*)p);
+      p += sizeof(uint32_t);
 
-      if (dwSize == nLength - sizeof(uint16_t) * 2 - sizeof(FX_DWORD) * 2) {
+      if (dwSize == nLength - sizeof(uint16_t) * 2 - sizeof(uint32_t) * 2) {
         for (int32_t i = 0, sz = dwCount; i < sz; i++) {
           if (p > pBuffer + nLength)
             break;
 
-          FX_DWORD dwNameLen = *((FX_DWORD*)p);
-          p += sizeof(FX_DWORD);
+          uint32_t dwNameLen = *((uint32_t*)p);
+          p += sizeof(uint32_t);
 
           if (p + dwNameLen > pBuffer + nLength)
             break;
@@ -356,8 +356,8 @@
               double dData = 0;
               switch (wVersion) {
                 case 1: {
-                  FX_DWORD dwData = *((FX_DWORD*)p);
-                  p += sizeof(FX_DWORD);
+                  uint32_t dwData = *((uint32_t*)p);
+                  p += sizeof(uint32_t);
                   dData = dwData;
                 } break;
                 case 2: {
@@ -375,8 +375,8 @@
               SetGlobalVariablePersistent(sEntry, TRUE);
             } break;
             case JS_GLOBALDATA_TYPE_STRING: {
-              FX_DWORD dwLength = *((FX_DWORD*)p);
-              p += sizeof(FX_DWORD);
+              uint32_t dwLength = *((uint32_t*)p);
+              p += sizeof(uint32_t);
 
               if (p + dwLength > pBuffer + nLength)
                 break;
@@ -398,7 +398,7 @@
 }
 
 void CJS_GlobalData::SaveGlobalPersisitentVariables() {
-  FX_DWORD nCount = 0;
+  uint32_t nCount = 0;
   CFX_BinaryBuf sData;
 
   for (int i = 0, sz = m_arrayGlobalData.GetSize(); i < sz; i++) {
@@ -421,9 +421,9 @@
   sFile.AppendBlock(&wType, sizeof(uint16_t));
   uint16_t wVersion = 2;
   sFile.AppendBlock(&wVersion, sizeof(uint16_t));
-  sFile.AppendBlock(&nCount, sizeof(FX_DWORD));
-  FX_DWORD dwSize = sData.GetSize();
-  sFile.AppendBlock(&dwSize, sizeof(FX_DWORD));
+  sFile.AppendBlock(&nCount, sizeof(uint32_t));
+  uint32_t dwSize = sData.GetSize();
+  sFile.AppendBlock(&dwSize, sizeof(uint32_t));
 
   sFile.AppendBlock(sData.GetBuffer(), sData.GetSize());
 
@@ -451,8 +451,8 @@
   uint16_t wType = (uint16_t)pData->nType;
   switch (wType) {
     case JS_GLOBALDATA_TYPE_NUMBER: {
-      FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
-      sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+      uint32_t dwNameLen = (uint32_t)name.GetLength();
+      sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
       sData.AppendString(name);
       sData.AppendBlock(&wType, sizeof(uint16_t));
 
@@ -460,8 +460,8 @@
       sData.AppendBlock(&dData, sizeof(double));
     } break;
     case JS_GLOBALDATA_TYPE_BOOLEAN: {
-      FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
-      sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+      uint32_t dwNameLen = (uint32_t)name.GetLength();
+      sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
       sData.AppendString(name);
       sData.AppendBlock(&wType, sizeof(uint16_t));
 
@@ -469,20 +469,20 @@
       sData.AppendBlock(&wData, sizeof(uint16_t));
     } break;
     case JS_GLOBALDATA_TYPE_STRING: {
-      FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
-      sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+      uint32_t dwNameLen = (uint32_t)name.GetLength();
+      sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
       sData.AppendString(name);
       sData.AppendBlock(&wType, sizeof(uint16_t));
 
-      FX_DWORD dwDataLen = (FX_DWORD)pData->sData.GetLength();
-      sData.AppendBlock(&dwDataLen, sizeof(FX_DWORD));
+      uint32_t dwDataLen = (uint32_t)pData->sData.GetLength();
+      sData.AppendBlock(&dwDataLen, sizeof(uint32_t));
       sData.AppendString(pData->sData);
     } break;
     case JS_GLOBALDATA_TYPE_NULL: {
-      FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
-      sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+      uint32_t dwNameLen = (uint32_t)name.GetLength();
+      sData.AppendBlock(&dwNameLen, sizeof(uint32_t));
       sData.AppendString(name);
-      sData.AppendBlock(&wType, sizeof(FX_DWORD));
+      sData.AppendBlock(&wType, sizeof(uint32_t));
     } break;
     default:
       break;
diff --git a/fpdfsdk/javascript/JS_Object.cpp b/fpdfsdk/javascript/JS_Object.cpp
index e6af576..9bfa857 100644
--- a/fpdfsdk/javascript/JS_Object.cpp
+++ b/fpdfsdk/javascript/JS_Object.cpp
@@ -97,8 +97,8 @@
                      CJS_Runtime* pRuntime,
                      int nType,
                      const CFX_WideString& script,
-                     FX_DWORD dwElapse,
-                     FX_DWORD dwTimeOut)
+                     uint32_t dwElapse,
+                     uint32_t dwTimeOut)
     : m_nTimerID(0),
       m_pEmbedObj(pObj),
       m_bProcessing(false),
diff --git a/fpdfsdk/javascript/JS_Object.h b/fpdfsdk/javascript/JS_Object.h
index 983b713..da15199 100644
--- a/fpdfsdk/javascript/JS_Object.h
+++ b/fpdfsdk/javascript/JS_Object.h
@@ -80,14 +80,14 @@
             CJS_Runtime* pRuntime,
             int nType,
             const CFX_WideString& script,
-            FX_DWORD dwElapse,
-            FX_DWORD dwTimeOut);
+            uint32_t dwElapse,
+            uint32_t dwTimeOut);
   ~CJS_Timer() override;
 
   void KillJSTimer();
 
   int GetType() const { return m_nType; }
-  FX_DWORD GetTimeOut() const { return m_dwTimeOut; }
+  uint32_t GetTimeOut() const { return m_dwTimeOut; }
   CJS_Runtime* GetRuntime() const { return m_bValid ? m_pRuntime : nullptr; }
   CFX_WideString GetJScript() const { return m_swJScript; }
 
@@ -100,14 +100,14 @@
   // CJS_Runtime::Observer
   void OnDestroyed() override;
 
-  FX_DWORD m_nTimerID;
+  uint32_t m_nTimerID;
   CJS_EmbedObj* const m_pEmbedObj;
   bool m_bProcessing;
   bool m_bValid;
 
   // data
   const int m_nType;  // 0:Interval; 1:TimeOut
-  const FX_DWORD m_dwTimeOut;
+  const uint32_t m_dwTimeOut;
   const CFX_WideString m_swJScript;
   CJS_Runtime* const m_pRuntime;
   CPDFDoc_Environment* const m_pApp;
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 5e403a5..1d57833 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -17,7 +17,7 @@
 #include "fpdfsdk/javascript/JS_Define.h"
 #include "fpdfsdk/javascript/JS_Object.h"
 
-static const FX_DWORD g_nan[2] = {0, 0x7FF80000};
+static const uint32_t g_nan[2] = {0, 0x7FF80000};
 static double GetNan() {
   return *(double*)g_nan;
 }
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 2f81791..41fa152 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -383,7 +383,7 @@
   }
 
   CJS_Runtime* pRuntime = pContext->GetJSRuntime();
-  FX_DWORD dwInterval = params.size() > 1 ? params[1].ToInt() : 1000;
+  uint32_t dwInterval = params.size() > 1 ? params[1].ToInt() : 1000;
 
   CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
   ASSERT(pApp);
@@ -421,7 +421,7 @@
     return TRUE;
   }
 
-  FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
+  uint32_t dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
 
   CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
   ASSERT(pApp);
diff --git a/fpdfsdk/pdfwindow/PWL_Button.cpp b/fpdfsdk/pdfwindow/PWL_Button.cpp
index 851b554..baf9ef0 100644
--- a/fpdfsdk/pdfwindow/PWL_Button.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Button.cpp
@@ -21,7 +21,7 @@
 }
 
 FX_BOOL CPWL_Button::OnLButtonDown(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   m_bMouseDown = TRUE;
@@ -30,7 +30,7 @@
   return TRUE;
 }
 
-FX_BOOL CPWL_Button::OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_Button::OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   ReleaseCapture();
diff --git a/fpdfsdk/pdfwindow/PWL_Button.h b/fpdfsdk/pdfwindow/PWL_Button.h
index 1fffa36..809b061 100644
--- a/fpdfsdk/pdfwindow/PWL_Button.h
+++ b/fpdfsdk/pdfwindow/PWL_Button.h
@@ -17,8 +17,8 @@
   // CPWL_Wnd
   CFX_ByteString GetClassName() const override;
   void OnCreate(PWL_CREATEPARAM& cp) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
 
  protected:
   FX_BOOL m_bMouseDown;
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index 1428e6b..c07233f 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -22,7 +22,7 @@
 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb))
 
 FX_BOOL CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point,
-                                    FX_DWORD nFlag) {
+                                    uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   if (m_bMouseDown) {
@@ -47,7 +47,7 @@
 
 FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar,
                                           FX_BOOL& bExit,
-                                          FX_DWORD nFlag) {
+                                          uint32_t nFlag) {
   if (!m_pList)
     return FALSE;
 
@@ -93,7 +93,7 @@
 
 FX_BOOL CPWL_CBListBox::OnCharWithExit(uint16_t nChar,
                                        FX_BOOL& bExit,
-                                       FX_DWORD nFlag) {
+                                       uint32_t nFlag) {
   if (!m_pList)
     return FALSE;
 
@@ -178,7 +178,7 @@
 }
 
 FX_BOOL CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point,
-                                     FX_DWORD nFlag) {
+                                     uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   SetCapture();
@@ -192,7 +192,7 @@
 }
 
 FX_BOOL CPWL_CBButton::OnLButtonUp(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   ReleaseCapture();
@@ -517,7 +517,7 @@
   }
 }
 
-FX_BOOL CPWL_ComboBox::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ComboBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
   if (!m_pList)
     return FALSE;
   if (!m_pEdit)
@@ -576,7 +576,7 @@
   return FALSE;
 }
 
-FX_BOOL CPWL_ComboBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ComboBox::OnChar(uint16_t nChar, uint32_t nFlag) {
   if (!m_pList)
     return FALSE;
 
@@ -603,7 +603,7 @@
 }
 
 void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd,
-                             FX_DWORD msg,
+                             uint32_t msg,
                              intptr_t wParam,
                              intptr_t lParam) {
   switch (msg) {
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.h b/fpdfsdk/pdfwindow/PWL_ComboBox.h
index 6d376e1..02f9d13 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.h
@@ -23,10 +23,10 @@
   ~CPWL_CBListBox() override {}
 
   // CPWL_ListBox
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
 
-  FX_BOOL OnKeyDownWithExit(uint16_t nChar, FX_BOOL& bExit, FX_DWORD nFlag);
-  FX_BOOL OnCharWithExit(uint16_t nChar, FX_BOOL& bExit, FX_DWORD nFlag);
+  FX_BOOL OnKeyDownWithExit(uint16_t nChar, FX_BOOL& bExit, uint32_t nFlag);
+  FX_BOOL OnCharWithExit(uint16_t nChar, FX_BOOL& bExit, uint32_t nFlag);
 };
 
 #define PWL_COMBOBOX_BUTTON_WIDTH 13
@@ -40,8 +40,8 @@
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
 };
 
 class CPWL_ComboBox : public CPWL_Wnd {
@@ -54,10 +54,10 @@
   // CPWL_Wnd:
   CFX_ByteString GetClassName() const override;
   void OnCreate(PWL_CREATEPARAM& cp) override;
-  FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
+  FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index b75c72f..f53f263 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -467,7 +467,7 @@
   }
 }
 
-FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) {
@@ -484,7 +484,7 @@
 }
 
 FX_BOOL CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDblClk(point, nFlag);
 
   if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) {
@@ -503,7 +503,7 @@
 #define WM_PWLEDIT_SELECTALL 0x07
 #define WM_PWLEDIT_SUGGEST 0x08
 
-FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
   if (m_bMouseDown)
     return FALSE;
 
@@ -862,7 +862,7 @@
     RemoveFlag(PES_SPELLCHECK);
 }
 
-FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
   if (m_bMouseDown)
     return TRUE;
 
@@ -903,7 +903,7 @@
 *If the event is swallowed, implementation may do other unexpected things, which
 *is not the control means to do.
 */
-FX_BOOL CPWL_Edit::IsProceedtoOnChar(uint16_t nKeyCode, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::IsProceedtoOnChar(uint16_t nKeyCode, uint32_t nFlag) {
   FX_BOOL bCtrl = IsCTRLpressed(nFlag);
   FX_BOOL bAlt = IsALTpressed(nFlag);
   if (bCtrl && !bAlt) {
@@ -931,7 +931,7 @@
   }
 }
 
-FX_BOOL CPWL_Edit::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) {
   if (m_bMouseDown)
     return TRUE;
 
@@ -983,7 +983,7 @@
 
 FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta,
                                 const CFX_FloatPoint& point,
-                                FX_DWORD nFlag) {
+                                uint32_t nFlag) {
   if (HasFlag(PES_MULTILINE)) {
     CFX_FloatPoint ptScroll = GetScrollPos();
 
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h
index 025cf2b..58793e3 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/pdfwindow/PWL_Edit.h
@@ -31,14 +31,14 @@
                                  FX_BOOL bKeyDown,
                                  FX_BOOL& bRC,
                                  FX_BOOL& bExit,
-                                 FX_DWORD nFlag) = 0;
+                                 uint32_t nFlag) = 0;
 #ifdef PDF_ENABLE_XFA
   virtual void OnPopupPreOpen(void* pPrivateData,
                               FX_BOOL& bExit,
-                              FX_DWORD nFlag) = 0;
+                              uint32_t nFlag) = 0;
   virtual void OnPopupPostOpen(void* pPrivateData,
                                FX_BOOL& bExit,
-                               FX_DWORD nFlag) = 0;
+                               uint32_t nFlag) = 0;
 #endif  // PDF_ENABLE_XFA
 };
 
@@ -56,14 +56,14 @@
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
   FX_BOOL OnMouseWheel(short zDelta,
                        const CFX_FloatPoint& point,
-                       FX_DWORD nFlag) override;
-  FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
+                       uint32_t nFlag) override;
+  FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
   CFX_FloatRect GetFocusRect() const override;
   void OnSetFocus() override;
   void OnKillFocus() override;
@@ -154,7 +154,7 @@
                                    FX_BOOL bArabic) const;
 
  public:
-  FX_BOOL IsProceedtoOnChar(uint16_t nKeyCode, FX_DWORD nFlag);
+  FX_BOOL IsProceedtoOnChar(uint16_t nKeyCode, uint32_t nFlag);
 
  private:
   IPWL_Filler_Notify* m_pFillerNotify;
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index 865495a..fe9dab9 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -72,7 +72,7 @@
 }
 
 void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd,
-                             FX_DWORD msg,
+                             uint32_t msg,
                              intptr_t wParam,
                              intptr_t lParam) {
   CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
@@ -142,7 +142,7 @@
   return m_pEdit->GetFontSize();
 }
 
-FX_BOOL CPWL_EditCtrl::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_EditCtrl::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
   if (m_bMouseDown)
     return TRUE;
 
@@ -217,7 +217,7 @@
   return bRet;
 }
 
-FX_BOOL CPWL_EditCtrl::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_EditCtrl::OnChar(uint16_t nChar, uint32_t nFlag) {
   if (m_bMouseDown)
     return TRUE;
 
@@ -292,7 +292,7 @@
 }
 
 FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point,
-                                     FX_DWORD nFlag) {
+                                     uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   if (ClientHitTest(point)) {
@@ -309,7 +309,7 @@
 }
 
 FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   if (m_bMouseDown) {
@@ -325,7 +325,7 @@
 }
 
 FX_BOOL CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnMouseMove(point, nFlag);
 
   if (m_bMouseDown)
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
index a617056..6d35ce9 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
@@ -103,13 +103,13 @@
   // CPWL_Wnd
   void OnCreate(PWL_CREATEPARAM& cp) override;
   void OnCreated() override;
-  FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index fb75665..560f8e0 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -133,7 +133,7 @@
     CPDF_Array* pA =
         m_pIconFit->GetDict() ? m_pIconFit->GetDict()->GetArrayBy("A") : NULL;
     if (pA) {
-      FX_DWORD dwCount = pA->GetCount();
+      uint32_t dwCount = pA->GetCount();
       if (dwCount > 0)
         fLeft = pA->GetNumberAt(0);
       if (dwCount > 1)
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.cpp b/fpdfsdk/pdfwindow/PWL_IconList.cpp
index a61bded..951b682 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/pdfwindow/PWL_IconList.cpp
@@ -165,7 +165,7 @@
 }
 
 FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CFX_FloatPoint& point,
-                                             FX_DWORD nFlag) {
+                                             uint32_t nFlag) {
   SetFocus();
 
   SetCapture();
@@ -179,7 +179,7 @@
 }
 
 FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CFX_FloatPoint& point,
-                                           FX_DWORD nFlag) {
+                                           uint32_t nFlag) {
   m_bMouseDown = FALSE;
   ReleaseCapture();
 
@@ -187,7 +187,7 @@
 }
 
 FX_BOOL CPWL_IconList_Content::OnMouseMove(const CFX_FloatPoint& point,
-                                           FX_DWORD nFlag) {
+                                           uint32_t nFlag) {
   if (m_bMouseDown) {
     int32_t nItemIndex = FindItemIndex(point);
     SetSelect(nItemIndex);
@@ -197,7 +197,7 @@
   return TRUE;
 }
 
-FX_BOOL CPWL_IconList_Content::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_IconList_Content::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
   switch (nChar) {
     case FWL_VKEY_Up:
       if (m_nSelectIndex > 0) {
@@ -375,7 +375,7 @@
 }
 
 void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd,
-                             FX_DWORD msg,
+                             uint32_t msg,
                              intptr_t wParam,
                              intptr_t lParam) {
   CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
@@ -464,7 +464,7 @@
 
 FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta,
                                     const CFX_FloatPoint& point,
-                                    FX_DWORD nFlag) {
+                                    uint32_t nFlag) {
   CFX_FloatPoint ptScroll = m_pListContent->GetScrollPos();
   CFX_FloatRect rcScroll = m_pListContent->GetScrollArea();
   CFX_FloatRect rcContents = m_pListContent->GetClientRect();
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.h b/fpdfsdk/pdfwindow/PWL_IconList.h
index b9fb2e5..53648d4 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/pdfwindow/PWL_IconList.h
@@ -75,10 +75,10 @@
  protected:
   // CPWL_ListCtrl
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
 
  private:
   CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const;
@@ -112,12 +112,12 @@
   // CPWL_Wnd
   FX_BOOL OnMouseWheel(short zDelta,
                        const CFX_FloatPoint& point,
-                       FX_DWORD nFlag) override;
+                       uint32_t nFlag) override;
   void OnCreated() override;
   void RePosChildWnd() override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
 
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index 244796b..d39d841 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -203,7 +203,7 @@
   }
 }
 
-FX_BOOL CPWL_ListBox::OnKeyDown(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
   CPWL_Wnd::OnKeyDown(nChar, nFlag);
 
   if (!m_pList)
@@ -250,7 +250,7 @@
   return TRUE;
 }
 
-FX_BOOL CPWL_ListBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnChar(uint16_t nChar, uint32_t nFlag) {
   CPWL_Wnd::OnChar(nChar, nFlag);
 
   if (!m_pList)
@@ -266,7 +266,7 @@
 }
 
 FX_BOOL CPWL_ListBox::OnLButtonDown(const CFX_FloatPoint& point,
-                                    FX_DWORD nFlag) {
+                                    uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   if (ClientHitTest(point)) {
@@ -281,7 +281,7 @@
   return TRUE;
 }
 
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   if (m_bMouseDown) {
@@ -299,7 +299,7 @@
   m_bHoverSel = bHoverSel;
 }
 
-FX_BOOL CPWL_ListBox::OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) {
   CPWL_Wnd::OnMouseMove(point, nFlag);
 
   if (m_bHoverSel && !IsCaptureMouse() && ClientHitTest(point)) {
@@ -316,7 +316,7 @@
 }
 
 void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
-                            FX_DWORD msg,
+                            uint32_t msg,
                             intptr_t wParam,
                             intptr_t lParam) {
   CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
@@ -367,7 +367,7 @@
 
 void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown,
                                       FX_BOOL& bExit,
-                                      FX_DWORD nFlag) {
+                                      uint32_t nFlag) {
   if (!m_pFillerNotify)
     return;
 
@@ -517,7 +517,7 @@
 
 FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta,
                                    const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   if (!m_pList)
     return FALSE;
 
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.h b/fpdfsdk/pdfwindow/PWL_ListBox.h
index 067aa2f..caee225 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.h
@@ -59,17 +59,17 @@
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override;
   FX_BOOL OnMouseWheel(short zDelta,
                        const CFX_FloatPoint& point,
-                       FX_DWORD nFlag) override;
+                       uint32_t nFlag) override;
   void KillFocus() override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   void RePosChildWnd() override;
@@ -79,7 +79,7 @@
 
   virtual CFX_WideString GetText() const;
 
-  void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL& bExit, FX_DWORD nFlag);
+  void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL& bExit, uint32_t nFlag);
 
   void AddString(const FX_WCHAR* str);
   void SetTopVisibleIndex(int32_t nItemIndex);
diff --git a/fpdfsdk/pdfwindow/PWL_Note.cpp b/fpdfsdk/pdfwindow/PWL_Note.cpp
index a2ff7c4..db7d1a5 100644
--- a/fpdfsdk/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Note.cpp
@@ -152,7 +152,7 @@
 }
 
 void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd,
-                              FX_DWORD msg,
+                              uint32_t msg,
                               intptr_t wParam,
                               intptr_t lParam) {
   if (m_bEnableNotify) {
@@ -333,7 +333,7 @@
 }
 
 FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CFX_FloatPoint& point,
-                                          FX_DWORD nFlag) {
+                                          uint32_t nFlag) {
   SetBorderStyle(PBS_INSET);
   InvalidateRect(NULL);
 
@@ -343,7 +343,7 @@
 }
 
 FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CFX_FloatPoint& point,
-                                        FX_DWORD nFlag) {
+                                        uint32_t nFlag) {
   m_bMouseDown = FALSE;
 
   SetBorderStyle(PBS_BEVELED);
@@ -466,7 +466,7 @@
 }
 
 void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd,
-                                  FX_DWORD msg,
+                                  uint32_t msg,
                                   intptr_t wParam,
                                   intptr_t lParam) {
   switch (msg) {
@@ -527,7 +527,7 @@
 }
 
 FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CFX_FloatPoint& point,
-                                          FX_DWORD nFlag) {
+                                          uint32_t nFlag) {
   if (CPWL_Wnd::OnLButtonDown(point, nFlag))
     return TRUE;
 
@@ -912,7 +912,7 @@
 }
 
 FX_BOOL CPWL_NoteItem::OnLButtonDown(const CFX_FloatPoint& point,
-                                     FX_DWORD nFlag) {
+                                     uint32_t nFlag) {
   if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) {
     SetNoteFocus(FALSE);
   }
@@ -923,7 +923,7 @@
 }
 
 FX_BOOL CPWL_NoteItem::OnRButtonUp(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) {
     SetNoteFocus(FALSE);
     PopupNoteItemMenu(point);
@@ -935,7 +935,7 @@
 }
 
 void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd,
-                             FX_DWORD msg,
+                             uint32_t msg,
                              intptr_t wParam,
                              intptr_t lParam) {
   switch (msg) {
@@ -1302,7 +1302,7 @@
 
 FX_BOOL CPWL_Note::OnMouseWheel(short zDelta,
                                 const CFX_FloatPoint& point,
-                                FX_DWORD nFlag) {
+                                uint32_t nFlag) {
   CFX_FloatPoint ptScroll = m_pContents->GetScrollPos();
   CFX_FloatRect rcScroll = m_pContents->GetScrollArea();
   CFX_FloatRect rcContents = m_pContents->GetClientRect();
@@ -1337,7 +1337,7 @@
 }
 
 void CPWL_Note::OnNotify(CPWL_Wnd* pWnd,
-                         FX_DWORD msg,
+                         uint32_t msg,
                          intptr_t wParam,
                          intptr_t lParam) {
   switch (msg) {
@@ -1462,7 +1462,7 @@
     m_pRBBox->SetTextColor(sTextColor);
 }
 
-FX_BOOL CPWL_Note::OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_Note::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
   if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) {
     if (IPWL_NoteNotify* pNotify = GetNoteNotify()) {
       int32_t x, y;
@@ -1479,7 +1479,7 @@
   return CPWL_Wnd::OnLButtonDown(point, nFlag);
 }
 
-FX_BOOL CPWL_Note::OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_Note::OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
   return CPWL_Wnd::OnRButtonUp(point, nFlag);
 }
 
diff --git a/fpdfsdk/pdfwindow/PWL_Note.h b/fpdfsdk/pdfwindow/PWL_Note.h
index e8fdbb8..1068999 100644
--- a/fpdfsdk/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/pdfwindow/PWL_Note.h
@@ -104,8 +104,8 @@
   // CPWL_Button
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
 
  private:
   FX_BOOL m_bMouseDown;
@@ -146,7 +146,7 @@
   FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) override;
   void SetText(const FX_WCHAR* csText) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   void RePosChildWnd() override;
@@ -203,10 +203,10 @@
   // CPWL_ListCtrl
   CFX_ByteString GetClassName() const override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
 
  private:
@@ -253,13 +253,13 @@
 
  protected:
   // CPWL_Wnd
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
   CFX_ByteString GetClassName() const override;
   void RePosChildWnd() override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) override;
@@ -316,15 +316,15 @@
   FX_BOOL IsTopItem() const override { return TRUE; }
   const CPWL_Note* GetNote() const override;
   IPWL_NoteNotify* GetNoteNotify() const override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
   FX_BOOL OnMouseWheel(short zDelta,
                        const CFX_FloatPoint& point,
-                       FX_DWORD nFlag) override;
+                       uint32_t nFlag) override;
   void RePosChildWnd() override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
 
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index d87f6b5..9db2aea 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -541,7 +541,7 @@
 }
 
 FX_BOOL CPWL_SBButton::OnLButtonDown(const CFX_FloatPoint& point,
-                                     FX_DWORD nFlag) {
+                                     uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   if (CPWL_Wnd* pParent = GetParentWindow())
@@ -554,7 +554,7 @@
 }
 
 FX_BOOL CPWL_SBButton::OnLButtonUp(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   if (CPWL_Wnd* pParent = GetParentWindow())
@@ -567,7 +567,7 @@
 }
 
 FX_BOOL CPWL_SBButton::OnMouseMove(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   CPWL_Wnd::OnMouseMove(point, nFlag);
 
   if (CPWL_Wnd* pParent = GetParentWindow()) {
@@ -702,7 +702,7 @@
 }
 
 FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point,
-                                      FX_DWORD nFlag) {
+                                      uint32_t nFlag) {
   CPWL_Wnd::OnLButtonDown(point, nFlag);
 
   if (HasFlag(PWS_AUTOTRANSPARENT)) {
@@ -758,7 +758,7 @@
 }
 
 FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CFX_FloatPoint& point,
-                                    FX_DWORD nFlag) {
+                                    uint32_t nFlag) {
   CPWL_Wnd::OnLButtonUp(point, nFlag);
 
   if (HasFlag(PWS_AUTOTRANSPARENT)) {
@@ -775,7 +775,7 @@
 }
 
 void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
-                              FX_DWORD msg,
+                              uint32_t msg,
                               intptr_t wParam,
                               intptr_t lParam) {
   CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
index 1603469..c03b20d 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
@@ -43,9 +43,9 @@
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override;
 
  protected:
   PWL_SCROLLBAR_TYPE m_eScrollBarType;
@@ -101,10 +101,10 @@
   void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override;
   void DrawThisAppearance(CFX_RenderDevice* pDevice,
                           CFX_Matrix* pUser2Device) override;
-  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
   void OnNotify(CPWL_Wnd* pWnd,
-                FX_DWORD msg,
+                uint32_t msg,
                 intptr_t wParam = 0,
                 intptr_t lParam = 0) override;
   void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
diff --git a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
index e79865e..b0b944e 100644
--- a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
@@ -38,7 +38,7 @@
 }
 
 FX_BOOL CPWL_CheckBox::OnLButtonUp(const CFX_FloatPoint& point,
-                                   FX_DWORD nFlag) {
+                                   uint32_t nFlag) {
   if (IsReadOnly())
     return FALSE;
 
@@ -46,7 +46,7 @@
   return TRUE;
 }
 
-FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_CheckBox::OnChar(uint16_t nChar, uint32_t nFlag) {
   SetCheck(!IsChecked());
   return TRUE;
 }
@@ -60,7 +60,7 @@
 }
 
 FX_BOOL CPWL_RadioButton::OnLButtonUp(const CFX_FloatPoint& point,
-                                      FX_DWORD nFlag) {
+                                      uint32_t nFlag) {
   if (IsReadOnly())
     return FALSE;
 
@@ -76,7 +76,7 @@
   return m_bChecked;
 }
 
-FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, FX_DWORD nFlag) {
+FX_BOOL CPWL_RadioButton::OnChar(uint16_t nChar, uint32_t nFlag) {
   SetCheck(TRUE);
   return TRUE;
 }
diff --git a/fpdfsdk/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/pdfwindow/PWL_SpecialButton.h
index 5aaf19b..eaaba26 100644
--- a/fpdfsdk/pdfwindow/PWL_SpecialButton.h
+++ b/fpdfsdk/pdfwindow/PWL_SpecialButton.h
@@ -26,8 +26,8 @@
 
   // CPWL_Button
   CFX_ByteString GetClassName() const override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
 
   void SetCheck(bool bCheck);
   bool IsChecked() const;
@@ -43,8 +43,8 @@
 
   // CPWL_Button
   CFX_ByteString GetClassName() const override;
-  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) override;
-  FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag) override;
+  FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override;
+  FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override;
 
   void SetCheck(bool bCheck);
   bool IsChecked() const;
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.h b/fpdfsdk/pdfwindow/PWL_Utils.h
index fed1528..6917083 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/pdfwindow/PWL_Utils.h
@@ -27,7 +27,7 @@
 #define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color / 255.0f))
 
 #define PWL_MAKEDWORD(low, high) \
-  ((FX_DWORD)((uint16_t)(low) | (FX_DWORD)(((uint16_t)(high)) << 16)))
+  ((uint32_t)((uint16_t)(low) | (uint32_t)(((uint16_t)(high)) << 16)))
 #define PWL_GETLOWWORD(dword) ((uint16_t)(dword))
 #define PWL_GETHIGHWORD(dword) ((uint16_t)(dword >> 16))
 
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index 66ad631..cb0955c 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -407,7 +407,7 @@
 }
 
 #define PWL_IMPLEMENT_KEY_METHOD(key_method_name)                      \
-  FX_BOOL CPWL_Wnd::key_method_name(uint16_t nChar, FX_DWORD nFlag) {  \
+  FX_BOOL CPWL_Wnd::key_method_name(uint16_t nChar, uint32_t nFlag) {  \
     if (IsValid() && IsVisible() && IsEnabled()) {                     \
       if (IsWndCaptureKeyboard(this)) {                                \
         for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { \
@@ -424,7 +424,7 @@
 
 #define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)                        \
   FX_BOOL CPWL_Wnd::mouse_method_name(const CFX_FloatPoint& point,           \
-                                      FX_DWORD nFlag) {                      \
+                                      uint32_t nFlag) {                      \
     if (IsValid() && IsVisible() && IsEnabled()) {                           \
       if (IsWndCaptureMouse(this)) {                                         \
         for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) {       \
@@ -468,7 +468,7 @@
 
 FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta,
                                const CFX_FloatPoint& point,
-                               FX_DWORD nFlag) {
+                               uint32_t nFlag) {
   if (IsValid() && IsVisible() && IsEnabled()) {
     SetCursor();
     if (IsWndCaptureKeyboard(this)) {
@@ -501,7 +501,7 @@
 }
 
 void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd,
-                        FX_DWORD msg,
+                        uint32_t msg,
                         intptr_t wParam,
                         intptr_t lParam) {
   switch (msg) {
@@ -549,15 +549,15 @@
                         (rcClient.top + rcClient.bottom) * 0.5f);
 }
 
-FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const {
+FX_BOOL CPWL_Wnd::HasFlag(uint32_t dwFlags) const {
   return (m_sPrivateParam.dwFlags & dwFlags) != 0;
 }
 
-void CPWL_Wnd::RemoveFlag(FX_DWORD dwFlags) {
+void CPWL_Wnd::RemoveFlag(uint32_t dwFlags) {
   m_sPrivateParam.dwFlags &= ~dwFlags;
 }
 
-void CPWL_Wnd::AddFlag(FX_DWORD dwFlags) {
+void CPWL_Wnd::AddFlag(uint32_t dwFlags) {
   m_sPrivateParam.dwFlags |= dwFlags;
 }
 
@@ -1006,7 +1006,7 @@
 
 void CPWL_Wnd::OnDisabled() {}
 
-FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const {
+FX_BOOL CPWL_Wnd::IsCTRLpressed(uint32_t nFlag) const {
   if (IFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
     return pSystemHandler->IsCTRLKeyDown(nFlag);
   }
@@ -1014,7 +1014,7 @@
   return FALSE;
 }
 
-FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const {
+FX_BOOL CPWL_Wnd::IsSHIFTpressed(uint32_t nFlag) const {
   if (IFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
     return pSystemHandler->IsSHIFTKeyDown(nFlag);
   }
@@ -1022,7 +1022,7 @@
   return FALSE;
 }
 
-FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const {
+FX_BOOL CPWL_Wnd::IsALTpressed(uint32_t nFlag) const {
   if (IFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
     return pSystemHandler->IsALTKeyDown(nFlag);
   }
@@ -1030,7 +1030,7 @@
   return FALSE;
 }
 
-FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const {
+FX_BOOL CPWL_Wnd::IsINSERTpressed(uint32_t nFlag) const {
   if (IFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
     return pSystemHandler->IsINSERTKeyDown(nFlag);
   }
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index 394e82d..d07adba 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -233,7 +233,7 @@
   IFX_Edit_FontMap* pFontMap;         // required for text window
   IPWL_Provider* pProvider;           // required for self coordinate
   IPWL_FocusHandler* pFocusHandler;   // optional
-  FX_DWORD dwFlags;                   // optional
+  uint32_t dwFlags;                   // optional
   CPWL_Color sBackgroundColor;        // optional
   FX_HWND hAttachedWnd;               // required for no-reader framework
   IPWL_SpellCheck* pSpellCheck;       // required for spellchecking
@@ -298,21 +298,21 @@
 
   void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);
 
-  virtual FX_BOOL OnKeyDown(uint16_t nChar, FX_DWORD nFlag);
-  virtual FX_BOOL OnKeyUp(uint16_t nChar, FX_DWORD nFlag);
-  virtual FX_BOOL OnChar(uint16_t nChar, FX_DWORD nFlag);
-  virtual FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnMButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnMButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnMButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
-  virtual FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag);
+  virtual FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag);
+  virtual FX_BOOL OnKeyUp(uint16_t nChar, uint32_t nFlag);
+  virtual FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag);
+  virtual FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnMButtonDblClk(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnMButtonDown(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnMButtonUp(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag);
+  virtual FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag);
   virtual FX_BOOL OnMouseWheel(short zDelta,
                                const CFX_FloatPoint& point,
-                               FX_DWORD nFlag);
+                               uint32_t nFlag);
 
   virtual void SetFocus();
   virtual void KillFocus();
@@ -320,7 +320,7 @@
   void ReleaseCapture();
 
   virtual void OnNotify(CPWL_Wnd* pWnd,
-                        FX_DWORD msg,
+                        uint32_t msg,
                         intptr_t wParam = 0,
                         intptr_t lParam = 0);
   virtual void SetTextColor(const CPWL_Color& color);
@@ -348,9 +348,9 @@
   CFX_FloatPoint GetCenterPoint() const;
   int32_t GetBorderWidth() const;
   FX_BOOL IsVisible() const { return m_bVisible; }
-  FX_BOOL HasFlag(FX_DWORD dwFlags) const;
-  void AddFlag(FX_DWORD dwFlags);
-  void RemoveFlag(FX_DWORD dwFlags);
+  FX_BOOL HasFlag(uint32_t dwFlags) const;
+  void AddFlag(uint32_t dwFlags);
+  void RemoveFlag(uint32_t dwFlags);
   const CFX_FloatRect& GetClipRect() const;
   CPWL_Wnd* GetParentWindow() const;
   int32_t GetBorderStyle() const;
@@ -434,10 +434,10 @@
   FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd* pWnd) const;
   const CPWL_Wnd* GetRootWnd() const;
 
-  FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const;
-  FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const;
-  FX_BOOL IsALTpressed(FX_DWORD nFlag) const;
-  FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const;
+  FX_BOOL IsCTRLpressed(uint32_t nFlag) const;
+  FX_BOOL IsSHIFTpressed(uint32_t nFlag) const;
+  FX_BOOL IsALTpressed(uint32_t nFlag) const;
+  FX_BOOL IsINSERTpressed(uint32_t nFlag) const;
 
  private:
   void AddChild(CPWL_Wnd* pWnd);
diff --git a/testing/libfuzzer/pdf_jpx_fuzzer.cc b/testing/libfuzzer/pdf_jpx_fuzzer.cc
index 8e16f24..12d2061 100644
--- a/testing/libfuzzer/pdf_jpx_fuzzer.cc
+++ b/testing/libfuzzer/pdf_jpx_fuzzer.cc
@@ -21,9 +21,9 @@
   if (!decoder)
     return 0;
 
-  FX_DWORD width;
-  FX_DWORD height;
-  FX_DWORD components;
+  uint32_t width;
+  uint32_t height;
+  uint32_t components;
   g_module.GetImageInfo(decoder.get(), &width, &height, &components);
 
   FXDIB_Format format;
@@ -43,7 +43,7 @@
     return 0;
 
   std::vector<uint8_t> output_offsets(components);
-  for (FX_DWORD i = 0; i < components; ++i)
+  for (uint32_t i = 0; i < components; ++i)
     output_offsets[i] = i;
 
   g_module.Decode(decoder.get(), bitmap->GetBuffer(), bitmap->GetPitch(),