Skip to content

NEWS api broken due to wrong service being used #587

@Dathuss

Description

@Dathuss

Bug Report

What's the issue you encountered?

Hello !
So I've been messing with the Notifications api (NEWS) but i quickly noticed that some of the functions were never returning successful codes. Well, every single one actually, except NEWS_AddNotification.
Checking the code I saw that the "news:u" system service was being used over the "news:s"
According to 3dsbew, "news:u" supports only one command compared to literally every single command for "news:s". I don't know why ctru does this but this leads to none of the NEWS_* functions currently working.
Manually replacing srvGetServiceHandle("news:u") with srvGetServiceHandle("news:s") here magically fixes

idk what else there is to add, it literally doesn't work lmao

How can the issue be reproduced?

newsInit(); // shouldn't fail
u32 notificationCount;
Result result = NEWS_GetTotalNotifications(&notificationCount); // this will very much fail
printf("Result code: 0x%08lX", (u32)result); // prints '0xD900182F'

There's also a pretty easy way to notice this with no lines of code. If you install NotifyMii you'll see the application is very unstable and will crash pretty quickly. This is because NotifyMii always assumes api functions are successful (which they currently very much aren't) and reads garbage data.

Fix

news.c : Replace res = srvGetServiceHandle(&newsHandle, "news:u"); with res = srvGetServiceHandle(&newsHandle, "news:s");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions