Skip to content

Commit

Permalink
remove jep106.ids
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ive committed Oct 31, 2023
1 parent a461f91 commit fb0a0a0
Show file tree
Hide file tree
Showing 10 changed files with 1,981 additions and 1,977 deletions.
1 change: 0 additions & 1 deletion .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
copy pnp.ids nwinfo\pnp.ids
copy libcdi\libcdi.dll nwinfo\libcdi.dll
copy libcdi\libcdix64.dll nwinfo\libcdix64.dll
copy libnw\jep106.ids nwinfo\jep106.ids
# copy winring0\WinRing0.sys nwinfo\WinRing0.sys
# copy winring0\WinRing0x64.sys nwinfo\WinRing0x64.sys
copy winring0\HwRwDrv.sys nwinfo\HwRwDrv.sys
Expand Down
47 changes: 10 additions & 37 deletions libnw/ids.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,45 +225,18 @@ NWL_GetPnpManufacturer(PNODE nd, CHAR* Ids, DWORD IdsSize, CONST CHAR* Code)
NWL_NodeAttrSet(nd, "Manufacturer", "UNKNOWN", 0);
}

#define JEP106_DB
#include "jep106.h"

VOID
NWL_GetSpdManufacturer(PNODE nd, CHAR* Ids, DWORD IdsSize, UINT Bank, UINT Item)
NWL_GetSpdManufacturer(PNODE nd, UINT Bank, UINT Item)
{
DWORD Offset = 0;
CHAR* bLine = NULL;
CHAR* iLine = NULL;
CHAR* p = NULL;

Bank++;

bLine = IdsGetline(Ids, IdsSize, &Offset);
while (bLine)
{
if (isdigit(bLine[0])
&& Bank == strtoul(bLine, NULL, 10))
{
iLine = IdsGetline(Ids, IdsSize, &Offset);
while (iLine)
{
if (!isspace(iLine[0]) || !isdigit(iLine[1]))
{
free(iLine);
free(bLine);
goto fail;
}
if (Item == strtoul(iLine, &p, 10) && isspace(p[0]))
{
NWL_NodeAttrSet(nd, "Manufacturer", &p[1], 0);
free(iLine);
free(bLine);
return;
}
free(iLine);
iLine = IdsGetline(Ids, IdsSize, &Offset);
}
}
free(bLine);
bLine = IdsGetline(Ids, IdsSize, &Offset);
}
if (Bank >= ARRAYSIZE(JEP106_IDS) || Item >= JEP106_ITEM_COUNT)
goto fail;
if (!JEP106_IDS[Bank][Item])
goto fail;
NWL_NodeAttrSet(nd, "Manufacturer", JEP106_IDS[Bank][Item], 0);
return;
fail:
NWL_NodeAttrSetf(nd, "Manufacturer", 0, "%02X%02X", Bank, Item);
}
Expand Down
Loading

0 comments on commit fb0a0a0

Please sign in to comment.